Link users everywhere in admin panel

This commit is contained in:
Râu Cao 2023-02-25 15:32:13 +08:00
parent 8eb487600c
commit 1a55e5e895
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
3 changed files with 30 additions and 32 deletions

View File

@ -33,11 +33,10 @@
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @donations.each do |donation| %> <% @donations.each do |donation| %>
<tr> <tr>
<td><%= donation.user.address %></td> <td><%= link_to donation.user.address, admin_user_path(donation.user.address), class: 'ks-text-link' %></td>
<td class="text-right"><%= sats_to_btc donation.amount_sats %></td> <td class="text-right"><%= sats_to_btc donation.amount_sats %></td>
<td class="text-right"><% if donation.amount_eur.present? %><%= number_to_currency donation.amount_eur / 100, unit: "" %><% end %></td> <td class="text-right"><% if donation.amount_eur.present? %><%= number_to_currency donation.amount_eur / 100, unit: "" %><% end %></td>
<td class="text-right"><% if donation.amount_usd.present? %><%= number_to_currency donation.amount_usd / 100, unit: "" %><% end %></td> <td class="text-right"><% if donation.amount_usd.present? %><%= number_to_currency donation.amount_usd / 100, unit: "" %><% end %></td>

View File

@ -1,35 +1,34 @@
<%= render HeaderComponent.new(title: "Donations") %> <%= render HeaderComponent.new(title: "Donations") %>
<%= render MainSimpleComponent.new do %> <%= render MainSimpleComponent.new do %>
<p> <table class="w-1/2">
<strong>User:</strong> <tbody>
<%= @donation.user.address %> <tr>
</p> <th>User</th>
<td><%= link_to @donation.user.address, admin_user_path(@donation.user.address), class: 'ks-text-link' %></td>
<p> </tr>
<strong>Amount sats:</strong> <tr>
<%= @donation.amount_sats %> <th>Amount sats</th>
</p> <td><%= @donation.amount_sats %></td>
</tr>
<p> <tr>
<strong>Amount eur:</strong> <th>Amount EUR</th>
<%= @donation.amount_eur %> <td><%= @donation.amount_eur %></td>
</p> </tr>
<tr>
<p> <th>Amount USD</th>
<strong>Amount usd:</strong> <td><%= @donation.amount_usd %></td>
<%= @donation.amount_usd %> </tr>
</p> <tr>
<th>Public name</th>
<p> <td><%= @donation.public_name %></td>
<strong>Public name:</strong> </tr>
<%= @donation.public_name %> <tr>
</p> <th>Date</th>
<td><%= @donation.paid_at.strftime("%Y-%m-%d (%H:%M UTC)") %></td>
<p> </tr>
<strong>Date:</strong> </tbody>
<%= @donation.paid_at %> </table>
</p>
<p class="mt-8"> <p class="mt-8">
<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> | <%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> |

View File

@ -36,7 +36,7 @@
</td> </td>
<td> <td>
<% if user = @users.find{ |u| u[2] == account.login } %> <% 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 %> <% end %>
</td> </td>
<td><%= number_with_delimiter account.balance.to_i.to_s %></td> <td><%= number_with_delimiter account.balance.to_i.to_s %></td>