Format and style user donations

This commit is contained in:
2020-12-19 13:16:04 +01:00
parent 40f3e8327a
commit 2f70bae523
4 changed files with 88 additions and 27 deletions

View File

@@ -1,29 +1,38 @@
<h2>Donations</h2>
<% if @donations.any? %>
<table>
<thead>
<tr>
<th>Amount BTC (sats)</th>
<th>in EUR</th>
<th>in USD</th>
<th>Public name</th>
</tr>
</thead>
<tbody>
<% @donations.each do |donation| %>
<tr>
<td><%= donation.amount_sats %></td>
<td><%= donation.amount_eur %></td>
<td><%= donation.amount_usd %></td>
<td><%= donation.public_name %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<section>
<h2>Donations</h2>
<p>
No donations to show.
Your financial contributions to the development and
upkeep of Kosmos software and services.
</p>
<% end %>
</section>
<section>
<% if @donations.any? %>
<ul class="donations">
<% @donations.each do |donation| %>
<li>
<h3>
<%= donation.created_at.strftime("%B %d, %Y") %>
</h3>
<p class="amount-btc">
<%= sats_to_btc donation.amount_sats %> BTC
</p>
<p class="amounts-fiat">
(~ <%= number_to_currency donation.amount_eur / 100 %> EUR)
</p>
<p class="public-name">
<% if donation.public_name.present? %>
Public name: <%= donation.public_name %>
<% else %>
Anonymous
<% end %>
</p>
</li>
<% end %>
</ul>
<% else %>
<p>
No donations to show.
</p>
<% end %>
</section>