Nest API users under registrar in admin area

This commit is contained in:
Artur Beljajev 2019-12-09 21:34:36 +02:00
parent c680b688e4
commit de6934625c
10 changed files with 65 additions and 62 deletions

View file

@ -1,4 +1,4 @@
= form_for([:admin, @registrar, @api_user], html: {class: 'form-horizontal', autocomplete: 'off'}) do |f|
= form_for([:admin, @api_user.registrar, @api_user], html: {class: 'form-horizontal', autocomplete: 'off'}) do |f|
= render 'shared/full_errors', object: @api_user
.row

View file

@ -1,5 +1,5 @@
- content_for :actions do
= link_to(t(:back_to_api_user), [:admin, @api_user], class: 'btn btn-default')
= link_to(t(:back_to_api_user), admin_registrar_api_user_path(@api_user.registrar, @api_user), class: 'btn btn-default')
= render 'shared/title', name: "#{t(:edit)}: #{@api_user.username}"
= render 'form'

View file

@ -15,7 +15,7 @@
%tbody
- @api_users.each do |api_user|
%tr
%td= link_to api_user, [:admin, api_user]
%td= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user)
%td= link_to api_user.registrar, [:admin, api_user.registrar]
%td= api_user.active
.row

View file

@ -1,6 +1,6 @@
- content_for :actions do
= link_to(t(:edit), edit_admin_api_user_path(@api_user), class: 'btn btn-default')
= link_to(t(:delete), admin_api_user_path(@api_user),
= link_to(t(:edit), edit_admin_registrar_api_user_path(@api_user.registrar, @api_user), class: 'btn btn-default')
= link_to(t(:delete), admin_registrar_api_user_path(@api_user.registrar, @api_user),
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
= render 'shared/title', name: @api_user.username