Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 464
- Log:
Canvass version 1.0.2.
- Author:
- rool
- Date:
- Sat May 03 09:48:48 +0100 2014
- Size:
- 3382 Bytes
1 | <% |
2 | # Make sure that "@items" contains the pagination-enabled list of items to |
3 | # show and render with "render :partial => 'list'". |
4 | -%> |
5 | <div class="searchable_list" id="donations"> |
6 | <% if @items.empty? -%> |
7 | <%= apphelp_view_hint( :no_index_items, DonationsController ) %> |
8 | <p /> |
9 | <div class="buttons"> |
10 | <%= apphelp_protected_button_to( :index, { :method => :polls_path, :controller => PollsController } ) %> |
11 | </div> |
12 | <br /><br /> |
13 | <% else -%> |
14 | <table border="1" cellspacing="1" cellpadding="0"> |
15 | <thead> |
16 | <tr> |
17 | <% |
18 | sort_header_array = params.has_key?( :poll_id ) && controller_name == "polls" ? [] : [ :poll_title ] |
19 | sort_header_array += %w{ amount_for_sorting updated_at } |
20 | sort_header_array = %w{ user_name user_email } + sort_header_array if ( current_user.admin? ) |
21 | |
22 | table_head_colspan = sort_header_array.count |
23 | |
24 | sort_headers_for :donation, sort_header_array do | header | |
25 | Donation.human_attribute_name( header ) |
26 | end |
27 | %> |
28 | <th class="spinner corner"><div id="spinner" style="display: none"></div></th> |
29 | </tr> |
30 | </thead> |
31 | |
32 | <tbody> |
33 | <% for donation in @items -%> |
34 | <tr class="<%= cycle( 'odd', 'even' ) %>"> |
35 | <% if ( current_user.admin? ) -%> |
36 | <% if ( donation.redistribution? ) -%> |
37 | <td>—</td> |
38 | <td>—</td> |
39 | <% else -%> |
40 | <td><%= donationshelp_user_link( donation ) %></td> |
41 | <td><%= mail_to( donation.user_email ) %></td> |
42 | <% end -%> |
43 | <% end -%> |
44 | <% unless ( params.has_key?( :poll_id ) && controller_name == "polls" ) %> |
45 | <td><%= donationshelp_poll_link( donation ) %></td> |
46 | <% end -%> |
47 | <td class="financial"> |
48 | <span class="<%= donation.debit? ? 'donation_debit' : 'donation_credit' %>"><%= currencyhelp_compose( donation.currency, donation.amount_integer, donation.amount_fraction ) %></span> |
49 | <% if ( donation.debit? ) -%> |
50 | <br /> |
51 | <span class="view_hint"><%= apphelp_view_hint( :debit, DonationsController ) %></span> |
52 | <% elsif ( donation.redistribution? ) -%> |
53 | <br /> |
54 | <span class="view_hint"><%= apphelp_view_hint( :redistribution, DonationsController, :source => donationshelp_source_poll_link( donation ) ) %></span> |
55 | <% end -%> |
56 | </td> |
57 | <td><%= donation.updated_at %></td> |
58 | <td> |
59 | <% if ( donation.redistribution? ) -%> |
60 | — |
61 | <% else -%> |
62 | <%= apphelp_protected_link_to( :show, { :method => :user_donation_path, :controller => DonationsController }, { :id => donation.id, :user_id => donation.user_id } ) %> |
63 | <% end -%> |
64 | </td> |
65 | </tr> |
66 | <% end -%> |
67 | </tbody> |
68 | |
69 | <% |
70 | # This may be rendered by the Polls Controller for a 'show' view, so don't |
71 | # add any buttons if so. If rendered by the Donations Controller, add them. |
72 | |
73 | if ( controller_name == "donations" ) |
74 | -%> |
75 | <tfoot> |
76 | <tr> |
77 | <td colspan="<%= table_head_colspan + 1 %>"> |
78 | <div class="pagination"> |
79 | <%= apphelp_i18n_will_paginate( @items ) %> |
80 | </div> |
81 | <div class="buttons"> |
82 | <%= apphelp_protected_button_to( :index, { :method => :polls_path, :controller => PollsController } ) %> |
83 | <%= render :partial => 'shared/leightbox_button' %> |
84 | </div> |
85 | </td> |
86 | </tr> |
87 | </tfoot> |
88 | <% end -%> |
89 | </table> |
90 | <% end -%> |
91 | </div> |