Changesets can be listed by changeset number.
The Git repository is here.
Changeset 472
Hide closed and expired polls by default, with a link to show them
- Comitted by: rool
- Date: Saturday January 26 10:35:05 2019 (over 5 years ago)
Affected files:
- rool/rails/canvass/trunk/app/controllers/polls_controller.rb (diff)
- rool/rails/canvass/trunk/app/views/polls/_list.html.erb (diff)
- rool/rails/canvass/trunk/public/stylesheets/default_general.css (diff)
rool/rails/canvass/trunk/app/controllers/polls_controller.rb:
prev. | current | |
@user = nil | ||
extra_conditions = nil | ||
user_id = params[ :user_id ] | ||
40 | omit_closed = params[ :closed ].blank? | |
41 | | |
42 | if ( user_id.nil? ) | |
43 | if ( omit_closed ) | |
44 | extra_conditions = [ "workflow_state NOT IN ('#{ Poll::STATE_COMPLETED}', '#{Poll::STATE_EXPIRED}')" ] | |
45 | end | |
46 | else | |
redirect_to polls_path and return unless ( current_user.admin? ) | ||
@user = User.find_by_id( user_id ) |
rool/rails/canvass/trunk/app/views/polls/_list.html.erb:
prev. | current | |
<tfoot> | ||
<tr> | ||
<td colspan="5"> | ||
44 | | |
45 | | |
44 | <div class="buttons"> | |
45 | <%= apphelp_protected_button_to( :new, { :method => :new_poll_path } ) %> | |
46 | <%= render :partial => 'shared/leightbox_button' %> | |
47 | </div> | |
48 | <%= apphelp_i18n_will_paginate( @items ) %> | |
49 | <div class="links"> | |
<% | ||
if ( defined?( MATCHING_POT_LOCATION ) && | ||
defined?( MATCHING_POT_CURRENCY ) && | ||
... | ... | |
<% end -%> | ||
<% end -%> | ||
<a href="/content/documents/bounties">More information</a> | | ||
71 | | |
75 | <% if params[ :closed ].blank? -%> | |
76 | <%= link_to "Show closed & expired items", polls_path( :closed => 'yes' ) %> | |
77 | <% else -%> | |
78 | <%= link_to "Hide closed & expired items", polls_path() %> | |
79 | <% end -%> | |
80 | | <a href="/forum/forums/8">Forum</a> | |
</div> | ||
73 | | |
74 | | |
75 | ||
76 | | |
</td> | ||
</tr> | ||
</tfoot> |
rool/rails/canvass/trunk/public/stylesheets/default_general.css:
prev. | current | |
margin-top: 3px; | ||
} | ||
435 | div.content tfoot div.links { | |
436 | clear: left; | |
437 | margin-top: 3px; | |
438 | } | |
439 | ||
div.content tfoot div.buttons { | ||
margin-top: 3px; | ||
float: right; |