From 2630ec2af43d78a56063ac396e47b2ceeeb090da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sun, 23 Jun 2024 17:24:48 +0200 Subject: [PATCH 1/2] Fix admin user links refs #166 --- app/views/admin/invitations/index.html.erb | 4 ++-- app/views/admin/lightning/index.html.erb | 2 +- app/views/admin/users/show.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/invitations/index.html.erb b/app/views/admin/invitations/index.html.erb index 19e51be..7c2cd43 100644 --- a/app/views/admin/invitations/index.html.erb +++ b/app/views/admin/invitations/index.html.erb @@ -38,8 +38,8 @@ <%= invitation.token %> <%= invitation.used_at.strftime("%Y-%m-%d (%H:%M UTC)") %> - <%= link_to invitation.user.address, admin_user_path(invitation.user.address), class: "ks-text-link" %> - <%= link_to invitation.invitee.address, admin_user_path(invitation.invitee.address), class: "ks-text-link" %> + <%= link_to invitation.user.cn, admin_user_path(invitation.user.cn), class: "ks-text-link" %> + <%= link_to invitation.invitee.cn, admin_user_path(invitation.invitee.cn), class: "ks-text-link" %> <% end %> diff --git a/app/views/admin/lightning/index.html.erb b/app/views/admin/lightning/index.html.erb index 8cb0757..9240148 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 } %> - <%= link_to "#{user[0]}@#{user[1]}", admin_user_path("#{user[0]}@#{user[1]}"), class: "ks-text-link" %> + <%= link_to user[0], admin_user_path(user[0]), class: "ks-text-link" %> <% end %> <%= number_with_delimiter account.balance.to_i.to_s %> diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index bb27846..a901c76 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -36,7 +36,7 @@ Invited by <% if @user.inviter %> - <%= link_to @user.inviter.address, admin_user_path(@user.inviter.address), class: 'ks-text-link' %> + <%= link_to @user.inviter.cn, admin_user_path(@user.inviter.cn), class: 'ks-text-link' %> <% else %>—<% end %> From 6d2bc729b807736ef307a92574b6d4523763a839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sun, 23 Jun 2024 17:26:33 +0200 Subject: [PATCH 2/2] Add new services to admin user page --- app/views/admin/users/show.html.erb | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index a901c76..899f978 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -124,6 +124,19 @@ <% end %> + <% if Setting.email_enabled %> + + E-Mail + + <%= render FormElements::ToggleComponent.new( + enabled: Flipper.enabled?(:email, current_user), + input_enabled: false + ) %> + + + + + <% end %> <% if Setting.gitea_enabled %> Gitea @@ -182,6 +195,33 @@ <% end %> + <% if Setting.nostr_enabled %> + + Nostr + + <%= render FormElements::ToggleComponent.new( + enabled: @user.nostr_pubkey.present?, + input_enabled: false + ) %> + + + <%= link_to "Open profile", "https://njump.me/#{@user.nostr_pubkey}", class: "btn-sm btn-gray" %> + + + <% end %> + <% if Setting.remotestorage_enabled %> + + remoteStorage + + <%= render FormElements::ToggleComponent.new( + enabled: Flipper.enabled?(:remotestorage, current_user) && @services_enabled.include?("remotestorage"), + input_enabled: false + ) %> + + + + + <% end %>