% if can? :create, new_post(receiver) %>
<% if current_subject == receiver %>
<%= javascript_tag do %>
var relation_public = <%= receiver.relation_public.id %>;
var public_selected = false;
var relation_options = <%= escape_javascript(current_subject.activity_relations(receiver).sort.map{ |r| r.id }.to_json) %>;
var relation_public_pos = 0;
for(id in relation_options){
if(relation_options[id]==relation_public){
break;
}else{
relation_public_pos++;
}
}
//For security with check "var default_security_width = '100px';" in activities.js.erb
<% end %>
<%= select_tag :_relation_ids, options_for_select(current_subject.activity_relations(receiver).sort.map{ |r| [ r.name, r.id ] }), :id => 'security', :multiple => true, :title => t("activity.privacy.myself.contacts.#{ receiver.class.to_s.underscore }") %>
<% else %>
<% end %>
<%= submit_tag(t('share'), :class => "button submitActivity", :id => "masterSubmitButton") %>
<% end %>