mirror of
https://github.com/internetee/registry.git
synced 2025-06-01 02:14:10 +02:00
Fix contact form on domain
This commit is contained in:
parent
58f54c17e4
commit
b64723d684
2 changed files with 15 additions and 12 deletions
|
@ -33,13 +33,4 @@
|
||||||
$('#tabs a:first').tab('show')
|
$('#tabs a:first').tab('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#domain_contacts").nestedAttributes({
|
|
||||||
bindAddTo: $(".add-domain-contact"),
|
|
||||||
afterAdd: function(item) {
|
|
||||||
item.find('.errors').html('');
|
|
||||||
item.find('.js-contact-id').val('')
|
|
||||||
Autocomplete.bindClientContactSearch();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Autocomplete.bindClientContactSearch();
|
Autocomplete.bindClientContactSearch();
|
||||||
|
|
|
@ -12,11 +12,23 @@
|
||||||
- if contact_fields.object.errors.any?
|
- if contact_fields.object.errors.any?
|
||||||
%hr
|
%hr
|
||||||
.form-group
|
.form-group
|
||||||
= contact_fields.label :contact_type, t('shared.contact'), class: 'col-md-2 control-label'
|
= contact_fields.label :contact_type, class: 'col-md-2 control-label'
|
||||||
.col-md-5
|
.col-md-10
|
||||||
= contact_fields.select :contact_type, options_for_select(DomainContact::TYPES, contact_fields.object.contact_type), {}, {class: 'form-control'}
|
= contact_fields.select :contact_type, options_for_select(DomainContact::TYPES, contact_fields.object.contact_type), {}, {class: 'form-control'}
|
||||||
.col-md-5.has-feedback.js-typeahead-container
|
|
||||||
|
.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')
|
= 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-ok.form-control-feedback.js-typeahead-ok.hidden
|
||||||
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
||||||
= contact_fields.hidden_field(:contact_id, class: 'js-contact-id')
|
= 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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue