From 1a55e5e89514704f5686879f7f747877da6df088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 25 Feb 2023 15:32:13 +0800 Subject: [PATCH] Link users everywhere in admin panel --- app/views/admin/donations/index.html.erb | 3 +- app/views/admin/donations/show.html.erb | 57 ++++++++++++------------ app/views/admin/lightning/index.html.erb | 2 +- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/app/views/admin/donations/index.html.erb b/app/views/admin/donations/index.html.erb index 0876cd7..1074843 100644 --- a/app/views/admin/donations/index.html.erb +++ b/app/views/admin/donations/index.html.erb @@ -33,11 +33,10 @@ - <% @donations.each do |donation| %> - <%= donation.user.address %> + <%= link_to donation.user.address, admin_user_path(donation.user.address), class: 'ks-text-link' %> <%= sats_to_btc donation.amount_sats %> <% if donation.amount_eur.present? %><%= number_to_currency donation.amount_eur / 100, unit: "" %><% end %> <% if donation.amount_usd.present? %><%= number_to_currency donation.amount_usd / 100, unit: "" %><% end %> diff --git a/app/views/admin/donations/show.html.erb b/app/views/admin/donations/show.html.erb index 0c1d54c..57b0531 100644 --- a/app/views/admin/donations/show.html.erb +++ b/app/views/admin/donations/show.html.erb @@ -1,35 +1,34 @@ <%= render HeaderComponent.new(title: "Donations") %> <%= render MainSimpleComponent.new do %> -

- User: - <%= @donation.user.address %> -

- -

- Amount sats: - <%= @donation.amount_sats %> -

- -

- Amount eur: - <%= @donation.amount_eur %> -

- -

- Amount usd: - <%= @donation.amount_usd %> -

- -

- Public name: - <%= @donation.public_name %> -

- -

- Date: - <%= @donation.paid_at %> -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
User<%= link_to @donation.user.address, admin_user_path(@donation.user.address), class: 'ks-text-link' %>
Amount sats<%= @donation.amount_sats %>
Amount EUR<%= @donation.amount_eur %>
Amount USD<%= @donation.amount_usd %>
Public name<%= @donation.public_name %>
Date<%= @donation.paid_at.strftime("%Y-%m-%d (%H:%M UTC)") %>

<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> | diff --git a/app/views/admin/lightning/index.html.erb b/app/views/admin/lightning/index.html.erb index 04c4507..8cb0757 100644 --- a/app/views/admin/lightning/index.html.erb +++ b/app/views/admin/lightning/index.html.erb @@ -36,7 +36,7 @@ <% if user = @users.find{ |u| u[2] == account.login } %> - <%= "#{user[0]}@#{user[1]}" %> + <%= link_to "#{user[0]}@#{user[1]}", admin_user_path("#{user[0]}@#{user[1]}"), class: "ks-text-link" %> <% end %> <%= number_with_delimiter account.balance.to_i.to_s %>