mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
34 lines
1.6 KiB
Text
34 lines
1.6 KiB
Text
#domain-contacts
|
|
= f.fields_for :domain_contacts do |contact_fields|
|
|
.panel.panel-default
|
|
.panel-heading.clearfix
|
|
.pull-left= t('shared.contact')
|
|
.pull-right
|
|
= link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-contact')
|
|
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
|
.panel-body
|
|
.errors
|
|
= render 'shared/errors', object: contact_fields.object
|
|
- if contact_fields.object.errors.any?
|
|
%hr
|
|
.form-group
|
|
= contact_fields.label :contact_type, class: 'col-md-2 control-label'
|
|
.col-md-10
|
|
= contact_fields.select :contact_type, options_for_select(DomainContact::TYPES, contact_fields.object.contact_type), {}, {class: 'form-control'}
|
|
|
|
.form-group
|
|
= contact_fields.label :value_typeahead, t('shared.contact'), class: 'col-md-2 control-label'
|
|
.col-md-10.has-feedback.js-typeahead-container
|
|
= contact_fields.text_field(:value_typeahead, class: 'form-control js-contact-typeahead', placeholder: t('shared.contact_code'), autocomplete: 'off')
|
|
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
|
|
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
|
= contact_fields.hidden_field(:contact_id, class: 'js-contact-id')
|
|
:javascript
|
|
$("#domain-contacts").nestedAttributes({
|
|
bindAddTo: $(".add-domain-contact"),
|
|
afterAdd: function(item) {
|
|
item.find('.errors').html('');
|
|
item.find('.js-contact-id').val('')
|
|
Autocomplete.bindClientContactSearch();
|
|
}
|
|
});
|