<% if receiver.activity_ties_for?(current_subject) %> <% content_for :javascript do %> securityImage = "<%= escape_javascript(image_tag('btn/btn_security.png', :id => 'security_image', :alt => 'security')) %>"; downImage = "<%= escape_javascript(image_tag('btn/btn_down.png')) %>"; $("#security").dropdownchecklist( { closeRadioOnClick: true } ); $("#security_image").parent().width(28); $("#security_image").parent().parent().width(28); <% end %>
<%= form_for Post.new(:text => t('activity.input'), :_activity_tie_id => receiver.activity_ties_for(current_subject).first.id), :remote => true do |f| %> <%= f.text_field :text, :id => "input_activities", :size => 85 %>
<% if receiver.activity_ties_for(current_subject).count > 1 %>
<%= f.select :_activity_tie_id, receiver.activity_ties_for(current_subject).sort{ |t, u| t.relation <=> u.relation }.map{ |t| [ t.relation_name, t.id ] }, {}, :id => 'security' %>
<% else %> <%= f.hidden_field :_activity_tie_id %> <% end %> <%= f.submit t('share'), :class =>"myButtonBlue" %>
<% end -%>
<% end %>