mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 20:49:36 +02:00
Ability fix in client + admin domain status form horizontal
This commit is contained in:
parent
5e09e5e8b4
commit
37baa96b67
3 changed files with 12 additions and 13 deletions
|
@ -6,7 +6,7 @@ class Ability
|
||||||
alias_action :create, :read, :update, :destroy, :to => :crud
|
alias_action :create, :read, :update, :destroy, :to => :crud
|
||||||
|
|
||||||
user ||= User.new
|
user ||= User.new
|
||||||
if REGISTRY_ENV == :admin && user.admin?
|
if Rails.env.development? || Rails.env.test? || (REGISTRY_ENV == :admin && user.admin?)
|
||||||
can :manage, Domain
|
can :manage, Domain
|
||||||
can :switch, :registrar
|
can :switch, :registrar
|
||||||
can :crud, DomainTransfer
|
can :crud, DomainTransfer
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
= form_for([:admin, @domain]) do |f|
|
= form_for([:admin, @domain], html: { class: 'form-horizontal' }) do |f|
|
||||||
= render 'shared/errors', object: @domain
|
= render 'shared/errors', object: @domain
|
||||||
- unless @domain.parent_valid?
|
- unless @domain.parent_valid?
|
||||||
%hr
|
%hr
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#domain_statuses
|
#domain-statuses
|
||||||
= f.fields_for :domain_statuses, @server_statuses do |status_fields|
|
= f.fields_for :domain_statuses, @server_statuses do |status_fields|
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
.panel-heading.clearfix
|
.panel-heading.clearfix
|
||||||
|
@ -11,17 +11,16 @@
|
||||||
= render 'shared/errors', object: status_fields.object
|
= render 'shared/errors', object: status_fields.object
|
||||||
- if status_fields.object.errors.any?
|
- if status_fields.object.errors.any?
|
||||||
%hr
|
%hr
|
||||||
.row
|
.form-group
|
||||||
.col-md-6
|
= status_fields.label :value, class: 'col-md-2 control-label'
|
||||||
.form-group
|
.col-md-10
|
||||||
= status_fields.label :value
|
= status_fields.select :value, options_for_select(DomainStatus.statuses_for_admin, status_fields.object.value.try(:sub, 'server', '')), {include_blank: true}, {class: 'form-control'}
|
||||||
= status_fields.select :value, options_for_select(DomainStatus.statuses_for_admin, status_fields.object.value.try(:sub, 'server', '')), {include_blank: true}, {class: 'form-control'}
|
.form-group
|
||||||
.col-md-6
|
= status_fields.label :description, class: 'col-md-2 control-label'
|
||||||
.form-group
|
.col-md-10
|
||||||
= status_fields.label :description
|
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
|
||||||
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
|
|
||||||
:javascript
|
:javascript
|
||||||
$("#domain_statuses").nestedAttributes({
|
$("#domain-statuses").nestedAttributes({
|
||||||
bindAddTo: $(".add-domain-status"),
|
bindAddTo: $(".add-domain-status"),
|
||||||
afterAdd: function(item) {
|
afterAdd: function(item) {
|
||||||
item.find('.errors').html('');
|
item.find('.errors').html('');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue