mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Improvements on validation
This commit is contained in:
parent
8ea865f1b2
commit
a4e5703233
6 changed files with 46 additions and 27 deletions
|
@ -9,7 +9,7 @@
|
|||
- li_class = @domain.associations_valid?(:nameservers) ? nil : 'error-tab'
|
||||
%li{class: li_class}
|
||||
%a{"data-toggle" => "tab", :href => "#nameservers-tab", :role => "tab"}= t('shared.nameservers')
|
||||
- li_class = @domain.associations_valid?(:domain_contacts) ? nil : 'error-tab'
|
||||
- li_class = @domain.contacts_tab_valid? ? nil : 'error-tab'
|
||||
%li{class: li_class}
|
||||
%a{"data-toggle" => "tab", :href => "#contacts-tab", :role => "tab"}= t('shared.contacts')
|
||||
- li_class = @domain.associations_valid?(:domain_statuses) ? nil : 'error-tab'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
= render 'admin/shared/errors_array', errors: @domain.errors[:domain_contacts]
|
||||
- if @domain.errors[:domain_contacts].any?
|
||||
= render 'admin/shared/errors_array', errors: @domain.errors[:admin_contacts]
|
||||
= render 'admin/shared/errors_array', errors: @domain.errors[:tech_contacts]
|
||||
- if (@domain.errors[:domain_contacts] + @domain.errors[:admin_contacts] + @domain.errors[:tech_contacts]).any?
|
||||
%hr
|
||||
#domain_contacts
|
||||
= f.fields_for :domain_contacts do |contact_fields|
|
||||
|
@ -19,8 +21,8 @@
|
|||
= contact_fields.select :contact_type, options_for_select(DomainContact::TYPES, contact_fields.object.contact_type), {}, {class: 'form-control'}
|
||||
.col-md-6
|
||||
.form-group.has-feedback.js-typeahead-container
|
||||
= contact_fields.label :typeahead_value
|
||||
= contact_fields.text_field(:typeahead_value, class: 'form-control js-contact-typeahead', placeholder: t('shared.contact_code'), autocomplete: 'off')
|
||||
= contact_fields.label :value_typeahead
|
||||
= 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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue