From dcdd0acf1475f85d28a8a2fa87c8134a2ffc61e1 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Mon, 21 Dec 2020 23:21:36 -0500 Subject: [PATCH] refactor(Users): Shows user's name on show/edit pages --- app/views/manage/users/edit.html.haml | 2 +- app/views/manage/users/show.html.haml | 8 +++++++- config/locales/en.yml | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/views/manage/users/edit.html.haml b/app/views/manage/users/edit.html.haml index f2f911fa0..124e1641c 100644 --- a/app/views/manage/users/edit.html.haml +++ b/app/views/manage/users/edit.html.haml @@ -1,4 +1,4 @@ -= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.edit", user_email: @user.email), subtitle: @user.email do += render "layouts/manage/page_title", title: @user.full_name, subtitle: t(:subtitle, scope: 'pages.manage.users.edit') do .btn-group = link_to t(:cancel, scope: "pages.manage.users.edit"), manage_user_path(@user), class: 'btn btn-sm btn-outline-secondary' = link_to t(:delete, scope: "pages.manage.users.edit"), manage_user_path(@user), method: :delete, data: { confirm: "Are you sure? #{@user.email} will be permanently deleted. This action is irreversible." }, class: 'btn btn-sm btn-outline-secondary' diff --git a/app/views/manage/users/show.html.haml b/app/views/manage/users/show.html.haml index 7b3387e32..30518627f 100644 --- a/app/views/manage/users/show.html.haml +++ b/app/views/manage/users/show.html.haml @@ -1,4 +1,4 @@ -= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.show", user_email: @user.email) do += render "layouts/manage/page_title", title: @user.full_name, subtitle: t(:subtitle, scope: 'pages.manage.users.show') do .btn-group = link_to t(:edit, scope: "pages.manage.users.show"), edit_manage_user_path(@user), class: 'btn btn-sm btn-outline-secondary' = link_to t(:delete, scope: "pages.manage.users.show"), manage_user_path(@user), method: :delete, data: { confirm: "Are you sure? #{@user.email} along with their questionnaire will be permanently deleted. This action is irreversible." }, class: 'btn btn-sm btn-outline-secondary' @@ -8,6 +8,12 @@ .card.mb-3 .card-header= t(:user_information, scope: "pages.manage.users.show") .card-body + .row + %dt.col-md-5= t(:first_name, scope: "pages.manage.users.show") + %dd.col-md-7= @user.first_name + .row + %dt.col-md-5= t(:last_name, scope: "pages.manage.users.show") + %dd.col-md-7= @user.last_name .row %dt.col-md-5= t(:email_address, scope: "pages.manage.users.show") %dd.col-md-7= @user.email diff --git a/config/locales/en.yml b/config/locales/en.yml index e942e663f..5b5e26194 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -154,11 +154,13 @@ en: previous_signed_in_ip: Previous signed-in IP sign_in_count: Sign-in count show: - title: "%{user_email}" + subtitle: "User" edit: Edit reset_password: Reset Password delete: Delete user_information: User Information + first_name: First name + last_name: Last name email_address: Email address role: Role login_access: Login access @@ -176,8 +178,7 @@ en: sign_in_count: Sign-in count change_history: Change History edit: - title: Edit User - subtitle: "%{user_email}" + subtitle: Edit User cancel: Cancel delete: Delete form: