mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Domain editing for client
This commit is contained in:
parent
ef0eb7cbc6
commit
92984e19dd
29 changed files with 358 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
= form_for([:admin, @domain]) do |f|
|
||||
= render 'admin/shared/errors', object: @domain
|
||||
= render 'shared/errors', object: @domain
|
||||
- unless @domain.parent_valid?
|
||||
%hr
|
||||
.row
|
||||
|
@ -27,6 +27,15 @@
|
|||
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
||||
|
||||
:javascript
|
||||
$(function () {
|
||||
$(function() {
|
||||
$('#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.bindAdminContactSearch();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
= "#{t('shared.edit_domain')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.back_to_domain'), [:admin, @domain], class: 'btn btn-default')
|
||||
= link_to(t('shared.back_to_domain'), [:client, @domain], class: 'btn btn-default')
|
||||
%hr
|
||||
= render 'form'
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'admin/shared/errors', object: contact_fields.object
|
||||
= render 'shared/errors', object: contact_fields.object
|
||||
- if contact_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
|
@ -23,12 +23,3 @@
|
|||
%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.bindContactSearch();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'admin/shared/errors', object: ns_fields.object
|
||||
= render 'shared/errors', object: ns_fields.object
|
||||
- if ns_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'admin/shared/errors', object: status_fields.object
|
||||
= render 'shared/errors', object: status_fields.object
|
||||
- if status_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
|
|
|
@ -5,4 +5,30 @@
|
|||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.add'), new_admin_domain_path, class: 'btn btn-primary')
|
||||
%hr
|
||||
= render 'shared/domains/index'
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrar_name', t('shared.registrar'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'owner_contact_international_address_name', t('shared.owner'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.action')
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, admin_domain_path(x))
|
||||
%td= link_to(x.registrar, root_path) if x.registrar
|
||||
%td= link_to(x.owner_contact, [:admin, x.owner_contact])
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(t('shared.edit'), edit_admin_domain_path(x), class: 'btn btn-primary btn-xs')
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
- if object.errors.any?
|
||||
- object.errors.each do |attr, err|
|
||||
- next if attr.match(/\./)
|
||||
- next if attr == :epp_errors
|
||||
= err
|
||||
%br
|
|
@ -1,4 +0,0 @@
|
|||
- if errors.any?
|
||||
- errors.each do |err|
|
||||
= err
|
||||
%br
|
Loading…
Add table
Add a link
Reference in a new issue