mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Revert "Registry 663"
This commit is contained in:
parent
7ed42b6e82
commit
1690f49575
26 changed files with 165 additions and 308 deletions
1
.reek
1
.reek
|
@ -246,6 +246,7 @@ DuplicateMethodCall:
|
||||||
- Billing::Price#self.effective
|
- Billing::Price#self.effective
|
||||||
- Billing::Price#self.valid
|
- Billing::Price#self.valid
|
||||||
- BusinessRegistryCache#fetch_by_ident_and_cc
|
- BusinessRegistryCache#fetch_by_ident_and_cc
|
||||||
|
- BusinessRegistryCache#purge
|
||||||
- Certificate#parse_metadata
|
- Certificate#parse_metadata
|
||||||
- Certificate#reload_apache
|
- Certificate#reload_apache
|
||||||
- Certificate#revoke!
|
- Certificate#revoke!
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
#= require jquery
|
#= require jquery
|
||||||
#= require jquery_ujs
|
#= require jquery_ujs
|
||||||
|
#= require jquery.validate
|
||||||
|
#= require jquery.validate.additional-methods
|
||||||
|
#= require turbolinks
|
||||||
#= require bootstrap-sprockets
|
#= require bootstrap-sprockets
|
||||||
|
#= require jquery.nested_attributes
|
||||||
|
#= require shared/jquery.validate.bootstrap
|
||||||
#= require jquery-ui/datepicker
|
#= require jquery-ui/datepicker
|
||||||
#= require select2
|
#= require select2
|
||||||
#= require datepicker
|
#= require datepicker
|
||||||
#= require shared/general
|
#= require shared/general
|
||||||
|
#= require registrar/application
|
||||||
|
|
|
@ -5,7 +5,3 @@ input[type=number]::-webkit-inner-spin-button {
|
||||||
input[type=number] {
|
input[type=number] {
|
||||||
-moz-appearance: textfield;
|
-moz-appearance: textfield;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-form .actions {
|
|
||||||
padding-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
//= require 'select2-bootstrap'
|
//= require 'select2-bootstrap'
|
||||||
@import shared/fonts
|
@import shared/fonts
|
||||||
@import shared/general
|
@import shared/general
|
||||||
@import forms
|
|
||||||
@import nprogress
|
@import nprogress
|
||||||
@import nprogress-bootstrap
|
@import nprogress-bootstrap
|
||||||
@import typeaheadjs
|
@import typeaheadjs
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
class Registrant::DomainsController < RegistrantController
|
class Registrant::DomainsController < RegistrantController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize! :view, :registrant_domains
|
authorize! :view, :registrant_domains
|
||||||
params[:q] ||= {}
|
params[:q] ||= {}
|
||||||
normalize_search_parameters do
|
normalize_search_parameters do
|
||||||
@q = domains.search(params[:q])
|
@q = domains.search(params[:q])
|
||||||
@domains = @q.result.page(params[:page])
|
@domains = @q.result.page(params[:page])
|
||||||
end
|
end
|
||||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -14,15 +15,19 @@ class Registrant::DomainsController < RegistrantController
|
||||||
authorize! :read, @domain
|
authorize! :read, @domain
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_domain
|
||||||
|
@domain = domains.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
def domain_verification_url
|
def domain_verification_url
|
||||||
authorize! :view, :registrant_domains
|
authorize! :view, :registrant_domains
|
||||||
dom = domains.find(params[:id])
|
dom = domains.find(params[:id])
|
||||||
if (dom.statuses.include?(DomainStatus::PENDING_UPDATE) || dom.statuses.include?(DomainStatus::PENDING_DELETE_CONFIRMATION)) &&
|
if (dom.statuses.include?(DomainStatus::PENDING_UPDATE) || dom.statuses.include?(DomainStatus::PENDING_DELETE_CONFIRMATION)) &&
|
||||||
dom.pending_json.present?
|
dom.pending_json.present?
|
||||||
|
|
||||||
@domain = dom
|
@domain = dom
|
||||||
confirm_path = get_confirm_path(dom.statuses)
|
confirm_path = get_confirm_path(dom.statuses)
|
||||||
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
||||||
|
|
||||||
else
|
else
|
||||||
flash[:warning] = I18n.t('available_verification_url_not_found')
|
flash[:warning] = I18n.t('available_verification_url_not_found')
|
||||||
|
@ -47,12 +52,6 @@ class Registrant::DomainsController < RegistrantController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_domain
|
|
||||||
@domain = domains.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def domains
|
def domains
|
||||||
ident_cc, ident = @current_user.registrant_ident.split '-'
|
ident_cc, ident = @current_user.registrant_ident.split '-'
|
||||||
begin
|
begin
|
||||||
|
@ -83,4 +82,5 @@ class Registrant::DomainsController < RegistrantController
|
||||||
"#{ENV['registrant_url']}/registrant/domain_delete_confirms"
|
"#{ENV['registrant_url']}/registrant/domain_delete_confirms"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -31,6 +31,12 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
client = Digidoc::Client.new(endpoint)
|
client = Digidoc::Client.new(endpoint)
|
||||||
client.logger = Rails.application.config.logger unless Rails.env.test?
|
client.logger = Rails.application.config.logger unless Rails.env.test?
|
||||||
|
|
||||||
|
if Rails.env.test? && phone == "123"
|
||||||
|
@user = ApiUser.find_by(identity_code: "14212128025")
|
||||||
|
sign_in(@user, event: :authentication)
|
||||||
|
return redirect_to registrant_root_url
|
||||||
|
end
|
||||||
|
|
||||||
# country_codes = {'+372' => 'EST'}
|
# country_codes = {'+372' => 'EST'}
|
||||||
response = client.authenticate(
|
response = client.authenticate(
|
||||||
phone: "+372#{phone}",
|
phone: "+372#{phone}",
|
||||||
|
|
|
@ -19,17 +19,24 @@ authentication using electronic ID. Association through a business organisation
|
||||||
=end
|
=end
|
||||||
|
|
||||||
class BusinessRegistryCache < ActiveRecord::Base
|
class BusinessRegistryCache < ActiveRecord::Base
|
||||||
def associated_domain_ids
|
|
||||||
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: ident_country_code).pluck(:id)
|
# 1. load domains by business
|
||||||
|
# 2. load domains by person
|
||||||
|
def associated_contacts
|
||||||
|
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: 'EE').pluck(:id)
|
||||||
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
||||||
|
contact_ids
|
||||||
|
end
|
||||||
|
|
||||||
|
def associated_domain_ids
|
||||||
domain_ids = []
|
domain_ids = []
|
||||||
|
|
||||||
|
contact_ids = associated_contacts
|
||||||
|
|
||||||
unless contact_ids.blank?
|
unless contact_ids.blank?
|
||||||
domain_ids = DomainContact.distinct.where(contact_id: contact_ids).pluck(:domain_id)
|
domain_ids = DomainContact.distinct.where(contact_id: contact_ids).pluck(:domain_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
domain_ids += Domain.where(registrant_id: contact_ids).pluck(:id)
|
|
||||||
|
|
||||||
domain_ids
|
domain_ids
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,5 +69,15 @@ class BusinessRegistryCache < ActiveRecord::Base
|
||||||
def business_registry
|
def business_registry
|
||||||
Soap::Arireg.new
|
Soap::Arireg.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def purge
|
||||||
|
STDOUT << "#{Time.zone.now.utc} - Starting Purge of old BusinessRegistry data from cache\n" unless Rails.env.test?
|
||||||
|
purged = 0
|
||||||
|
BusinessRegistryCache.where('retrieved_on < ?',
|
||||||
|
Time.zone.now < Setting.days_to_keep_business_registry_cache.days).each do |br|
|
||||||
|
br.destroy and purged += 1
|
||||||
|
end
|
||||||
|
STDOUT << "#{Time.zone.now.utc} - Finished purging #{purged} old BusinessRegistry cache items\n" unless Rails.env.test?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,14 +2,17 @@
|
||||||
%html{lang: I18n.locale.to_s}
|
%html{lang: I18n.locale.to_s}
|
||||||
%head
|
%head
|
||||||
%meta{charset: "utf-8"}/
|
%meta{charset: "utf-8"}/
|
||||||
|
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
||||||
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
||||||
|
%meta{content: "Full stack top-level domain (TLD) management.", name: "description"}/
|
||||||
|
%meta{content: "Gitlab LTD", name: "author"}/
|
||||||
- if content_for? :head_title
|
- if content_for? :head_title
|
||||||
= yield :head_title
|
= yield :head_title
|
||||||
- else
|
- else
|
||||||
%title= t(:registrant_head_title)
|
%title= t(:registrant_head_title)
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= stylesheet_link_tag 'registrant-manifest', media: 'all'
|
= stylesheet_link_tag 'registrant-manifest', media: 'all', 'data-turbolinks-track' => true
|
||||||
= javascript_include_tag 'registrant-manifest'
|
= javascript_include_tag 'registrant-manifest', 'data-turbolinks-track' => true
|
||||||
= favicon_link_tag 'favicon.ico'
|
= favicon_link_tag 'favicon.ico'
|
||||||
%body
|
%body
|
||||||
/ Fixed navbar
|
/ Fixed navbar
|
||||||
|
@ -46,7 +49,7 @@
|
||||||
|
|
||||||
%footer.footer
|
%footer.footer
|
||||||
.container
|
.container
|
||||||
.row
|
%row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= image_tag 'eis-logo-et.png'
|
= image_tag 'eis-logo-et.png'
|
||||||
.col-md-6.text-right
|
.col-md-6.text-right
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
<tr>
|
|
||||||
<td><%= link_to domain, registrant_domain_path(domain) %></td>
|
|
||||||
<td><%= link_to domain.registrant.name, registrant_contact_path(domain.registrant) %></td>
|
|
||||||
<td><%= l domain.expire_time %></td>
|
|
||||||
<td><%= link_to domain.registrar, registrant_registrar_path(domain.registrar) %></td>
|
|
||||||
</tr>
|
|
84
app/views/registrant/domains/index.haml
Normal file
84
app/views/registrant/domains/index.haml
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
= 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 js-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 js-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
|
||||||
|
.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, 'registrant_name', t('.registrant'))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'valid_to', t(:valid_to))
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= sort_link(@q, 'registrar_name', t(:registrar_name))
|
||||||
|
%tbody
|
||||||
|
- @domains.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= link_to(x, registrant_domain_path(x))
|
||||||
|
%td= link_to(x.registrant.name, registrant_contact_path(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}"
|
||||||
|
|
|
@ -1,111 +0,0 @@
|
||||||
<div class="page-header">
|
|
||||||
<h1><%= t '.header' %></h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= search_form_for [:registrant, @q], html: { class: 'search-form', autocomplete: 'off' } do |f| %>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label :name, for: nil %>
|
|
||||||
<%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label t(:registrant_ident), for: nil %>
|
|
||||||
<%= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label t(:valid_to_from), for: nil %>
|
|
||||||
<%= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<%= f.label t(:valid_to_until), for: nil %>
|
|
||||||
<%= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="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) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-3 actions">
|
|
||||||
<button class="btn btn-primary">
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-search"></span>
|
|
||||||
|
|
||||||
</button>
|
|
||||||
<%= link_to(t('.reset_btn'), registrant_domains_path, class: 'btn btn-default') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
<button aria-expanded="false" aria-haspopup="true" class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
|
|
||||||
Download
|
|
||||||
<span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<%= link_to 'PDF', download_list_registrant_domains_path(q: params[:q], format: "pdf") %>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<%= link_to 'CSV', download_list_registrant_domains_path(q: params[:q], format: "csv") %>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3"></div>
|
|
||||||
<div class="col-md-3"></div>
|
|
||||||
<div class="col-md-3"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr/>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover table-bordered table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= sort_link(@q, 'name') %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= sort_link(@q, 'registrant_name', t('.registrant')) %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= sort_link(@q, 'valid_to', t(:valid_to)) %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= sort_link(@q, 'registrar_name', t(:registrar_name)) %>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<%= render @domains %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<%= paginate @domains %>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 text-right">
|
|
||||||
<div class="pagination">
|
|
||||||
<%= t(:result_count, count: @domains.total_count) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
17
app/views/registrant/domains/show.haml
Normal file
17
app/views/registrant/domains/show.haml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
= render 'shared/title', name: @domain.name
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6= render 'registrant/domains/partials/general'
|
||||||
|
.col-md-6= render 'registrant/domains/partials/owner'
|
||||||
|
.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'
|
|
@ -1,46 +0,0 @@
|
||||||
<%= render 'shared/title', name: @domain.name %>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<%= render 'registrant/domains/partials/general' %>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<%= render 'registrant/domains/partials/owner' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/tech_contacts' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/admin_contacts' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/statuses' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/nameservers' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/dnskeys' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<%= render 'registrant/domains/partials/keyrelays' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -2,9 +2,7 @@ en:
|
||||||
registrant:
|
registrant:
|
||||||
domains:
|
domains:
|
||||||
index:
|
index:
|
||||||
header: Domains
|
|
||||||
registrant: Registrant
|
registrant: Registrant
|
||||||
reset_btn: Reset
|
|
||||||
|
|
||||||
download_list:
|
download_list:
|
||||||
registrant: Registrant
|
registrant: Registrant
|
||||||
|
|
|
@ -99,7 +99,7 @@ Rails.application.routes.draw do
|
||||||
namespace :registrant do
|
namespace :registrant do
|
||||||
root 'domains#index'
|
root 'domains#index'
|
||||||
|
|
||||||
resources :domains, only: %i[index show] do
|
resources :domains do
|
||||||
collection do
|
collection do
|
||||||
get :download_list
|
get :download_list
|
||||||
end
|
end
|
||||||
|
@ -107,6 +107,7 @@ Rails.application.routes.draw do
|
||||||
member do
|
member do
|
||||||
get 'domain_verification_url'
|
get 'domain_verification_url'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# resources :invoices do
|
# resources :invoices do
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
class RemoveDomainContactsContactType < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
remove_column :domain_contacts, :contact_type, :string
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,5 +0,0 @@
|
||||||
class AddDomainContactsContactIdFk < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
add_foreign_key :domain_contacts, :contacts, name: 'domain_contacts_contact_id_fk'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,5 +0,0 @@
|
||||||
class AddDomainContactsDomainIdFk < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
add_foreign_key :domain_contacts, :domains, name: 'domain_contacts_domain_id_fk'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -884,6 +884,7 @@ CREATE TABLE domain_contacts (
|
||||||
id integer NOT NULL,
|
id integer NOT NULL,
|
||||||
contact_id integer,
|
contact_id integer,
|
||||||
domain_id integer,
|
domain_id integer,
|
||||||
|
contact_type character varying,
|
||||||
created_at timestamp without time zone,
|
created_at timestamp without time zone,
|
||||||
updated_at timestamp without time zone,
|
updated_at timestamp without time zone,
|
||||||
contact_code_cache character varying,
|
contact_code_cache character varying,
|
||||||
|
@ -4473,22 +4474,6 @@ ALTER TABLE ONLY contacts
|
||||||
ADD CONSTRAINT contacts_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES registrars(id);
|
ADD CONSTRAINT contacts_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES registrars(id);
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain_contacts
|
|
||||||
ADD CONSTRAINT domain_contacts_contact_id_fk FOREIGN KEY (contact_id) REFERENCES contacts(id);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain_contacts
|
|
||||||
ADD CONSTRAINT domain_contacts_domain_id_fk FOREIGN KEY (domain_id) REFERENCES domains(id);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
-- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -5075,9 +5060,3 @@ INSERT INTO schema_migrations (version) VALUES ('20171121233843');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20171123035941');
|
INSERT INTO schema_migrations (version) VALUES ('20171123035941');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180112080312');
|
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180112084221');
|
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180112084442');
|
|
||||||
|
|
||||||
|
|
|
@ -812,6 +812,7 @@
|
||||||
<text text-anchor="start" x="1969" y="-1338.8" font-family="Times,serif" font-size="14.00">id :integer</text>
|
<text text-anchor="start" x="1969" y="-1338.8" font-family="Times,serif" font-size="14.00">id :integer</text>
|
||||||
<text text-anchor="start" x="1969" y="-1323.8" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
<text text-anchor="start" x="1969" y="-1323.8" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
||||||
<text text-anchor="start" x="1969" y="-1308.8" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
<text text-anchor="start" x="1969" y="-1308.8" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
||||||
|
<text text-anchor="start" x="1969" y="-1293.8" font-family="Times,serif" font-size="14.00">contact_type :string</text>
|
||||||
<text text-anchor="start" x="1969" y="-1278.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
<text text-anchor="start" x="1969" y="-1278.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
||||||
<text text-anchor="start" x="1969" y="-1263.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
<text text-anchor="start" x="1969" y="-1263.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
||||||
<text text-anchor="start" x="1969" y="-1248.8" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
<text text-anchor="start" x="1969" y="-1248.8" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
||||||
|
@ -1065,6 +1066,7 @@
|
||||||
<text text-anchor="start" x="1832" y="-661.3" font-family="Times,serif" font-size="14.00">id :integer</text>
|
<text text-anchor="start" x="1832" y="-661.3" font-family="Times,serif" font-size="14.00">id :integer</text>
|
||||||
<text text-anchor="start" x="1832" y="-646.3" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
<text text-anchor="start" x="1832" y="-646.3" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
||||||
<text text-anchor="start" x="1832" y="-631.3" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
<text text-anchor="start" x="1832" y="-631.3" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
||||||
|
<text text-anchor="start" x="1832" y="-616.3" font-family="Times,serif" font-size="14.00">contact_type :string</text>
|
||||||
<text text-anchor="start" x="1832" y="-601.3" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
<text text-anchor="start" x="1832" y="-601.3" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
||||||
<text text-anchor="start" x="1832" y="-586.3" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
<text text-anchor="start" x="1832" y="-586.3" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
||||||
<text text-anchor="start" x="1832" y="-571.3" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
<text text-anchor="start" x="1832" y="-571.3" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
||||||
|
@ -1343,6 +1345,7 @@
|
||||||
<text text-anchor="start" x="2151" y="-1338.8" font-family="Times,serif" font-size="14.00">id :integer</text>
|
<text text-anchor="start" x="2151" y="-1338.8" font-family="Times,serif" font-size="14.00">id :integer</text>
|
||||||
<text text-anchor="start" x="2151" y="-1323.8" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
<text text-anchor="start" x="2151" y="-1323.8" font-family="Times,serif" font-size="14.00">contact_id :integer</text>
|
||||||
<text text-anchor="start" x="2151" y="-1308.8" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
<text text-anchor="start" x="2151" y="-1308.8" font-family="Times,serif" font-size="14.00">domain_id :integer</text>
|
||||||
|
<text text-anchor="start" x="2151" y="-1293.8" font-family="Times,serif" font-size="14.00">contact_type :string</text>
|
||||||
<text text-anchor="start" x="2151" y="-1278.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
<text text-anchor="start" x="2151" y="-1278.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
||||||
<text text-anchor="start" x="2151" y="-1263.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
<text text-anchor="start" x="2151" y="-1263.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
||||||
<text text-anchor="start" x="2151" y="-1248.8" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
<text text-anchor="start" x="2151" y="-1248.8" font-family="Times,serif" font-size="14.00">contact_code_cache :string</text>
|
||||||
|
|
Before Width: | Height: | Size: 231 KiB After Width: | Height: | Size: 232 KiB |
8
test/fixtures/business_registry_caches.yml
vendored
8
test/fixtures/business_registry_caches.yml
vendored
|
@ -1,8 +0,0 @@
|
||||||
first:
|
|
||||||
ident: 1234
|
|
||||||
ident_country_code: US
|
|
||||||
associated_businesses:
|
|
||||||
- 1234
|
|
||||||
retrieved_on: 2010-07-05 10:30
|
|
||||||
created_at: 2010-07-05 10:30
|
|
||||||
updated_at: 2010-07-05 10:30
|
|
20
test/fixtures/contacts.yml
vendored
20
test/fixtures/contacts.yml
vendored
|
@ -1,20 +0,0 @@
|
||||||
john:
|
|
||||||
name: John
|
|
||||||
ident: 1234
|
|
||||||
ident_type: priv
|
|
||||||
ident_country_code: US
|
|
||||||
registrar: acme
|
|
||||||
|
|
||||||
jane:
|
|
||||||
name: Jane
|
|
||||||
ident: 1234
|
|
||||||
ident_type: priv
|
|
||||||
ident_country_code: US
|
|
||||||
registrar: acme
|
|
||||||
|
|
||||||
acme_ltd:
|
|
||||||
name: Acme Ltd.
|
|
||||||
ident: 1234
|
|
||||||
ident_type: org
|
|
||||||
registrar: acme
|
|
||||||
ident_country_code: US
|
|
4
test/fixtures/domain_contacts.yml
vendored
4
test/fixtures/domain_contacts.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
two_jane:
|
|
||||||
domain: two
|
|
||||||
contact: jane
|
|
||||||
type: AdminDomainContact
|
|
14
test/fixtures/domains.yml
vendored
14
test/fixtures/domains.yml
vendored
|
@ -1,14 +0,0 @@
|
||||||
one:
|
|
||||||
name: one.test
|
|
||||||
registrar: valid
|
|
||||||
registrant: john
|
|
||||||
|
|
||||||
two:
|
|
||||||
name: two.test
|
|
||||||
registrar: valid
|
|
||||||
registrant: john
|
|
||||||
|
|
||||||
three:
|
|
||||||
name: three.test
|
|
||||||
registrar: valid
|
|
||||||
registrant: acme_ltd
|
|
4
test/fixtures/users.yml
vendored
4
test/fixtures/users.yml
vendored
|
@ -14,7 +14,3 @@ admin:
|
||||||
country_code: US
|
country_code: US
|
||||||
roles:
|
roles:
|
||||||
- admin
|
- admin
|
||||||
|
|
||||||
registrant:
|
|
||||||
type: RegistrantUser
|
|
||||||
registrant_ident: US-1234
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
require 'test_helper'
|
|
||||||
|
|
||||||
class DomainsTest < ActionDispatch::IntegrationTest
|
|
||||||
def setup
|
|
||||||
login_as users(:registrant)
|
|
||||||
|
|
||||||
Setting.days_to_keep_business_registry_cache = 1
|
|
||||||
travel_to Time.zone.parse('2010-07-05')
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_shows_domains_where_current_user_is_registrant
|
|
||||||
visit registrant_domains_url
|
|
||||||
assert_text 'one.test'
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_shows_domains_where_current_user_is_contact_person
|
|
||||||
visit registrant_domains_url
|
|
||||||
assert_text 'two.test'
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_shows_domains_where_current_user_has_associated_organizations
|
|
||||||
visit registrant_domains_url
|
|
||||||
assert_text 'three.test'
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Add table
Add a link
Reference in a new issue