Commit 7532dfd0a54b91e962465cf360c43a0068d5947c
1 parent
cf972b57
Exists in
master
and in
11 other branches
proposals_discussion: small fixes
Showing
5 changed files
with
17 additions
and
6 deletions
Show diff stats
lib/proposals_discussion_plugin/proposals_list_helper.rb
0 → 100644
| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | +module ProposalsDiscussionPlugin::ProposalsListHelper | |
| 2 | + | |
| 3 | + def more_proposals(text, holder, order, page=1) | |
| 4 | + link_to '', url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order, :page => page }) | |
| 5 | + end | |
| 6 | + | |
| 7 | +end | ... | ... |
public/style.css
views/content_viewer/_proposals_list.html.erb
| ... | ... | @@ -18,9 +18,10 @@ |
| 18 | 18 | proposalsScroll(); |
| 19 | 19 | }); |
| 20 | 20 | }); |
| 21 | - | |
| 22 | 21 | </script> |
| 23 | 22 | |
| 23 | +<% extend ProposalsDiscussionPlugin::ProposalsListHelper %> | |
| 24 | + | |
| 24 | 25 | <% private_proposals = user ? @page.proposals.private(user) : [] %> |
| 25 | 26 | <% unless private_proposals.empty? %> |
| 26 | 27 | <div class="private-proposals"> |
| ... | ... | @@ -33,8 +34,8 @@ |
| 33 | 34 | <div class="proposals_list"> |
| 34 | 35 | <h5><%= _('Proposals') %></h5> |
| 35 | 36 | <div class="filters"> |
| 36 | - <% [[_('Random'), :random], [_('Aplhabetical'), :alphabetical]].each do |order| %> | |
| 37 | - <%= link_to order.first, url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order.second}), :remote => true, :class => 'order' %> | |
| 37 | + <% [[_('Random'), :random], [_('Aplhabetical'), :alphabetical]].each_with_index do |order, i| %> | |
| 38 | + <%= link_to order.first, url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order.second}), :remote => true, :class => "order #{order.second} #{i==0 ? 'selected':''}" %> | |
| 38 | 39 | <% end %> |
| 39 | 40 | </div> |
| 40 | 41 | <div class="clear"></div> |
| ... | ... | @@ -42,7 +43,7 @@ |
| 42 | 43 | <div class="proposals"> |
| 43 | 44 | <div class="more"> |
| 44 | 45 | <img src="/images/loading.gif" alt="Loading" /><%= _("Loading...") %> |
| 45 | - <%= link_to '', url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :order => order }) %> | |
| 46 | + <%= more_proposals('', holder, order) %> | |
| 46 | 47 | </div> |
| 47 | 48 | </div> |
| 48 | 49 | </div> | ... | ... |
views/content_viewer/_proposals_list_content.html.erb
| 1 | 1 | <%= render :partial => 'content_viewer/proposal_card', :collection => proposals %> |
| 2 | 2 | |
| 3 | +<% extend ProposalsDiscussionPlugin::ProposalsListHelper %> | |
| 4 | + | |
| 3 | 5 | <div class="more"> |
| 4 | - <%= link_to _('More'), url_for({:controller => 'proposals_discussion_plugin_public', :action => 'load_proposals', :holder_id => holder.id, :profile => profile.identifier, :page => page, :order => order }) %> | |
| 6 | + <%= more_proposals(_('More'), holder, order, page) %> | |
| 5 | 7 | </div> | ... | ... |
views/content_viewer/proposal.html.erb
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | <% if @page.allow_edit?(user) && !@page.published %> |
| 22 | 22 | <div class="actions"> |
| 23 | - <%= link_to url_for({:controller => 'proposals_discussion_plugin_myprofile', :action => 'publish_proposal', :proposal_id => @page.id}), :class => 'button with-text icon-add' do %> | |
| 23 | + <%= link_to url_for({:controller => 'proposals_discussion_plugin_myprofile', :action => 'publish_proposal', :proposal_id => @page.id}), :class => 'button with-text icon-suggest' do %> | |
| 24 | 24 | <strong><%= _("Publish") %></strong> |
| 25 | 25 | <% end %> |
| 26 | 26 | </div> | ... | ... |