From d6238d9da2606beebad63bb23b49fcdbb072fbb6 Mon Sep 17 00:00:00 2001 From: Ed Woodward Date: Thu, 12 Mar 2020 15:00:57 -0500 Subject: [PATCH] Added field with dropdown for user roles --- app/controllers/admin/users_controller.rb | 1 + app/views/admin/users/_form.html.erb | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index ae216a65c..2f55cbaff 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -118,6 +118,7 @@ def change_salesforce_contact def update_user @user.is_administrator = params[:user][:is_administrator] @user.is_test = params[:user][:is_test] + @user.role = params[:user][:role] if params[:user][:role] @user.faculty_status = params[:user][:faculty_status] if params[:user][:faculty_status] @user.school_type = params[:user][:school_type] if params[:user][:school_type] if @user.external_uuids.any? && params[:user][:keep_external_uuids] == '0' diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb index d4b33bb64..8100dc18d 100644 --- a/app/views/admin/users/_form.html.erb +++ b/app/views/admin/users/_form.html.erb @@ -61,6 +61,14 @@ +
+ <%= f.label :role, class: "col-sm-2 control-label" %> +
+ <% roles = User.roles.keys.sort.map{ |key| [key.humanize, key] } %> + <%= f.select :role, roles, {:selected => @user.role}, {class: "form-control"} %> +
+
+
<%= f.label :faculty_status, class: "col-sm-2 control-label" %>
@@ -237,5 +245,4 @@
- <% end %>