Skip to content

Commit 46ef656

Browse files
authored
feature: Allows directors to change user's names (#530)
1 parent efc2a73 commit 46ef656

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

app/views/manage/users/_form.html.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
= f.error_notification
77

88
.form-inputs
9+
= f.input :first_name, required: true
10+
= f.input :last_name, required: true
911
= f.input :email, input_html: { "data-validate" => "presence" }, required: true
1012
= f.input :role, collection: User.roles.to_a.collect{|c| [c[0].titleize, c[0]]}, include_blank: false
1113
= f.input :is_active, collection: [[t(:active, scope: "pages.manage.users.edit.form"), true], [t(:inactive, scope: "pages.manage.users.edit.form"), false]], as: :radio_buttons

app/views/manage/users/edit.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.edit", user_email: @user.email), subtitle: @user.email do
1+
= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.edit", user_name: @user.full_name), subtitle: @user.full_name do
22
.btn-group
33
= link_to t(:cancel, scope: "pages.manage.users.edit"), manage_user_path(@user), class: 'btn btn-sm btn-outline-secondary'
44
= 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'

app/views/manage/users/show.html.haml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.show", user_email: @user.email) do
1+
= render "layouts/manage/page_title", title: t(:title, scope: "pages.manage.users.show", user_name: @user.full_name) do
22
.btn-group
33
= link_to t(:edit, scope: "pages.manage.users.show"), edit_manage_user_path(@user), class: 'btn btn-sm btn-outline-secondary'
44
= 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 @@
88
.card.mb-3
99
.card-header= t(:user_information, scope: "pages.manage.users.show")
1010
.card-body
11+
.row
12+
%dt.col-md-5= t(:first_name, scope: "pages.manage.users.show")
13+
%dd.col-md-7= @user.first_name
14+
.row
15+
%dt.col-md-5= t(:last_name, scope: "pages.manage.users.show")
16+
%dd.col-md-7= @user.last_name
1117
.row
1218
%dt.col-md-5= t(:email_address, scope: "pages.manage.users.show")
1319
%dd.col-md-7= @user.email

config/locales/en.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ en:
156156
previous_signed_in_ip: Previous signed-in IP
157157
sign_in_count: Sign-in count
158158
show:
159-
title: "%{user_email}"
159+
title: "%{user_name}"
160160
edit: Edit
161161
reset_password: Reset Password
162162
delete: Delete
163163
user_information: User Information
164+
first_name: First name
165+
last_name: Last name
164166
email_address: Email address
165167
role: Role
166168
login_access: Login access
@@ -179,7 +181,7 @@ en:
179181
change_history: Change History
180182
edit:
181183
title: Edit User
182-
subtitle: "%{user_email}"
184+
subtitle: "%{user_name}"
183185
cancel: Cancel
184186
delete: Delete
185187
form:

0 commit comments

Comments
 (0)