internetee-registry/app/views/admin/domains/form_partials/_statuses.haml
2015-01-30 12:07:47 +02:00

26 lines
1.2 KiB
Text

#domain-statuses
= f.fields_for :domain_statuses, @server_statuses do |status_fields|
.panel.panel-default
.panel-heading.clearfix
.pull-left= t('status')
.pull-right
= link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-domain-status')
= link_to(t('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_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'
:coffee
$("#domain-statuses").nestedAttributes
bindAddTo: $(".add-domain-status")
afterAdd: (item) ->
item.find(".errors").html ""