donate/app/views/nkuht_donates/donate_list.html.erb

51 lines
1.7 KiB
Plaintext

<% # encoding: utf-8 %>
<%
data = action_data
@nkuht_donates = data["nkuht_donates"]
@total_pages = data["total_pages"]
%>
<div class="searchClear pull-left" style="clear: left;">
<form action="" method="get">
捐款人姓名: <%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %>
<input type="hidden" name="method" value="donate_list">
</form>
</div>
<br />
<div>
<h3 class="nkuht-donate-title">捐款芳名錄</h3>
<table class="nkuht-donate-table table table-striped table-bordered">
<thead>
<tr>
<th>捐款日期</th>
<th>捐款人</th>
<th>捐款用途</th>
<th>捐款金額</th>
</tr>
</thead>
<tbody>
<% @nkuht_donates.each do |nkuht_donate| %>
<tr>
<td><%= (nkuht_donate.donation_serial_date.to_date.strftime("%Y").to_i - 1911 ).to_s + nkuht_donate.donation_serial_date.to_date.strftime("/%m/%d") %></td>
<td><%=nkuht_donate.name%></td>
<td>
<%=
if !nkuht_donate.nkuht_donate_use.blank?
if nkuht_donate.nkuht_donate_use.title == '其他' or nkuht_donate.nkuht_donate_use.title == 'Other'
"#{nkuht_donate.nkuht_donate_use.title}(#{nkuht_donate.donation_use_other})"
else
nkuht_donate.nkuht_donate_use.title
end
else
nil
end
%></td>
<td><%= number_to_currency(nkuht_donate.donation_amount, unit: '', precision: 0) %>元</td>
<% end %>
</tbody>
</table>
</div>
<%= create_pagination(@total_pages).html_safe if @total_pages > 1 %>