Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Allows directors to change user's names #530

Merged
merged 2 commits into from
Jan 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/views/manage/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
= f.error_notification

.form-inputs
= f.input :first_name, required: true
= f.input :last_name, required: true
= f.input :email, input_html: { "data-validate" => "presence" }, required: true
= f.input :role, collection: User.roles.to_a.collect{|c| [c[0].titleize, c[0]]}, include_blank: false
= 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
Expand Down
2 changes: 1 addition & 1 deletion app/views/manage/users/edit.html.haml
Original file line number Diff line number Diff line change
@@ -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: t(:title, scope: "pages.manage.users.edit", user_name: @user.full_name), subtitle: @user.full_name 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'
Expand Down
8 changes: 7 additions & 1 deletion app/views/manage/users/show.html.haml
Original file line number Diff line number Diff line change
@@ -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: t(:title, scope: "pages.manage.users.show", user_name: @user.full_name) 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'
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ en:
previous_signed_in_ip: Previous signed-in IP
sign_in_count: Sign-in count
show:
title: "%{user_email}"
title: "%{user_name}"
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
Expand All @@ -179,7 +181,7 @@ en:
change_history: Change History
edit:
title: Edit User
subtitle: "%{user_email}"
subtitle: "%{user_name}"
cancel: Cancel
delete: Delete
form:
Expand Down