mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 19:29:39 +02:00
Domain editing for client
This commit is contained in:
parent
ef0eb7cbc6
commit
92984e19dd
29 changed files with 358 additions and 54 deletions
|
@ -7,7 +7,6 @@
|
||||||
#= require typeahead.bundle.min
|
#= require typeahead.bundle.min
|
||||||
#= require autocomplete
|
#= require autocomplete
|
||||||
#= require jquery.nested_attributes
|
#= require jquery.nested_attributes
|
||||||
#= require app
|
|
||||||
|
|
||||||
NProgress.configure
|
NProgress.configure
|
||||||
showSpinner: false
|
showSpinner: false
|
||||||
|
|
|
@ -41,14 +41,26 @@ class @Autocomplete
|
||||||
$.each $(obj.hiddenSelector), (k, v) ->
|
$.each $(obj.hiddenSelector), (k, v) ->
|
||||||
Autocomplete.toggleOkFeedback($(v))
|
Autocomplete.toggleOkFeedback($(v))
|
||||||
|
|
||||||
@bindContactSearch: ->
|
@bindAdminContactSearch: ->
|
||||||
Autocomplete.bindTypeahead
|
Autocomplete.bindTypeahead
|
||||||
remote: '/admin/contacts/search'
|
remote: '/admin/contacts/search'
|
||||||
selector: '.js-contact-typeahead'
|
selector: '.js-contact-typeahead'
|
||||||
hiddenSelector: '.js-contact-id'
|
hiddenSelector: '.js-contact-id'
|
||||||
|
|
||||||
@bindRegistrarSearch: ->
|
@bindAdminRegistrarSearch: ->
|
||||||
Autocomplete.bindTypeahead
|
Autocomplete.bindTypeahead
|
||||||
remote: '/admin/registrars/search'
|
remote: '/admin/registrars/search'
|
||||||
selector: '.js-registrar-typeahead'
|
selector: '.js-registrar-typeahead'
|
||||||
hiddenSelector: '.js-registrar-id'
|
hiddenSelector: '.js-registrar-id'
|
||||||
|
|
||||||
|
@bindClientContactSearch: ->
|
||||||
|
Autocomplete.bindTypeahead
|
||||||
|
remote: '/client/contacts/search'
|
||||||
|
selector: '.js-contact-typeahead'
|
||||||
|
hiddenSelector: '.js-contact-id'
|
||||||
|
|
||||||
|
@bindClientRegistrarSearch: ->
|
||||||
|
Autocomplete.bindTypeahead
|
||||||
|
remote: '/client/registrars/search'
|
||||||
|
selector: '.js-registrar-typeahead'
|
||||||
|
hiddenSelector: '.js-registrar-id'
|
||||||
|
|
7
app/controllers/client/contacts_controller.rb
Normal file
7
app/controllers/client/contacts_controller.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class Client::ContactsController < ClientController
|
||||||
|
|
||||||
|
# TODO: Add Registrar to Contacts and search only contacts that belong to this domain
|
||||||
|
def search
|
||||||
|
render json: Contact.search_by_query(params[:q])
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,7 +1,57 @@
|
||||||
class Client::DomainsController < ClientController
|
class Client::DomainsController < ClientController
|
||||||
|
include Shared::CommonDomain
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = current_user.registrar.domains.search(params[:q])
|
@q = current_user.registrar.domains.search(params[:q])
|
||||||
@domains = @q.result.page(params[:page])
|
@domains = @q.result.page(params[:page])
|
||||||
render 'admin/domains/index'
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
owner_contact = Contact.find(params[:owner_contact_id]) if params[:owner_contact_id]
|
||||||
|
@domain = Domain.new(owner_contact: owner_contact, registrar: current_user.registrar)
|
||||||
|
params[:domain_owner_contact] = owner_contact
|
||||||
|
|
||||||
|
build_associations
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@domain = Domain.new(domain_params)
|
||||||
|
@domain.registrar = current_user.registrar
|
||||||
|
|
||||||
|
if @domain.save
|
||||||
|
flash[:notice] = I18n.t('shared.domain_added')
|
||||||
|
redirect_to [:client, @domain]
|
||||||
|
else
|
||||||
|
build_associations
|
||||||
|
flash.now[:alert] = I18n.t('shared.failed_to_add_domain')
|
||||||
|
render 'new'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
if @domain.update(domain_params)
|
||||||
|
flash[:notice] = I18n.t('shared.domain_updated')
|
||||||
|
redirect_to [:client, @domain]
|
||||||
|
else
|
||||||
|
build_associations
|
||||||
|
flash[:alert] = I18n.t('shared.failed_to_update_domain')
|
||||||
|
render 'edit'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def domain_params
|
||||||
|
params.require(:domain).permit(
|
||||||
|
:name,
|
||||||
|
:period,
|
||||||
|
:period_unit,
|
||||||
|
:owner_contact_id,
|
||||||
|
:owner_contact_typeahead,
|
||||||
|
:registrar_typeahead,
|
||||||
|
nameservers_attributes: [:id, :hostname, :ipv4, :ipv6, :_destroy],
|
||||||
|
domain_contacts_attributes: [:id, :contact_type, :contact_id, :value_typeahead, :_destroy],
|
||||||
|
domain_statuses_attributes: [:id, :value, :description, :_destroy]
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
30
app/controllers/concerns/shared/common_domain.rb
Normal file
30
app/controllers/concerns/shared/common_domain.rb
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
module Shared::CommonDomain
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
included do
|
||||||
|
before_action :set_domain, only: [:show, :edit, :update, :destroy]
|
||||||
|
before_action :verify_deletion, only: [:destroy]
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
build_associations
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_domain
|
||||||
|
@domain = Domain.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_associations
|
||||||
|
@domain.nameservers.build if @domain.nameservers.empty?
|
||||||
|
@domain.domain_contacts.build if @domain.domain_contacts.empty?
|
||||||
|
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
def verify_deletion
|
||||||
|
return if @domain.can_be_deleted?
|
||||||
|
flash[:alert] = I18n.t('shared.domain_status_prohibits_deleting')
|
||||||
|
redirect_to [:admin, @domain]
|
||||||
|
end
|
||||||
|
end
|
|
@ -162,7 +162,7 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def general_tab_valid?
|
def general_tab_valid?
|
||||||
status_errors = errors.keys.collect { |x| x.match(/domain_statuses/) }
|
status_errors = errors.keys.select { |x| x.match(/domain_statuses/) }
|
||||||
(errors.keys - status_errors).empty?
|
(errors.keys - status_errors).empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
= form_for([:admin, @domain]) do |f|
|
= form_for([:admin, @domain]) do |f|
|
||||||
= render 'admin/shared/errors', object: @domain
|
= render 'shared/errors', object: @domain
|
||||||
- unless @domain.parent_valid?
|
- unless @domain.parent_valid?
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
|
@ -27,6 +27,15 @@
|
||||||
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(function () {
|
$(function() {
|
||||||
$('#tabs a:first').tab('show')
|
$('#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')}"
|
= "#{t('shared.edit_domain')}"
|
||||||
.col-sm-6
|
.col-sm-6
|
||||||
%h2.text-right.text-center-xs
|
%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
|
%hr
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||||
.panel-body
|
.panel-body
|
||||||
.errors
|
.errors
|
||||||
= render 'admin/shared/errors', object: contact_fields.object
|
= render 'shared/errors', object: contact_fields.object
|
||||||
- if contact_fields.object.errors.any?
|
- if contact_fields.object.errors.any?
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
|
@ -23,12 +23,3 @@
|
||||||
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
|
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
|
||||||
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
|
||||||
= contact_fields.hidden_field(:contact_id, class: 'js-contact-id')
|
= 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')
|
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||||
.panel-body
|
.panel-body
|
||||||
.errors
|
.errors
|
||||||
= render 'admin/shared/errors', object: ns_fields.object
|
= render 'shared/errors', object: ns_fields.object
|
||||||
- if ns_fields.object.errors.any?
|
- if ns_fields.object.errors.any?
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
= link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
|
||||||
.panel-body
|
.panel-body
|
||||||
.errors
|
.errors
|
||||||
= render 'admin/shared/errors', object: status_fields.object
|
= render 'shared/errors', object: status_fields.object
|
||||||
- if status_fields.object.errors.any?
|
- if status_fields.object.errors.any?
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
|
|
|
@ -5,4 +5,30 @@
|
||||||
%h2.text-right.text-center-xs
|
%h2.text-right.text-center-xs
|
||||||
= link_to(t('shared.add'), new_admin_domain_path, class: 'btn btn-primary')
|
= link_to(t('shared.add'), new_admin_domain_path, class: 'btn btn-primary')
|
||||||
%hr
|
%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,4 +0,0 @@
|
||||||
- if errors.any?
|
|
||||||
- errors.each do |err|
|
|
||||||
= err
|
|
||||||
%br
|
|
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
|
%h2.text-right.text-center-xs
|
||||||
= link_to(t('shared.add'), new_client_domain_path, class: 'btn btn-primary')
|
= link_to(t('shared.add'), new_client_domain_path, class: 'btn btn-primary')
|
||||||
%hr
|
%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'
|
|
@ -31,6 +31,8 @@
|
||||||
= link_to t('shared.domains'), admin_domains_path
|
= link_to t('shared.domains'), admin_domains_path
|
||||||
%li
|
%li
|
||||||
= link_to t('shared.contacts'), admin_contacts_path
|
= link_to t('shared.contacts'), admin_contacts_path
|
||||||
|
%li
|
||||||
|
= link_to t('shared.eedirekt'), client_domains_path
|
||||||
%li.dropdown
|
%li.dropdown
|
||||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||||
= t('shared.settings')
|
= t('shared.settings')
|
|
@ -20,7 +20,7 @@
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
= link_to 'EPP Client', root_path, class: 'navbar-brand'
|
= link_to 'EPP Client', client_domains_path, class: 'navbar-brand'
|
||||||
.navbar-collapse.collapse
|
.navbar-collapse.collapse
|
||||||
%ul.nav.navbar-nav
|
%ul.nav.navbar-nav
|
||||||
%li.dropdown.active
|
%li.dropdown.active
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
.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
|
|
|
@ -271,4 +271,5 @@ en:
|
||||||
setting_updated: 'Setting updated!'
|
setting_updated: 'Setting updated!'
|
||||||
failed_to_update_setting: 'Failed to update setting'
|
failed_to_update_setting: 'Failed to update setting'
|
||||||
status: 'Status'
|
status: 'Status'
|
||||||
|
eedirekt: 'EEDirekt'
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,12 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
namespace(:client) do
|
namespace(:client) do
|
||||||
resources :domains
|
resources :domains
|
||||||
|
|
||||||
|
resources :contacts do
|
||||||
|
collection do
|
||||||
|
get 'search'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue