mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +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 @@
|
|||
.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,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
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
#general-tab.tab-pane.active
|
||||
= render 'client/domains/form_partials/general', f: f
|
||||
%hr
|
||||
= render 'admin/domains/form_partials/contacts', f: f
|
||||
= render 'client/domains/form_partials/contacts', f: f
|
||||
%hr
|
||||
= render 'admin/domains/form_partials/nameservers', f: f
|
||||
= render 'client/domains/form_partials/nameservers', f: f
|
||||
#statuses-tab.tab-pane
|
||||
= render 'admin/domains/form_partials/statuses', f: f
|
||||
= render 'client/domains/form_partials/statuses', f: f
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
||||
|
|
29
app/views/client/domains/form_partials/_statuses.haml
Normal file
29
app/views/client/domains/form_partials/_statuses.haml
Normal file
|
@ -0,0 +1,29 @@
|
|||
#domain_statuses
|
||||
= f.fields_for :domain_statuses do |status_fields|
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
.pull-left= t('shared.status')
|
||||
.pull-right
|
||||
= link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-status')
|
||||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||
.panel-body
|
||||
.errors
|
||||
= render 'shared/errors', object: status_fields.object
|
||||
- if status_fields.object.errors.any?
|
||||
%hr
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= status_fields.label :value
|
||||
= status_fields.select :value, options_for_select(DomainStatus::STATUSES, status_fields.object.value), {include_blank: true}, {class: 'form-control'}
|
||||
.col-md-6
|
||||
.form-group
|
||||
= status_fields.label :description
|
||||
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
|
||||
:javascript
|
||||
$("#domain_statuses").nestedAttributes({
|
||||
bindAddTo: $(".add-domain-status"),
|
||||
afterAdd: function(item) {
|
||||
item.find('.errors').html('');
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue