mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Refactor admin interface under namespace
This commit is contained in:
parent
0c3105a159
commit
a3b04786cf
7 changed files with 18 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
||||||
class SettingGroupsController < ApplicationController
|
class Admin::SettingGroupsController < ApplicationController
|
||||||
before_action :set_setting_group, only: [:show, :update]
|
before_action :set_setting_group, only: [:show, :update]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -9,7 +9,7 @@ class SettingGroupsController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @setting_group.update(setting_group_params)
|
if @setting_group.update(setting_group_params)
|
||||||
redirect_to @setting_group
|
redirect_to [:admin, @setting_group]
|
||||||
else
|
else
|
||||||
render 'show'
|
render 'show'
|
||||||
end
|
end
|
|
@ -247,7 +247,7 @@ class Domain < ActiveRecord::Base
|
||||||
def approve_pending_transfer(current_user)
|
def approve_pending_transfer(current_user)
|
||||||
pt = pending_transfer
|
pt = pending_transfer
|
||||||
if current_user.registrar != pt.transfer_from
|
if current_user.registrar != pt.transfer_from
|
||||||
add_epp_error('2304', nil, nil, I18n.t('transfer_can_be_approved_only_by_current_registrar'))
|
add_epp_error('2304', nil, nil, I18n.t('shared.transfer_can_be_approved_only_by_current_registrar'))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
%table.table.table-striped.table-bordered
|
%table.table.table-striped.table-bordered
|
||||||
%tr
|
%tr
|
||||||
%th{class: 'col-xs-9'}
|
%th{class: 'col-xs-9'}
|
||||||
= t('.setting_group')
|
= t('shared.setting_group')
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.action')
|
= t('shared.action')
|
||||||
- @setting_groups.each do |x|
|
- @setting_groups.each do |x|
|
||||||
%tr
|
%tr
|
||||||
%td= t("setting_groups.codes.#{x.code}")
|
%td= t("setting_groups.codes.#{x.code}")
|
||||||
%td= link_to(t('.edit_settings'), setting_group_path(x), class: 'btn btn-primary btn-xs')
|
%td= link_to(t('shared.edit_settings'), admin_setting_group_path(x), class: 'btn btn-primary btn-xs')
|
|
@ -1,14 +1,14 @@
|
||||||
%h2= t("setting_groups.codes.#{@setting_group.code}")
|
%h2= t("setting_groups.codes.#{@setting_group.code}")
|
||||||
%hr
|
%hr
|
||||||
= form_for(@setting_group) do |f|
|
= form_for([:admin, @setting_group]) do |f|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%table.table.table-striped.table-bordered
|
%table.table.table-striped.table-bordered
|
||||||
%tr
|
%tr
|
||||||
%th{class: 'col-xs-9'}
|
%th{class: 'col-xs-9'}
|
||||||
= t('.setting')
|
= t('setting')
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.value')
|
= t('value')
|
||||||
- @setting_group.settings.each do |setting|
|
- @setting_group.settings.each do |setting|
|
||||||
= f.fields_for :settings, setting do |sf|
|
= f.fields_for :settings, setting do |sf|
|
||||||
%tr
|
%tr
|
|
@ -36,7 +36,7 @@
|
||||||
%ul.dropdown-menu{role: "menu"}
|
%ul.dropdown-menu{role: "menu"}
|
||||||
%li.dropdown-header= t('shared.system')
|
%li.dropdown-header= t('shared.system')
|
||||||
%li
|
%li
|
||||||
= link_to t('shared.setting_groups'), setting_groups_path
|
= link_to t('shared.setting_groups'), admin_setting_groups_path
|
||||||
%li
|
%li
|
||||||
= link_to t('shared.users'), '#'
|
= link_to t('shared.users'), '#'
|
||||||
%li
|
%li
|
||||||
|
|
|
@ -106,12 +106,7 @@ en:
|
||||||
setting_groups:
|
setting_groups:
|
||||||
codes:
|
codes:
|
||||||
domain_validation: 'Domain validation'
|
domain_validation: 'Domain validation'
|
||||||
|
domain_general: 'Domain general'
|
||||||
index:
|
|
||||||
setting_group: 'Setting group'
|
|
||||||
edit_settings: 'Edit settings'
|
|
||||||
show:
|
|
||||||
setting: 'Setting'
|
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
codes:
|
codes:
|
||||||
|
@ -133,4 +128,7 @@ en:
|
||||||
epp_users: 'EPP Users'
|
epp_users: 'EPP Users'
|
||||||
registrars: 'Registrars'
|
registrars: 'Registrars'
|
||||||
|
|
||||||
transfer_can_be_approved_only_by_current_registrar: 'Transfer can be approved only by current domain registrar'
|
transfer_can_be_approved_only_by_current_registrar: 'Transfer can be approved only by current domain registrar'
|
||||||
|
edit_settings: 'Edit settings'
|
||||||
|
setting_group: 'Setting group'
|
||||||
|
setting: 'Setting'
|
||||||
|
|
|
@ -5,13 +5,15 @@ Rails.application.routes.draw do
|
||||||
get 'error/:command', to: 'errors#error', defaults: { format: :xml }
|
get 'error/:command', to: 'errors#error', defaults: { format: :xml }
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :setting_groups
|
namespace(:admin) do
|
||||||
|
resources :setting_groups
|
||||||
|
end
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
# See how all your routes lay out with "rake routes".
|
# See how all your routes lay out with "rake routes".
|
||||||
|
|
||||||
# You can have the root of your site routed with "root"
|
# You can have the root of your site routed with "root"
|
||||||
root 'setting_groups#index'
|
root 'admin/setting_groups#index'
|
||||||
|
|
||||||
# Example of regular route:
|
# Example of regular route:
|
||||||
# get 'products/:id' => 'catalog#view'
|
# get 'products/:id' => 'catalog#view'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue