mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Remove domain editing and adding from admin
This commit is contained in:
parent
482d77c319
commit
302f51a4cb
12 changed files with 64 additions and 124 deletions
|
@ -4,23 +4,13 @@
|
|||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
/ Nav tabs
|
||||
%ul.nav.nav-tabs{:role => "tablist", id: 'tabs'}
|
||||
- li_class = @domain.general_tab_valid? ? nil : 'error-tab'
|
||||
%li.active{class: li_class}
|
||||
%a{"data-toggle" => "tab", :href => "#general-tab", :role => "tab"}= t('shared.general')
|
||||
- li_class = @domain.statuses_tab_valid? ? nil : 'error-tab'
|
||||
%li{class: li_class}
|
||||
%a{"data-toggle" => "tab", :href => "#statuses-tab", :role => "tab"}= t('shared.statuses')
|
||||
/ Tab panes
|
||||
/ Tab panes
|
||||
.tab-content{style:'margin-top: 20px;'}
|
||||
#general-tab.tab-pane.active
|
||||
= render 'admin/domains/form_partials/general', f: f
|
||||
%hr
|
||||
= render 'admin/domains/form_partials/contacts', f: f
|
||||
%hr
|
||||
= render 'admin/domains/form_partials/nameservers', f: f
|
||||
#statuses-tab.tab-pane
|
||||
= render 'admin/domains/form_partials/statuses', f: f
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
|
@ -30,15 +20,3 @@
|
|||
$(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();
|
||||
}
|
||||
});
|
||||
|
||||
Autocomplete.bindAdminContactSearch()
|
||||
Autocomplete.bindAdminRegistrarSearch()
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
#domain_contacts
|
||||
= f.fields_for :domain_contacts do |contact_fields|
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left= t('shared.contact')
|
||||
.pull-right
|
||||
= link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-contact')
|
||||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'shared/errors', object: contact_fields.object
|
||||
- if contact_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= contact_fields.label :contact_type
|
||||
= 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 :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')
|
|
@ -1,25 +0,0 @@
|
|||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.text_field(:name, class: 'form-control')
|
||||
.form-group
|
||||
= f.label :period
|
||||
.row
|
||||
.col-md-6
|
||||
= f.text_field(:period, class: 'form-control')
|
||||
.col-md-6
|
||||
= f.select :period_unit, options_for_select(['y', 'm', 'd'], @domain.period_unit), {}, {class: 'form-control'}
|
||||
.col-md-6
|
||||
.form-group.has-feedback.js-typeahead-container
|
||||
= f.label :registrar_typeahead
|
||||
= f.text_field(:registrar_typeahead, class: 'form-control js-registrar-typeahead', placeholder: t('shared.registrar_name'), autocomplete: 'off')
|
||||
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
|
||||
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
||||
= f.hidden_field(:registrar_id, class: 'js-registrar-id')
|
||||
.form-group.has-feedback.js-typeahead-container
|
||||
= f.label :owner_contact_typeahead
|
||||
= f.text_field(:owner_contact_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
|
||||
= f.hidden_field(:owner_contact_id, class: 'js-contact-id')
|
|
@ -1,34 +0,0 @@
|
|||
#nameservers
|
||||
= f.fields_for :nameservers do |ns_fields|
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left= t('shared.nameserver')
|
||||
.pull-right
|
||||
= link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-nameserver')
|
||||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'shared/errors', object: ns_fields.object
|
||||
- if ns_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.form-group
|
||||
= ns_fields.label :hostname
|
||||
= ns_fields.text_field :hostname, class: 'form-control'
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= ns_fields.label :ipv4
|
||||
= ns_fields.text_field :ipv4, class: 'form-control'
|
||||
.col-md-6
|
||||
.form-group
|
||||
= ns_fields.label :ipv6
|
||||
= ns_fields.text_field :ipv6, class: 'form-control'
|
||||
:javascript
|
||||
$("#nameservers").nestedAttributes({
|
||||
bindAddTo: $(".add-nameserver"),
|
||||
afterAdd: function(item) {
|
||||
item.find('.errors').html('');
|
||||
}
|
||||
});
|
|
@ -1,9 +1,6 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
.col-sm-12
|
||||
%h2.text-center-xs= t('shared.domains')
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.add'), new_admin_domain_path, class: 'btn btn-primary')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
@ -17,10 +14,8 @@
|
|||
= 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'}
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.action')
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
|
@ -28,7 +23,6 @@
|
|||
%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,3 +0,0 @@
|
|||
%h2= t('shared.new_domain')
|
||||
%hr
|
||||
= render 'form'
|
|
@ -4,8 +4,7 @@
|
|||
= "#{t('shared.domain_details')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.edit'), edit_admin_domain_path(@domain), class: 'btn btn-primary')
|
||||
= link_to(t('shared.delete'), admin_domain_path(@domain), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-danger')
|
||||
= link_to(t('shared.edit_statuses'), edit_admin_domain_path(@domain), class: 'btn btn-primary')
|
||||
|
||||
%hr
|
||||
.row
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue