mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +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
|
||||
|
||||
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 :switch, :registrar
|
||||
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
|
||||
- unless @domain.parent_valid?
|
||||
%hr
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#domain_statuses
|
||||
#domain-statuses
|
||||
= f.fields_for :domain_statuses, @server_statuses do |status_fields|
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
|
@ -11,17 +11,16 @@
|
|||
= render 'shared/errors', object: status_fields.object
|
||||
- if status_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= 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'}
|
||||
.col-md-6
|
||||
.form-group
|
||||
= status_fields.label :description
|
||||
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
|
||||
.form-group
|
||||
= status_fields.label :value, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= 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
|
||||
= status_fields.label :description, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
|
||||
:javascript
|
||||
$("#domain_statuses").nestedAttributes({
|
||||
$("#domain-statuses").nestedAttributes({
|
||||
bindAddTo: $(".add-domain-status"),
|
||||
afterAdd: function(item) {
|
||||
item.find('.errors').html('');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue