admins: fix user list page

dev_cs
p31729568 5 years ago
parent 4cb8898f46
commit 64d888bab1

@ -1,6 +1,6 @@
class UserExtension < ApplicationRecord
# identity 0: 教师教授 1: 学生, 2: 专业人士, 3: 开发者
enum identity: { teacher: 0, student: 1, professional: 2, developer: 3, cnmooc: 4, unselect: -1 }
enum identity: { teacher: 0, student: 1, professional: 2, developer: 3, enterprise: 4, unselect: -1 }
belongs_to :user, touch: true
belongs_to :school, optional: true

@ -12,7 +12,7 @@
<div class="form-group mr-2">
<label for="identity">职业:</label>
<% identity_options = [['全部', '']] + UserExtension.identities.map { |k, v| [I18n.t("user.identity.#{k}"), v] } %>
<% identity_options = [['全部', ''], ['教师', 0], ['学生', 1], ['专业人士', 2]] %>
<%= select_tag(:identity, options_for_select(identity_options), class: 'form-control') %>
</div>

@ -13,7 +13,9 @@
professional: 专业人士
developer: 从业者
enterprise: 组织
unselect: 未选择
"0": 教师
"1": 学生
"2": 专业人士
"3": 专业人士
"3": 从业者
"4": 组织
Loading…
Cancel
Save