From 55abbcc5ad904aab5aa429e9a5a139a3aaf355b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 23 Feb 2023 23:55:32 +0800 Subject: [PATCH] WIP user page --- app/assets/stylesheets/components/tables.css | 6 +++++- app/controllers/admin/users_controller.rb | 1 + app/views/admin/users/show.html.erb | 21 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/components/tables.css b/app/assets/stylesheets/components/tables.css index 9b5e1fc..1a385b2 100644 --- a/app/assets/stylesheets/components/tables.css +++ b/app/assets/stylesheets/components/tables.css @@ -7,10 +7,14 @@ @apply text-left; } - table th { + table thead th { @apply pb-3.5 text-sm font-normal uppercase text-gray-500; } + table tbody th { + @apply text-left font-normal text-gray-500; + } + table th:not(:last-of-type), table td:not(:last-of-type) { @apply pr-2; diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 65ee39d..fbe0252 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -14,6 +14,7 @@ class Admin::UsersController < Admin::BaseController end def show + @inviter = Invitation.where(invited_user_id: @user.id).first.try(:user) end private diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index 021c5c6..8fbf1c1 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -2,5 +2,26 @@ <%= render MainSimpleComponent.new do %>
+

Account

+ + + + + + + + + + + + + + + + + + + +
Created at<%= @user.created_at.strftime("%Y-%m-%d (%H:%M UTC)") %>
Confirmed at<%= @user.confirmed_at.strftime("%Y-%m-%d (%H:%M UTC)") %>
Email<%= @user.email %>
Invited by<%= @inviter ? link_to(@inviter.address, admin_user_path(@inviter.address), class: 'ks-text-link') : "—" %>
<% end %>