mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Domain editing for client
This commit is contained in:
parent
ef0eb7cbc6
commit
92984e19dd
29 changed files with 358 additions and 54 deletions
43
app/views/client/domains/_form.haml
Normal file
43
app/views/client/domains/_form.haml
Normal file
|
@ -0,0 +1,43 @@
|
|||
= form_for([:client, @domain]) do |f|
|
||||
= render 'shared/errors', object: @domain
|
||||
- unless @domain.parent_valid?
|
||||
%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-content{style:'margin-top: 20px;'}
|
||||
#general-tab.tab-pane.active
|
||||
= render 'client/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
|
||||
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
||||
|
||||
:javascript
|
||||
$(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.bindClientContactSearch();
|
||||
}
|
||||
});
|
||||
|
||||
Autocomplete.bindClientContactSearch();
|
9
app/views/client/domains/edit.haml
Normal file
9
app/views/client/domains/edit.haml
Normal file
|
@ -0,0 +1,9 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs
|
||||
= "#{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')
|
||||
%hr
|
||||
= render 'form'
|
20
app/views/client/domains/form_partials/_general.haml
Normal file
20
app/views/client/domains/form_partials/_general.haml
Normal file
|
@ -0,0 +1,20 @@
|
|||
.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 :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')
|
||||
|
|
@ -5,4 +5,28 @@
|
|||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.add'), new_client_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, '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, client_domain_path(x))
|
||||
%td= link_to(x.owner_contact, '#')
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(t('shared.edit'), edit_client_domain_path(x), class: 'btn btn-primary btn-xs')
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
||||
|
||||
|
|
3
app/views/client/domains/new.haml
Normal file
3
app/views/client/domains/new.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
%h2= t('shared.new_domain')
|
||||
%hr
|
||||
= render 'form'
|
22
app/views/client/domains/partials/_admin_contacts.haml
Normal file
22
app/views/client/domains/partials/_admin_contacts.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
- panel_class = @domain.errors.messages[:admin_contacts] ? 'panel-danger' : 'panel-default'
|
||||
.panel{class: panel_class}
|
||||
.panel-heading.clearfix
|
||||
= t('shared.admin_contacts')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-4'}= t('shared.name')
|
||||
%th{class: 'col-xs-4'}= t('shared.code')
|
||||
%th{class: 'col-xs-4'}= t('shared.email')
|
||||
%tbody
|
||||
- @domain.domain_contacts.admin.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.contact, '#')
|
||||
%td= x.contact.code
|
||||
%td= x.contact.email
|
||||
- if @domain.errors.messages[:admin_contacts]
|
||||
%tfoot
|
||||
- @domain.errors.messages[:admin_contacts].each do |x|
|
||||
%tr
|
||||
%td{colspan: 4}= x
|
19
app/views/client/domains/partials/_general.haml
Normal file
19
app/views/client/domains/partials/_general.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t('shared.general')
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t('shared.name')
|
||||
%dd= @domain.name
|
||||
|
||||
%dt= t('shared.registered_at')
|
||||
%dd= l(@domain.registered_at)
|
||||
|
||||
%dt= t('shared.password')
|
||||
%dd= @domain.auth_info
|
||||
|
||||
%dt= t('shared.valid_from')
|
||||
%dd= l(@domain.valid_from)
|
||||
|
||||
%dt= t('shared.valid_to')
|
||||
%dd= l(@domain.valid_to)
|
19
app/views/client/domains/partials/_owner.haml
Normal file
19
app/views/client/domains/partials/_owner.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t('shared.owner')
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t('shared.name')
|
||||
%dd= link_to(@domain.owner_contact, '#')
|
||||
|
||||
%dt= t('shared.code')
|
||||
%dd= @domain.owner_contact_code
|
||||
|
||||
%dt= t('shared.identity_code')
|
||||
%dd= @domain.owner_contact_ident
|
||||
|
||||
%dt= t('shared.email')
|
||||
%dd= @domain.owner_contact_email
|
||||
|
||||
%dt= t('shared.phone')
|
||||
%dd= @domain.owner_contact_phone
|
22
app/views/client/domains/partials/_tech_contacts.haml
Normal file
22
app/views/client/domains/partials/_tech_contacts.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
- panel_class = @domain.errors.messages[:tech_contacts] ? 'panel-danger' : 'panel-default'
|
||||
#tech_contacts.panel{class: panel_class}
|
||||
.panel-heading.clearfix
|
||||
= t('shared.tech_contacts')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-4'}= t('shared.name')
|
||||
%th{class: 'col-xs-4'}= t('shared.code')
|
||||
%th{class: 'col-xs-4'}= t('shared.email')
|
||||
%tbody
|
||||
- @domain.domain_contacts.tech.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.contact, '#')
|
||||
%td= x.contact.code
|
||||
%td= x.contact.email
|
||||
- if @domain.errors.messages[:tech_contacts]
|
||||
%tfoot
|
||||
- @domain.errors.messages[:tech_contacts].each do |x|
|
||||
%tr
|
||||
%td{colspan: 4}= x
|
21
app/views/client/domains/show.haml
Normal file
21
app/views/client/domains/show.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs
|
||||
= "#{t('shared.domain_details')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.edit'), edit_client_domain_path(@domain), class: 'btn btn-primary')
|
||||
= link_to(t('shared.delete'), client_domain_path(@domain), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-danger')
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-6= render 'client/domains/partials/general'
|
||||
.col-md-6= render 'client/domains/partials/owner'
|
||||
.row
|
||||
.col-md-12= render 'admin/domains/partials/nameservers'
|
||||
.row
|
||||
.col-md-12= render 'admin/domains/partials/statuses'
|
||||
.row
|
||||
.col-md-12= render 'client/domains/partials/tech_contacts'
|
||||
.row
|
||||
.col-md-12= render 'client/domains/partials/admin_contacts'
|
Loading…
Add table
Add a link
Reference in a new issue