From bd110bac00cf4ddeb28aa7c057d84813f410f17b Mon Sep 17 00:00:00 2001 From: chenjing <28122123@qq.com> Date: Thu, 16 Mar 2023 16:48:00 +0800 Subject: [PATCH] remove identity for admins user --- app/controllers/admins/users_controller.rb | 6 ++--- app/views/admins/users/edit.html.erb | 22 ------------------- app/views/admins/users/index.html.erb | 6 +---- .../admins/users/shared/_user_list.html.erb | 1 - 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/app/controllers/admins/users_controller.rb b/app/controllers/admins/users_controller.rb index 07ea8261e..8ff5908c6 100644 --- a/app/controllers/admins/users_controller.rb +++ b/app/controllers/admins/users_controller.rb @@ -64,8 +64,8 @@ class Admins::UsersController < Admins::BaseController end def update_params - params.require(:user).permit(%i[lastname nickname gender identity technical_title student_id is_shixun_marker - mail phone location location_city school_id department_id admin business is_test - password professional_certification authentication login]) + params.require(:user).permit(%i[lastname nickname gender technical_title is_shixun_marker + mail phone location location_city school_id department_id admin + password login]) end end diff --git a/app/views/admins/users/edit.html.erb b/app/views/admins/users/edit.html.erb index 3b4801772..b407cbbe7 100644 --- a/app/views/admins/users/edit.html.erb +++ b/app/views/admins/users/edit.html.erb @@ -63,19 +63,6 @@ <%= f.input :gender, as: :radio_buttons, label: '性别', collection: [%w(男 0), %w(女 1)], wrapper_html: { class: 'col-md-3' } %> -
-
- <%= f.label :identity, label: '职业' %> - <%= select_tag('user[identity]', [], class: 'form-control identity-select optional', 'data-value': @user.user_extension&.identity, 'data-first-title': '请选择') %> -
-
- <%= f.label :technical_title, label: '职称' %> - <%= select_tag('user[technical_title]', [], class: 'form-control technical-title-select optional', 'data-value': @user.technical_title) %> -
- - <%= f.input :student_id, as: :tel, label: '学号', wrapper_html: { class: 'col-md-2', style: @user&.user_extension&.student? ? '' : 'display:none;' }, input_html: { class: 'student-id-input' } %> -
-
<%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> <%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'off' } %> @@ -102,19 +89,10 @@ <%= f.label :role, label: '角色' %>
<%= f.input :admin, as: :boolean, label: '管理员', checked_value: 1, unchecked_value: 0 %> - <%= f.input :business, as: :boolean, label: '运营人员', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> - <%= f.input :is_test, as: :boolean, label: '测试账号', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %>
<% end %> -
- <%= f.label :role, label: '认证信息' %> -
- <%= f.input :professional_certification, as: :boolean, label: '职业认证', checked_value: 1, unchecked_value: 0 %> - <%= f.input :authentication, as: :boolean, label: '实名认证', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> -
-
<%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %> diff --git a/app/views/admins/users/index.html.erb b/app/views/admins/users/index.html.erb index 4ba38c39a..3c355242e 100644 --- a/app/views/admins/users/index.html.erb +++ b/app/views/admins/users/index.html.erb @@ -10,11 +10,7 @@ <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
-
- - <% identity_options = [['全部', ''], ['教师', 0], ['学生', 1], ['专业人士', 2]] %> - <%= select_tag(:identity, options_for_select(identity_options), class: 'form-control') %> -
+
<% open_user_type_options = [['所有用户', ''], ['头歌同步', "OpenUsers::Educoder"], ['平台注册', "Forge"],] %> diff --git a/app/views/admins/users/shared/_user_list.html.erb b/app/views/admins/users/shared/_user_list.html.erb index 716e7cc54..67571178a 100644 --- a/app/views/admins/users/shared/_user_list.html.erb +++ b/app/views/admins/users/shared/_user_list.html.erb @@ -24,7 +24,6 @@ <%= overflow_hidden_span display_text(user.mail), width: 150 %> <%= overflow_hidden_span display_text(user.phone), width: 100 %> - <%= user.identity %> <%= display_text(user.created_on&.strftime('%Y-%m-%d %H:%M')) %> <%= display_text(user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %> <%= link_to user.projects_count, "/#{user.login}/projects", target: "_blank" %>