akkounts/app/views/admin/donations/index.html.erb
Sebastian Kippe 40f3e8327a
Basic donation records
Adds donation model/table and basic manual management in the admin
panel, as well as basic listing of users' own donations.
2020-12-17 21:56:51 +01:00

40 lines
1.0 KiB
Plaintext

<h2>Donations</h2>
<% if @donations.any? %>
<table>
<thead>
<tr>
<th>User</th>
<th>Amount BTC (sats)</th>
<th>in EUR</th>
<th>in USD</th>
<th>Public name</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @donations.each do |donation| %>
<tr>
<td><%= donation.user.cn %></td>
<td><%= donation.amount_sats %></td>
<td><%= donation.amount_eur %></td>
<td><%= donation.amount_usd %></td>
<td><%= donation.public_name %></td>
<td><%= link_to 'Show', admin_donation_path(donation) %></td>
<td><%= link_to 'Edit', edit_admin_donation_path(donation) %></td>
<td><%= link_to 'Destroy', admin_donation_path(donation), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>
No donations yet.
</p>
<% end %>
<p class="actions">
<%= link_to 'Record an out-of-system donation', new_admin_donation_path %>
</p>