mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Refactor roles
This commit is contained in:
parent
b527221baf
commit
b0eb6798b0
16 changed files with 155 additions and 223 deletions
|
@ -26,8 +26,8 @@
|
|||
= f.label :email
|
||||
= f.text_field(:email, class: 'form-control')
|
||||
.form-group
|
||||
= f.label :role_id
|
||||
= f.select(:role_id, Role.all.map {|x| [t(x.code), x.id] }, {}, { class: 'form-control selectize' })
|
||||
= f.label :role
|
||||
= select_tag 'user[roles][]', options_for_select(User::ROLES.map {|x| [t(x), x] }, @user.roles.try(:first)), class: 'form-control selectize'
|
||||
|
||||
%hr
|
||||
.row
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
%td= link_to(x, [:admin, x])
|
||||
%td= x.email
|
||||
%td= x.identity_code
|
||||
- if x.role
|
||||
%td= t(x.role)
|
||||
- if x.roles
|
||||
%td= t(x.roles.first)
|
||||
- else
|
||||
%td
|
||||
.row
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
%dd= @user.email
|
||||
|
||||
%dt= t('role')
|
||||
- if @user.role
|
||||
%dd= t(@user.role)
|
||||
- if @user.roles
|
||||
%dd= t(@user.roles.first)
|
||||
- else
|
||||
%dd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue