mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Refactor user to admin and api user
This commit is contained in:
parent
f3215680d5
commit
037cb57e00
34 changed files with 551 additions and 551 deletions
|
@ -1,9 +1,9 @@
|
|||
= form_for([:admin, @user]) do |f|
|
||||
- if @user.errors.any?
|
||||
- @user.errors.each do |attr, err|
|
||||
= form_for([:admin, @admin_user]) do |f|
|
||||
- if @admin_user.errors.any?
|
||||
- @admin_user.errors.each do |attr, err|
|
||||
= err
|
||||
%br
|
||||
- if @user.errors.any?
|
||||
- if @admin_user.errors.any?
|
||||
%hr
|
||||
|
||||
.row
|
||||
|
@ -27,7 +27,7 @@
|
|||
= f.text_field(:email, class: 'form-control')
|
||||
.form-group
|
||||
= 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'
|
||||
= select_tag 'admin_user[roles][]', options_for_select(AdminUser::ROLES.map {|x| [t(x), x] }, @admin_user.roles.try(:first)), class: 'form-control selectize'
|
||||
|
||||
%hr
|
||||
.row
|
|
@ -4,6 +4,6 @@
|
|||
= "#{t('edit_user')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('back_to_user'), [:admin, @user], class: 'btn btn-default')
|
||||
= link_to(t('back_to_user'), [:admin, @admin_user], class: 'btn btn-default')
|
||||
%hr
|
||||
= render 'form'
|
|
@ -1,9 +1,9 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs= t('users')
|
||||
%h2.text-center-xs= t('admin_users')
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('create_new_user'), new_admin_user_path, class: 'btn btn-primary')
|
||||
= link_to(t('create_new_user'), new_admin_admin_user_path, class: 'btn btn-primary')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
@ -20,7 +20,7 @@
|
|||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'role', t('role'))
|
||||
%tbody
|
||||
- @users.each do |x|
|
||||
- @admin_users.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, [:admin, x])
|
||||
%td= x.email
|
||||
|
@ -31,4 +31,4 @@
|
|||
%td
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @users
|
||||
= paginate @admin_users
|
|
@ -4,15 +4,15 @@
|
|||
= "#{t('user_details')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('edit'), edit_admin_user_path(@user), class: 'btn btn-primary')
|
||||
= link_to(t('delete'), admin_user_path(@user), method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-danger')
|
||||
= link_to(t('edit'), edit_admin_admin_user_path(@admin_user), class: 'btn btn-primary')
|
||||
= link_to(t('delete'), admin_admin_user_path(@admin_user), method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-danger')
|
||||
|
||||
%hr
|
||||
- if @user.errors.any?
|
||||
- @user.errors.each do |attr, err|
|
||||
- if @admin_user.errors.any?
|
||||
- @admin_user.errors.each do |attr, err|
|
||||
= err
|
||||
%br
|
||||
- if @user.errors.any?
|
||||
- if @admin_user.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-6
|
||||
|
@ -22,13 +22,13 @@
|
|||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t('username')
|
||||
%dd= @user.username
|
||||
%dd= @admin_user.username
|
||||
|
||||
%dt= t('password')
|
||||
%dd= @user.password
|
||||
%dd= @admin_user.password
|
||||
|
||||
%dt= t('identity_code')
|
||||
%dd= @user.identity_code
|
||||
%dd= @admin_user.identity_code
|
||||
|
||||
.col-md-6
|
||||
.panel.panel-default
|
||||
|
@ -37,10 +37,10 @@
|
|||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t('email')
|
||||
%dd= @user.email
|
||||
%dd= @admin_user.email
|
||||
|
||||
%dt= t('role')
|
||||
- if @user.roles
|
||||
%dd= t(@user.roles.first)
|
||||
- if @admin_user.roles
|
||||
%dd= t(@admin_user.roles.first)
|
||||
- else
|
||||
%dd
|
|
@ -4,7 +4,7 @@ xml.epp_head do
|
|||
xml.msg 'Command completed successfully'
|
||||
end
|
||||
|
||||
xml.tag!('msgQ', 'count' => current_api_user.queued_messages.count, 'id' => @message.id)
|
||||
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id)
|
||||
|
||||
xml << render('/epp/shared/trID')
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ xml.epp(
|
|||
xml.msg 'Command completed successfully; ack to dequeue'
|
||||
end
|
||||
|
||||
xml.tag!('msgQ', 'count' => current_api_user.queued_messages.count, 'id' => @message.id) do
|
||||
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do
|
||||
xml.qDate @message.created_at
|
||||
xml.msg @message.body
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ xml.epp_head do
|
|||
xml.msg 'Command completed successfully; ack to dequeue'
|
||||
end
|
||||
|
||||
xml.tag!('msgQ', 'count' => current_api_user.queued_messages.count, 'id' => @message.id) do
|
||||
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do
|
||||
xml.qDate @message.created_at
|
||||
xml.msg @message.body
|
||||
end
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
%li.divider
|
||||
%li.dropdown-header= t('users')
|
||||
%li= link_to t(:admin_users), admin_users_path
|
||||
%li= link_to t(:admin_users), admin_admin_users_path
|
||||
%li= link_to t(:api_users), admin_api_users_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue