mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 22:46:22 +02:00
Refactor
This commit is contained in:
parent
168e6d2a01
commit
660eef414e
8 changed files with 55 additions and 18 deletions
|
@ -7,6 +7,11 @@
|
|||
= link_to(t('shared.back_to_domain'), [:admin, @domain], class: 'btn btn-default')
|
||||
%hr
|
||||
= form_for([:admin, @domain, @domain_contact]) do |f|
|
||||
= render 'admin/shared/errors', object: @domain
|
||||
/ = render 'admin/shared/errors', object: f.object
|
||||
|
||||
- if @domain.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
|
@ -14,7 +19,7 @@
|
|||
= f.select :contact_type, options_for_select(DomainContact::TYPES, @domain_contact.contact_type), {}, {class: 'form-control'}
|
||||
.col-md-6
|
||||
.form-group.has-feedback
|
||||
= f.label :contact
|
||||
= label_tag :contact
|
||||
= text_field_tag(:contact, params[:contact], 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
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
.pull-left
|
||||
= t('shared.admin_contacts')
|
||||
.pull-right
|
||||
= link_to(t('shared.add'), new_admin_domain_admin_contact_path(@domain), class: 'btn btn-primary btn-xs')
|
||||
= link_to(t('shared.add'), new_admin_domain_domain_contact_path(@domain, type: DomainContact::ADMIN), class: 'btn btn-primary btn-xs')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
.pull-left
|
||||
= t('shared.tech_contacts')
|
||||
.pull-right
|
||||
= link_to(t('shared.add'), new_admin_domain_tech_contact_path(@domain), class: 'btn btn-primary btn-xs')
|
||||
= link_to(t('shared.add'), new_admin_domain_domain_contact_path(@domain, type: DomainContact::TECH), class: 'btn btn-primary btn-xs')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
|
@ -13,13 +13,13 @@
|
|||
%th{class: 'col-xs-5'}= t('shared.email')
|
||||
%th{class: 'col-xs-3'}= t('shared.action')
|
||||
%tbody
|
||||
- @domain.tech_contacts.each do |x|
|
||||
- @domain.domain_contacts.tech.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, root_path)
|
||||
%td= x.email
|
||||
%td= link_to(x.contact, root_path)
|
||||
%td= x.contact.email
|
||||
%td
|
||||
= link_to(t('shared.edit'), root_path, class: 'btn btn-primary btn-xs')
|
||||
= link_to(t('shared.detach'), admin_domain_tech_contact_path(@domain, x), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-warning btn-xs')
|
||||
= link_to(t('shared.detach'), admin_domain_domain_contact_path(@domain, x), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-warning btn-xs')
|
||||
- if @domain.errors.messages[:tech_contacts]
|
||||
%tfoot
|
||||
- @domain.errors.messages[:tech_contacts].each do |x|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue