akkounts/app/views/admin/donations/index.html.erb
Sebastian Kippe 2b00eebb73
All checks were successful
continuous-integration/drone/push Build is passing
Fix delete link, remove obsolete notice
2022-02-21 11:19:07 -06:00

45 lines
1.6 KiB
Plaintext

<%= render HeaderComponent.new(title: "Donations") %>
<%= render MainSimpleComponent.new 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><% if donation.amount_eur.present? %><%= number_to_currency donation.amount_eur / 100, unit: "" %><% end %></td>
<td><% if donation.amount_usd.present? %><%= number_to_currency donation.amount_usd / 100, unit: "" %><% end %></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',
data: { turbo_method: :delete, 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 %>