mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
29 lines
1.2 KiB
Text
29 lines
1.2 KiB
Text
#domain-statuses
|
|
= f.fields_for :domain_statuses, @client_statuses do |status_fields|
|
|
.panel.panel-default
|
|
.panel-heading.clearfix
|
|
.pull-left= t('shared.status')
|
|
.pull-right
|
|
= link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-status')
|
|
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
|
.panel-body
|
|
.errors
|
|
= render 'shared/errors', object: status_fields.object
|
|
- if status_fields.object.errors.any?
|
|
%hr
|
|
.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_client, status_fields.object.value.try(:sub, 'client', '')), {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({
|
|
bindAddTo: $(".add-domain-status"),
|
|
afterAdd: function(item) {
|
|
item.find('.errors').html('');
|
|
}
|
|
});
|