app/views/activities/_new.html.erb in social_stream-base-0.5.2 vs app/views/activities/_new.html.erb in social_stream-base-0.6.0

- old
+ new

@@ -1,30 +1,25 @@ -<% if receiver.activity_ties_for?(current_subject) %> +<% if can? :create, new_activity(receiver) %> <% 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").dropdownchecklist( { closeRadioOnClick: true, forceMultiple: false } ); $("#security_image").parent().width(28); $("#security_image").parent().parent().width(28); <% end %> - <div id="activities_header" class="content_size"> - <%= 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 %> - <div id="activities_share_btn"> +<div id="activities_header" class="content_size"> + <% SocialStream.activity_forms.each do |element| %> + <%= render :partial => element.to_s.pluralize+'/new', + :locals => { + :receiver => receiver + } %> + <% end %> +</div> - <% if receiver.activity_ties_for(current_subject).count > 1 %> - <div id="securities"> - <%= 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' %> - </div> - <% else %> - <%= f.hidden_field :_activity_tie_id %> - <% end %> - <%= f.submit t('share'), :class =>"myButtonBlue" %> - </div> - <% end -%> - </div> +<div id="activities_share_btn"> +<div id="securities"><%= select_tag :_relation_ids, grouped_options_for_select(current_subject.grouped_activity_relations(receiver)), :id => 'security', :multiple => nil %></div> +<%= submit_tag(t('share'), :class => "myButtonBlue", :id => "masterSubmitButton") %> +</div> <% end %>