diff --git a/app/assets/stylesheets/donations.scss b/app/assets/stylesheets/donations.scss new file mode 100644 index 0000000..ef401ab --- /dev/null +++ b/app/assets/stylesheets/donations.scss @@ -0,0 +1,40 @@ +ul.donations { + list-style: none; + + li { + margin-bottom: 2rem; + display: grid; + grid-row-gap: 0.5rem; + grid-column-gap: 2rem; + grid-template-columns: 1fr 1fr; + grid-template-areas: + "date amount-btc" + "public-name amounts-fiat"; + + h3 { + grid-area: "date"; + margin-bottom: 0; + } + + p { + margin-bottom: 0; + + &.amount-btc { + grid-area: amount-btc; + text-align: right; + font-family: monospace; + font-size: 1.25rem; + } + &.amounts-fiat { + grid-area: amounts-fiat; + text-align: right; + font-family: monospace; + font-size: 0.85rem; + color: #888; + } + &.public-name { + grid-area: public-name; + } + } + } +} diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..e2ff699 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,5 @@ module ApplicationHelper + def sats_to_btc(sats) + sats.to_f / 100000000 + end end diff --git a/app/views/donations/index.html.erb b/app/views/donations/index.html.erb index 67c2fe2..f2a3e8d 100644 --- a/app/views/donations/index.html.erb +++ b/app/views/donations/index.html.erb @@ -1,29 +1,38 @@ -
Amount BTC (sats) | -in EUR | -in USD | -Public name | -
---|---|---|---|
<%= donation.amount_sats %> | -<%= donation.amount_eur %> | -<%= donation.amount_usd %> | -<%= donation.public_name %> | -
- No donations to show. + Your financial contributions to the development and + upkeep of Kosmos software and services.
-<% end %> ++ <%= sats_to_btc donation.amount_sats %> BTC +
++ (~ <%= number_to_currency donation.amount_eur / 100 %> EUR) +
++ <% if donation.public_name.present? %> + Public name: <%= donation.public_name %> + <% else %> + Anonymous + <% end %> +
++ No donations to show. +
+ <% end %> +