mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Updated select2 box
This commit is contained in:
parent
5a9295f2bc
commit
ca0170b0e5
1 changed files with 24 additions and 26 deletions
|
@ -1,29 +1,30 @@
|
|||
#domain-contacts
|
||||
#js-domain-contacts
|
||||
- @domain_params['contacts_attributes'].each do |k, v|
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left= t(:contact)
|
||||
.pull-right
|
||||
= link_to(t(:add_another), '#', class: 'btn btn-default btn-xs add-domain-contact')
|
||||
= link_to(t(:delete), '#', class: 'btn btn-default btn-xs destroy')
|
||||
.panel-body
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag "domain_contacts_attributes_#{k}_type", t(:contact_type), class: 'required'
|
||||
.col-md-7
|
||||
= select_tag "domain[contacts_attributes][#{k}][type]", options_for_select(['admin', 'tech'], v['type']), {class: 'form-control js-contact-type'}
|
||||
.js-contact
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left= t(:contact)
|
||||
.pull-right
|
||||
= link_to(t(:add_another), '#', class: 'btn btn-default btn-xs add-domain-contact')
|
||||
= link_to(t(:delete), '#', class: 'btn btn-default btn-xs destroy')
|
||||
.panel-body
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag "domain_contacts_attributes_#{k}_type", t(:contact_type), class: 'required'
|
||||
.col-md-7
|
||||
= select_tag "domain[contacts_attributes][#{k}][type]", options_for_select(['admin', 'tech'], v['type']), {class: 'form-control js-contact-type'}
|
||||
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag "domain_contacts_attributes_#{k}_code", t(:contact_code), class: 'required'
|
||||
.col-md-7.has-feedback
|
||||
= select_tag "domain[contacts_attributes][#{k}][code]",
|
||||
options_for_select(@contacts_autocomplete_map, selected: v['code']),
|
||||
include_blank: true, class: 'js-combobox js-contact-code', required: true
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag "domain_contacts_attributes_#{k}_code", t(:contact_code), class: 'required'
|
||||
.col-md-7.has-feedback
|
||||
= select_tag "domain[contacts_attributes][#{k}][code]",
|
||||
options_for_select(@contacts_autocomplete_map, selected: v['code']),
|
||||
include_blank: true, class: 'js-combobox js-contact-code', required: true
|
||||
|
||||
:coffee
|
||||
clone = $('#domain-contacts').clone()
|
||||
$("#domain-contacts").nestedAttributes
|
||||
clone = $('.js-contact:first').clone()
|
||||
$("#js-domain-contacts").nestedAttributes
|
||||
bindAddTo: $(".add-domain-contact")
|
||||
afterAdd: (item) ->
|
||||
# preselect type
|
||||
|
@ -35,10 +36,7 @@
|
|||
width: "100%"
|
||||
selectOnBlur: true
|
||||
dropdownAutoWidth: if self==top then true else false
|
||||
# remove link for temp
|
||||
# remove link for temp
|
||||
item.find('a.add-domain-contact').each (k, v) ->
|
||||
$(v).hide()
|
||||
$clone: clone
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue