akkounts/app/views/admin/donations/index.html.erb
Sebastian Kippe 2e301c3019
All checks were successful
continuous-integration/drone/push Build is passing
Port admin to new layout
2022-02-20 11:22:06 -06:00

44 lines
1.6 KiB
Plaintext

<%= render partial: "components/header", locals: { page_title: "Donations" } %>
<%= render layout: "components/main_simple" do %>
<% if @donations.any? %>
<table class="w-full">
<thead>
<tr class="text-left">
<th>User</th>
<th>Amount BTC</th>
<th>in EUR</th>
<th>in USD</th>
<th>Public name</th>
<th>Date</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @donations.each do |donation| %>
<tr>
<td><%= donation.user.address %></td>
<td><%= sats_to_btc donation.amount_sats %> BTC</td>
<td><%= number_to_currency donation.amount_eur / 100, unit: "" %></td>
<td><%= number_to_currency donation.amount_usd / 100, unit: "" %></td>
<td><%= donation.public_name %></td>
<td><%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %></td>
<td><%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
<td><%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
<td><%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>
No donations yet.
</p>
<% end %>
<p class="mt-12">
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
</p>
<% end %>