mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Merge remote-tracking branch 'origin/105842700-registrants_portal' into 105846070-merge-with-105842700-arireg-for-registrant-port
This commit is contained in:
commit
613a34a2c5
28 changed files with 699 additions and 29 deletions
|
@ -32,7 +32,7 @@ class ApplicationController < ActionController::Base
|
||||||
if registrar_request?
|
if registrar_request?
|
||||||
registrar_root_url
|
registrar_root_url
|
||||||
elsif registrant_request?
|
elsif registrant_request?
|
||||||
registrant_root_url
|
registrant_login_url
|
||||||
elsif admin_request?
|
elsif admin_request?
|
||||||
admin_root_url
|
admin_root_url
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,55 @@
|
||||||
class Registrant::DomainsController < RegistrantController
|
class Registrant::DomainsController < RegistrantController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize! :view, :registrant_domains
|
authorize! :view, :registrant_domains
|
||||||
|
params[:q] ||= {}
|
||||||
|
domains = current_user.domains
|
||||||
|
normalize_search_parameters do
|
||||||
|
@q = domains.search(params[:q])
|
||||||
|
@domains = @q.result.page(params[:page])
|
||||||
end
|
end
|
||||||
end
|
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@domain = Domain.find(params[:id])
|
||||||
|
if !(current_user.domains.include?(@domain) || @domain.valid?)
|
||||||
|
redirect_to registrant_domains_path
|
||||||
|
end
|
||||||
|
authorize! :read, @domain
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_domain
|
||||||
|
@domain = Domain.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def download_list
|
||||||
|
authorize! :view, :registrant_domains
|
||||||
|
params[:q] ||= {}
|
||||||
|
domains = current_user.domains
|
||||||
|
normalize_search_parameters do
|
||||||
|
@q = domains.search(params[:q])
|
||||||
|
@domains = @q
|
||||||
|
end
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.csv { render text: @domains.result.to_csv }
|
||||||
|
format.pdf do
|
||||||
|
pdf = @domains.result.pdf(render_to_string('registrant/domains/download_list', layout: false))
|
||||||
|
send_data pdf, filename: 'domains.pdf'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def normalize_search_parameters
|
||||||
|
ca_cache = params[:q][:valid_to_lteq]
|
||||||
|
begin
|
||||||
|
end_time = params[:q][:valid_to_lteq].try(:to_date)
|
||||||
|
params[:q][:valid_to_lteq] = end_time.try(:end_of_day)
|
||||||
|
rescue
|
||||||
|
logger.warn('Invalid date')
|
||||||
|
end
|
||||||
|
yield
|
||||||
|
params[:q][:valid_to_lteq] = ca_cache
|
||||||
|
end
|
||||||
|
end
|
8
app/controllers/registrant/registrants_controller.rb
Normal file
8
app/controllers/registrant/registrants_controller.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
class Registrant::RegistrantsController < RegistrantController
|
||||||
|
|
||||||
|
def show
|
||||||
|
@contact = Registrant.find(params[:id])
|
||||||
|
authorize! :read, @contact
|
||||||
|
@contact.valid?
|
||||||
|
end
|
||||||
|
end
|
7
app/controllers/registrant/registrars_controller.rb
Normal file
7
app/controllers/registrant/registrars_controller.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class Registrant::RegistrarsController < RegistrantController
|
||||||
|
|
||||||
|
def show
|
||||||
|
@registrar = Registrar.find(params[:id])
|
||||||
|
authorize! :read, @registrar
|
||||||
|
end
|
||||||
|
end
|
|
@ -6,15 +6,10 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
# rubocop: disable Metrics/AbcSize
|
# rubocop: disable Metrics/AbcSize
|
||||||
def id
|
def id
|
||||||
if Rails.env.development?
|
id_code, id_issuer = request.env['SSL_CLIENT_S_DN'], request.env['SSL_CLIENT_I_DN_O']
|
||||||
sign_in(RegistrantUser.find_or_create_by_idc_data('test'), event: :authentication)
|
id_code, id_issuer = 'test', RegistrantUser::ACCEPTED_ISSUER if Rails.env.development?
|
||||||
return redirect_to registrant_root_url
|
|
||||||
end
|
|
||||||
|
|
||||||
logger.error request.env['SSL_CLIENT_S_DN']
|
@user = RegistrantUser.find_or_create_by_idc_data(id_code, id_issuer)
|
||||||
logger.error request.env['SSL_CLIENT_S_DN'].encoding
|
|
||||||
logger.error request.env['SSL_CLIENT_I_DN_O']
|
|
||||||
@user = RegistrantUser.find_or_create_by_idc_data(request.env['SSL_CLIENT_S_DN'], request.env['SSL_CLIENT_I_DN_O'])
|
|
||||||
if @user
|
if @user
|
||||||
sign_in(@user, event: :authentication)
|
sign_in(@user, event: :authentication)
|
||||||
redirect_to registrant_root_url
|
redirect_to registrant_root_url
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
class Registrant::WhoisController < RegistrantController
|
class Registrant::WhoisController < RegistrantController
|
||||||
def index
|
def index
|
||||||
authorize! :view, :registrant_whois
|
authorize! :view, :registrant_whois
|
||||||
|
|
||||||
|
if params[:domain_name].present?
|
||||||
|
@domain = WhoisRecord.find_by(name: params[:domain_name]);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Ability
|
||||||
@user.roles.each { |role| send(role) } if @user.roles
|
@user.roles.each { |role| send(role) } if @user.roles
|
||||||
when 'ApiUser'
|
when 'ApiUser'
|
||||||
@user.roles.each { |role| send(role) } if @user.roles
|
@user.roles.each { |role| send(role) } if @user.roles
|
||||||
when 'RegistrantUser'
|
when 'RegistrantUser'
|
||||||
static_registrant
|
static_registrant
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -117,9 +117,11 @@ class Ability
|
||||||
end
|
end
|
||||||
|
|
||||||
def static_registrant
|
def static_registrant
|
||||||
|
customer_service
|
||||||
can :manage, :registrant_domains
|
can :manage, :registrant_domains
|
||||||
can :manage, :registrant_whois
|
can :manage, :registrant_whois
|
||||||
can :manage, Depp::Domain
|
can :manage, Depp::Domain
|
||||||
|
can :manage, Domain
|
||||||
end
|
end
|
||||||
|
|
||||||
def user
|
def user
|
||||||
|
|
|
@ -818,5 +818,19 @@ class Domain < ActiveRecord::Base
|
||||||
status_notes[status] = notes[i]
|
status_notes[status] = notes[i]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.to_csv
|
||||||
|
CSV.generate do |csv|
|
||||||
|
csv << column_names
|
||||||
|
all.each do |domain|
|
||||||
|
csv << domain.attributes.values_at(*column_names)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.pdf(html)
|
||||||
|
kit = PDFKit.new(html)
|
||||||
|
kit.to_pdf
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# rubocop: enable Metrics/ClassLength
|
# rubocop: enable Metrics/ClassLength
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class RegistrantUser < User
|
class RegistrantUser < User
|
||||||
|
ACCEPTED_ISSUER = 'AS Sertifitseerimiskeskus'
|
||||||
attr_accessor :idc_data
|
attr_accessor :idc_data
|
||||||
|
|
||||||
def ability
|
def ability
|
||||||
|
@ -6,6 +7,15 @@ class RegistrantUser < User
|
||||||
end
|
end
|
||||||
delegate :can?, :cannot?, to: :ability
|
delegate :can?, :cannot?, to: :ability
|
||||||
|
|
||||||
|
def ident
|
||||||
|
registrant_ident.to_s.split("-").last
|
||||||
|
end
|
||||||
|
|
||||||
|
def domains
|
||||||
|
Domain.includes(:registrar, :registrant).where(contacts: {ident: ident})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
username
|
username
|
||||||
end
|
end
|
||||||
|
@ -13,11 +23,9 @@ class RegistrantUser < User
|
||||||
class << self
|
class << self
|
||||||
def find_or_create_by_idc_data(idc_data, issuer_organization)
|
def find_or_create_by_idc_data(idc_data, issuer_organization)
|
||||||
return false if idc_data.blank?
|
return false if idc_data.blank?
|
||||||
return false if issuer_organization != 'AS Sertifitseerimiskeskus'
|
return false if issuer_organization != ACCEPTED_ISSUER
|
||||||
|
|
||||||
idc_data.force_encoding('UTF-8')
|
idc_data.force_encoding('UTF-8')
|
||||||
logger.error(idc_data)
|
|
||||||
logger.error(idc_data.encoding)
|
|
||||||
identity_code = idc_data.scan(/serialNumber=(\d+)/).flatten.first
|
identity_code = idc_data.scan(/serialNumber=(\d+)/).flatten.first
|
||||||
country = idc_data.scan(/^\/C=(.{2})/).flatten.first
|
country = idc_data.scan(/^\/C=(.{2})/).flatten.first
|
||||||
first_name = idc_data.scan(%r{/GN=(.+)/serialNumber}).flatten.first
|
first_name = idc_data.scan(%r{/GN=(.+)/serialNumber}).flatten.first
|
||||||
|
|
28
app/views/registrant/domains/download_list.haml
Normal file
28
app/views/registrant/domains/download_list.haml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
!!!
|
||||||
|
%html
|
||||||
|
%head
|
||||||
|
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
||||||
|
%title Contacts
|
||||||
|
%body
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
=t(:name)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
=t(:registrant)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
=t(:valid_to)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
=t(:registrar)
|
||||||
|
%tbody
|
||||||
|
- @domains.result.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= x.name
|
||||||
|
%td= x.registrant
|
||||||
|
%td= l(x.valid_to, format: :short)
|
||||||
|
%td= x.registrar
|
||||||
|
.row
|
||||||
|
.col-md-6
|
|
@ -1,5 +1,52 @@
|
||||||
= render 'shared/title', name: t(:domains)
|
= render 'shared/title', name: t(:domains)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= search_form_for [:registrant, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :name
|
||||||
|
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:registrant_ident)
|
||||||
|
= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident)
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:valid_to_from)
|
||||||
|
= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control datepicker', placeholder: t(:valid_to_from)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:valid_to_until)
|
||||||
|
= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control datepicker', placeholder: t(:valid_to_until)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:results_per_page)
|
||||||
|
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||||
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
|
%button.btn.btn-default.js-reset-form
|
||||||
|
= t(:clear_fields)
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.btn-group{:role => "group"}
|
||||||
|
%button.btn.btn-default.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"}
|
||||||
|
Download
|
||||||
|
%span.caret
|
||||||
|
%ul.dropdown-menu
|
||||||
|
%li= link_to 'PDF', download_list_registrant_domains_path(q: params[:q], format: "pdf")
|
||||||
|
%li= link_to 'CSV', download_list_registrant_domains_path(q: params[:q], format: "csv")
|
||||||
|
.col-md-3
|
||||||
|
.col-md-3
|
||||||
|
.col-md-3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
@ -8,20 +55,33 @@
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:name)
|
= sort_link(@q, 'name')
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:registrant)
|
= sort_link(@q, 'registrant_name', t(:registrant))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:valid_to)
|
= sort_link(@q, 'valid_to', t(:valid_to))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:registrar)
|
= sort_link(@q, 'registrar_name', t(:registrar))
|
||||||
%tbody
|
%tbody
|
||||||
-# - @domains.each do |x|
|
- @domains.each do |x|
|
||||||
-# %tr
|
%tr
|
||||||
-# %td= link_to(x, admin_domain_path(x))
|
%td= link_to(x, registrant_domain_path(x))
|
||||||
-# %td
|
%td
|
||||||
-# - if x.registrant
|
- if x.registrant
|
||||||
-# = link_to(x.registrant, [:admin, x.registrant])
|
= link_to(x.registrant, [:registrant, x.registrant]) if x.registrant
|
||||||
|
|
||||||
|
%td= l(x.valid_to, format: :short)
|
||||||
|
%td= link_to(x.registrar, registrant_registrar_path(x.registrar)) if x.registrar
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
= paginate @domains
|
||||||
|
.col-md-6.text-right
|
||||||
|
.pagination
|
||||||
|
= t(:result_count, count: @domains.total_count)
|
||||||
|
|
||||||
|
:coffee
|
||||||
|
$(".js-reset-form").on "click", (e) ->
|
||||||
|
e.preventDefault();
|
||||||
|
window.location = "#{registrant_domains_path}"
|
||||||
|
|
||||||
-# %td= l(x.valid_to, format: :short)
|
|
||||||
-# %td= link_to(x.registrar, admin_registrar_path(x.registrar)) if x.registrar
|
|
||||||
|
|
22
app/views/registrant/domains/partials/_admin_contacts.haml
Normal file
22
app/views/registrant/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(:admin_contacts)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-4'}= t(:name)
|
||||||
|
%th{class: 'col-xs-4'}= t(:id)
|
||||||
|
%th{class: 'col-xs-4'}= t(:email)
|
||||||
|
%tbody
|
||||||
|
- @domain.admin_contacts.each do |ac|
|
||||||
|
%tr
|
||||||
|
%td= link_to(ac, admin_contact_path(ac))
|
||||||
|
%td= ac.code
|
||||||
|
%td= ac.email
|
||||||
|
- if @domain.errors.messages[:admin_contacts]
|
||||||
|
%tfoot
|
||||||
|
- @domain.errors.messages[:admin_contacts].each do |x|
|
||||||
|
%tr
|
||||||
|
%td{colspan: 4}= x
|
25
app/views/registrant/domains/partials/_dnskeys.haml
Normal file
25
app/views/registrant/domains/partials/_dnskeys.haml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
- panel_class = @domain.errors.messages[:dnskeys] ? 'panel-danger' : 'panel-default'
|
||||||
|
#dnskeys.panel{class: panel_class}
|
||||||
|
.panel-heading.clearfix
|
||||||
|
= t(:dnskeys)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-1'}= t(:flag)
|
||||||
|
%th{class: 'col-xs-1'}= t(:protocol)
|
||||||
|
%th{class: 'col-xs-1'}= t(:algorithm)
|
||||||
|
%th{class: 'col-xs-9'}= t(:public_key)
|
||||||
|
%tbody
|
||||||
|
- @domain.dnskeys.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= x.flags
|
||||||
|
%td= x.protocol
|
||||||
|
%td= x.alg
|
||||||
|
%td= x.public_key
|
||||||
|
- if @domain.errors.messages[:dnskeys]
|
||||||
|
%tfoot
|
||||||
|
- @domain.errors.messages[:dnskeys].each do |x|
|
||||||
|
%tr
|
||||||
|
%td{colspan: 4}= x
|
||||||
|
|
32
app/views/registrant/domains/partials/_general.haml
Normal file
32
app/views/registrant/domains/partials/_general.haml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:general)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:name)
|
||||||
|
%dd= @domain.name
|
||||||
|
|
||||||
|
%dt= t(:registered_at)
|
||||||
|
%dd= l(@domain.registered_at)
|
||||||
|
|
||||||
|
%dt= t(:registrar)
|
||||||
|
%dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar))
|
||||||
|
|
||||||
|
%dt= t(:authinfo_pw)
|
||||||
|
%dd
|
||||||
|
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'
|
||||||
|
|
||||||
|
%dt= t(:valid_from)
|
||||||
|
%dd= l(@domain.valid_from)
|
||||||
|
|
||||||
|
%dt= t(:valid_to)
|
||||||
|
%dd= l(@domain.valid_to)
|
||||||
|
|
||||||
|
%dt= t(:outzone_at)
|
||||||
|
%dd= l(@domain.outzone_at)
|
||||||
|
|
||||||
|
%dt= t(:delete_at)
|
||||||
|
%dd= l(@domain.delete_at)
|
||||||
|
|
||||||
|
%dt= t(:force_delete_at)
|
||||||
|
%dd= l(@domain.force_delete_at)
|
20
app/views/registrant/domains/partials/_keyrelays.haml
Normal file
20
app/views/registrant/domains/partials/_keyrelays.haml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.panel{class: 'panel-default'}
|
||||||
|
.panel-heading.clearfix
|
||||||
|
= t(:keyrelays)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-4'}= t(:uploaded_at)
|
||||||
|
%th{class: 'col-xs-3'}= t(:expiry)
|
||||||
|
%th{class: 'col-xs-2'}= t(:requester)
|
||||||
|
%th{class: 'col-xs-2'}= t(:accepter)
|
||||||
|
%th{class: 'col-xs-1'}= t(:status)
|
||||||
|
%tbody
|
||||||
|
- @domain.keyrelays.includes([:requester, :accepter]).order(pa_date: :desc).each do |x|
|
||||||
|
%tr
|
||||||
|
%td= link_to(x.pa_date, [:admin, x])
|
||||||
|
%td= x.expiry
|
||||||
|
%td= link_to(x.requester, [:admin, x.requester])
|
||||||
|
%td= link_to(x.accepter, [:admin, x.accepter])
|
||||||
|
%td= x.status
|
14
app/views/registrant/domains/partials/_legal_documents.haml
Normal file
14
app/views/registrant/domains/partials/_legal_documents.haml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading.clearfix
|
||||||
|
= t(:legal_documents)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-8'}= t(:created_at)
|
||||||
|
%th{class: 'col-xs-4'}= t(:type)
|
||||||
|
%tbody
|
||||||
|
- legal_documents.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= link_to(x.created_at, [:admin, x])
|
||||||
|
%td= x.document_type
|
23
app/views/registrant/domains/partials/_nameservers.haml
Normal file
23
app/views/registrant/domains/partials/_nameservers.haml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
- panel_class = @domain.errors.messages[:nameservers] ? 'panel-danger' : 'panel-default'
|
||||||
|
#nameservers.panel{class: panel_class}
|
||||||
|
.panel-heading.clearfix
|
||||||
|
= t(:nameservers)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-4'}= t(:hostname)
|
||||||
|
%th{class: 'col-xs-4'}= t(:ipv4)
|
||||||
|
%th{class: 'col-xs-4'}= t(:ipv6)
|
||||||
|
%tbody
|
||||||
|
- @domain.nameservers.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= x
|
||||||
|
%td= x.ipv4
|
||||||
|
%td= x.ipv6
|
||||||
|
- if @domain.errors.messages[:nameservers]
|
||||||
|
%tfoot
|
||||||
|
- @domain.errors.messages[:nameservers].each do |x|
|
||||||
|
%tr
|
||||||
|
%td{colspan: 3}= x
|
||||||
|
|
19
app/views/registrant/domains/partials/_owner.haml
Normal file
19
app/views/registrant/domains/partials/_owner.haml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:registrant)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:name)
|
||||||
|
%dd= link_to(@domain.registrant, [:admin, @domain.registrant])
|
||||||
|
|
||||||
|
%dt= t(:id)
|
||||||
|
%dd= @domain.registrant_code
|
||||||
|
|
||||||
|
%dt= t(:identity_code)
|
||||||
|
%dd= @domain.registrant_ident
|
||||||
|
|
||||||
|
%dt= t(:email)
|
||||||
|
%dd= @domain.registrant_email
|
||||||
|
|
||||||
|
%dt= t(:phone)
|
||||||
|
%dd= @domain.registrant_phone
|
18
app/views/registrant/domains/partials/_statuses.haml
Normal file
18
app/views/registrant/domains/partials/_statuses.haml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#domain_statuses.panel.panel-default
|
||||||
|
.panel-heading.clearfix
|
||||||
|
= t(:statuses)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-6'}= t(:status)
|
||||||
|
%th{class: 'col-xs-6'}= t(:notes)
|
||||||
|
%tbody
|
||||||
|
- @domain.statuses.each do |status|
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
- if @domain.pending_json.present? && [DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE].include?(status)
|
||||||
|
= link_to status, admin_domain_domain_versions_path(@domain.id)
|
||||||
|
- else
|
||||||
|
= status
|
||||||
|
%td= @domain.status_notes[status]
|
22
app/views/registrant/domains/partials/_tech_contacts.haml
Normal file
22
app/views/registrant/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(:tech_contacts)
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-4'}= t(:name)
|
||||||
|
%th{class: 'col-xs-4'}= t(:id)
|
||||||
|
%th{class: 'col-xs-4'}= t(:email)
|
||||||
|
%tbody
|
||||||
|
- @domain.tech_contacts.each do |tc|
|
||||||
|
%tr
|
||||||
|
%td= link_to(tc, admin_contact_path(tc))
|
||||||
|
%td= tc.code
|
||||||
|
%td= tc.email
|
||||||
|
- if @domain.errors.messages[:tech_contacts]
|
||||||
|
%tfoot
|
||||||
|
- @domain.errors.messages[:tech_contacts].each do |x|
|
||||||
|
%tr
|
||||||
|
%td{colspan: 4}= x
|
19
app/views/registrant/domains/show.haml
Normal file
19
app/views/registrant/domains/show.haml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
- content_for :actions do
|
||||||
|
-#= link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, class: 'btn btn-primary')
|
||||||
|
|
||||||
|
= render 'shared/title', name: @domain.name
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6= render 'registrant/domains/partials/general'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/tech_contacts'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/admin_contacts'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/statuses'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/nameservers'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/dnskeys'
|
||||||
|
.row
|
||||||
|
.col-md-12= render 'registrant/domains/partials/keyrelays'
|
112
app/views/registrant/registrants/index.haml
Normal file
112
app/views/registrant/registrants/index.haml
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
= render 'shared/title', name: t(:contacts)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :name
|
||||||
|
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:id)
|
||||||
|
= f.search_field :code_eq, class: 'form-control', placeholder: t(:id)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:ident)
|
||||||
|
= f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:ident_type)
|
||||||
|
= select_tag '[q][ident_type_eq]', options_for_select(Contact::IDENT_TYPES, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:email)
|
||||||
|
= f.search_field :email_matches, class: 'form-control', placeholder: t(:email)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:country)
|
||||||
|
= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:is_registrant)
|
||||||
|
%div
|
||||||
|
= f.check_box :registrant_domains_id_not_null
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:contact_type)
|
||||||
|
= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:registrar)
|
||||||
|
= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:created_at_from)
|
||||||
|
= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_at_from)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:created_at_until)
|
||||||
|
= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_at_until)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label t(:updated_at)
|
||||||
|
= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control datepicker', placeholder: t(:updated_at)
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:status)
|
||||||
|
= select_tag :statuses_contains, options_for_select(Contact::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:results_per_page)
|
||||||
|
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||||
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
|
%button.btn.btn-default.js-reset-form
|
||||||
|
= t(:clear_fields)
|
||||||
|
%hr
|
||||||
|
.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', t(:name))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'code', t(:id))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'ident', t(:ident))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'email', t(:created_at))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'registrar_name', t(:registrar))
|
||||||
|
%tbody
|
||||||
|
- @contacts.each do |contact|
|
||||||
|
%tr
|
||||||
|
%td= link_to(contact, admin_contact_path(contact))
|
||||||
|
%td= contact.code
|
||||||
|
%td= ident_for(contact)
|
||||||
|
%td= l(contact.created_at, format: :short)
|
||||||
|
%td
|
||||||
|
- if contact.registrar
|
||||||
|
= link_to(contact.registrar, admin_registrar_path(contact.registrar))
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
= paginate @contacts
|
||||||
|
.col-md-6.text-right
|
||||||
|
.pagination
|
||||||
|
= t(:result_count, count: @contacts.total_count)
|
||||||
|
|
||||||
|
:coffee
|
||||||
|
$(".js-reset-form").on "click", (e) ->
|
||||||
|
e.preventDefault();
|
||||||
|
window.location = "#{admin_contacts_path}"
|
75
app/views/registrant/registrants/show.haml
Normal file
75
app/views/registrant/registrants/show.haml
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
= render 'shared/title', name: @contact.name
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:general)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:id)
|
||||||
|
%dd= @contact.code
|
||||||
|
|
||||||
|
%dt= t(:authinfo_pw)
|
||||||
|
%dd
|
||||||
|
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
|
%dt= t(:ident)
|
||||||
|
%dd= ident_for(@contact)
|
||||||
|
|
||||||
|
%dt= t(:email)
|
||||||
|
%dd= @contact.email
|
||||||
|
|
||||||
|
%dt= t(:phone)
|
||||||
|
%dd= @contact.phone
|
||||||
|
|
||||||
|
- if @contact.fax
|
||||||
|
%dt= t(:fax)
|
||||||
|
%dd= @contact.fax
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
|
%dt= t(:created)
|
||||||
|
%dd
|
||||||
|
= l(@contact.created_at, format: :short)
|
||||||
|
by
|
||||||
|
= creator_link(@contact)
|
||||||
|
|
||||||
|
%dt= t(:updated)
|
||||||
|
%dd
|
||||||
|
= l(@contact.updated_at, format: :short)
|
||||||
|
by
|
||||||
|
= updator_link(@contact)
|
||||||
|
|
||||||
|
%dt= t(:registrar)
|
||||||
|
%dd
|
||||||
|
- if @contact.registrar.present?
|
||||||
|
= link_to(@contact.registrar, registrant_registrar_path(@contact.registrar)) if @contact.registrar
|
||||||
|
|
||||||
|
.col-md-6
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:contact)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dl.dl-horizontal
|
||||||
|
- if @contact.org_name.present?
|
||||||
|
%dt= t(:org_name)
|
||||||
|
%dd= @contact.org_name
|
||||||
|
|
||||||
|
%dt= t(:street)
|
||||||
|
%dd= @contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||||
|
|
||||||
|
%dt= t(:city)
|
||||||
|
%dd= @contact.city
|
||||||
|
|
||||||
|
%dt= t(:zip)
|
||||||
|
%dd= @contact.zip
|
||||||
|
|
||||||
|
%dt= t(:state)
|
||||||
|
%dd= @contact.state
|
||||||
|
|
||||||
|
%dt= t(:country)
|
||||||
|
%dd= @contact.country
|
22
app/views/registrant/registrars/index.haml
Normal file
22
app/views/registrant/registrars/index.haml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
- content_for :actions do
|
||||||
|
= link_to(t(:new), new_admin_registrar_path, class: 'btn btn-primary')
|
||||||
|
= render 'shared/title', name: t(:registrars)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-6'}
|
||||||
|
= sort_link(@q, 'name')
|
||||||
|
%th{class: 'col-xs-6'}
|
||||||
|
= sort_link(@q, 'reg_no', t(:reg_no))
|
||||||
|
%tbody
|
||||||
|
- @registrars.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= link_to(x, [:admin, x])
|
||||||
|
%td= x.reg_no
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= paginate @registrars
|
53
app/views/registrant/registrars/show.haml
Normal file
53
app/views/registrant/registrars/show.haml
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
= render 'shared/title', name: @registrar.name
|
||||||
|
|
||||||
|
- if @registrar.errors.any?
|
||||||
|
- @registrar.errors.each do |attr, err|
|
||||||
|
= err
|
||||||
|
%br
|
||||||
|
- if @registrar.errors.any?
|
||||||
|
%hr
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:general)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:name)
|
||||||
|
%dd= @registrar.name
|
||||||
|
|
||||||
|
%dt= t(:reg_no)
|
||||||
|
%dd= @registrar.reg_no
|
||||||
|
|
||||||
|
%dt= t(:vat_no)
|
||||||
|
%dd= @registrar.vat_no
|
||||||
|
|
||||||
|
%dt= t(:reference_no)
|
||||||
|
%dd= @registrar.reference_no
|
||||||
|
|
||||||
|
%dt= t(:id)
|
||||||
|
%dd= @registrar.code
|
||||||
|
|
||||||
|
.col-md-6
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:contact)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:country)
|
||||||
|
%dd= @registrar.country
|
||||||
|
|
||||||
|
%dt= t(:address)
|
||||||
|
%dd= @registrar.address
|
||||||
|
|
||||||
|
%dt= t(:contact_phone)
|
||||||
|
%dd= @registrar.phone
|
||||||
|
|
||||||
|
%dt= t(:contact_email)
|
||||||
|
%dd= @registrar.email
|
||||||
|
|
||||||
|
%dt= t(:billing_address)
|
||||||
|
%dd= @registrar.billing_address
|
||||||
|
|
||||||
|
%dt= t(:billing_email)
|
||||||
|
%dd= @registrar.billing_email
|
|
@ -17,5 +17,5 @@
|
||||||
%span.glyphicon.glyphicon-search
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
- if @results
|
- if @domain
|
||||||
= @results
|
%pre= @domain.body
|
|
@ -7,6 +7,8 @@ require 'action_controller/railtie'
|
||||||
require 'action_mailer/railtie'
|
require 'action_mailer/railtie'
|
||||||
require 'action_view/railtie'
|
require 'action_view/railtie'
|
||||||
require 'sprockets/railtie'
|
require 'sprockets/railtie'
|
||||||
|
require 'csv'
|
||||||
|
require 'rails/all'
|
||||||
# require "rails/test_unit/railtie"
|
# require "rails/test_unit/railtie"
|
||||||
|
|
||||||
# Require the gems listed in Gemfile, including any gems
|
# Require the gems listed in Gemfile, including any gems
|
||||||
|
|
|
@ -102,6 +102,12 @@ Rails.application.routes.draw do
|
||||||
namespace :registrant do
|
namespace :registrant do
|
||||||
root 'domains#index'
|
root 'domains#index'
|
||||||
|
|
||||||
|
resources :domains do
|
||||||
|
collection do
|
||||||
|
get :download_list
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# resources :invoices do
|
# resources :invoices do
|
||||||
# member do
|
# member do
|
||||||
# get 'download_pdf'
|
# get 'download_pdf'
|
||||||
|
@ -140,6 +146,16 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :registrars do
|
||||||
|
resources :api_users
|
||||||
|
resources :white_ips
|
||||||
|
collection do
|
||||||
|
get :search
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
resources :registrants
|
||||||
|
|
||||||
resources :whois
|
resources :whois
|
||||||
# resources :contacts do
|
# resources :contacts do
|
||||||
# member do
|
# member do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue