mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Merge branch 'master' into registry-791
# Conflicts: # db/structure.sql
This commit is contained in:
commit
106592e53e
58 changed files with 991 additions and 1005 deletions
|
@ -29,7 +29,7 @@ module Repp
|
|||
}
|
||||
|
||||
begin
|
||||
current_user.registrar.replace_nameservers(hostname, new_attributes)
|
||||
affected_domains = current_user.registrar.replace_nameservers(hostname, new_attributes)
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
error!({ errors: e.record.errors.full_messages.map { |error| { title: error } } }, 400)
|
||||
end
|
||||
|
@ -37,7 +37,8 @@ module Repp
|
|||
status 200
|
||||
@response = { data: { type: 'nameserver',
|
||||
id: params[:data][:attributes][:hostname],
|
||||
attributes: params[:data][:attributes] } }
|
||||
attributes: params[:data][:attributes] },
|
||||
affected_domains: affected_domains }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,10 +52,5 @@ body > .container
|
|||
.text-grey
|
||||
color: grey
|
||||
|
||||
.partially-hidden
|
||||
border: 1px solid #dddddd
|
||||
padding-left: 4px
|
||||
padding-right: 4px
|
||||
|
||||
.disabled-value
|
||||
padding-top: 8px
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
class Registrant::ContactsController < RegistrantController
|
||||
helper_method :domain_ids
|
||||
|
||||
def show
|
||||
@contact = Contact.where(id: contacts).find_by(id: params[:id])
|
||||
@contact = Contact.where(id: contacts).find_by(id: params[:id])
|
||||
@current_user = current_user
|
||||
|
||||
authorize! :read, @contact
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def contacts
|
||||
begin
|
||||
DomainContact.where(domain_id: domain_ids).pluck(:contact_id) | Domain.where(id: domain_ids).pluck(:registrant_id)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class Registrant::DomainUpdateConfirmsController < RegistrantController
|
||||
skip_before_action :authenticate_user!, only: [:show, :update]
|
||||
skip_authorization_check only: [:show, :update]
|
||||
skip_before_action :authenticate_user!, only: %i[show update]
|
||||
skip_authorization_check only: %i[show update]
|
||||
|
||||
def show
|
||||
return if params[:confirmed] || params[:rejected]
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
class Registrant::RegistrarsController < RegistrantController
|
||||
|
||||
def show
|
||||
@registrar = Registrar.find(params[:id])
|
||||
authorize! :read, @registrar
|
||||
end
|
||||
end
|
||||
end
|
|
@ -44,7 +44,10 @@ class Registrar
|
|||
parsed_response = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
if response.code == '200'
|
||||
flash[:notice] = t '.replaced'
|
||||
notices = [t('.replaced')]
|
||||
notices << "#{t('.affected_domains')}: #{parsed_response[:affected_domains].join(', ')}"
|
||||
|
||||
flash[:notice] = notices
|
||||
redirect_to registrar_domains_url
|
||||
else
|
||||
@api_errors = parsed_response[:errors]
|
||||
|
|
|
@ -91,7 +91,7 @@ class Registrar
|
|||
@user = find_user_by_idc_and_allowed(response.user_id_code)
|
||||
else
|
||||
@user = find_user_by_idc(response.user_id_code)
|
||||
end
|
||||
end
|
||||
|
||||
if @user.persisted?
|
||||
session[:user_id_code] = response.user_id_code
|
||||
|
|
|
@ -23,7 +23,9 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
registrant: domain.registrant).deliver_now
|
||||
|
||||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||
domain.clean_pendings_lowlevel
|
||||
|
||||
domain.preclean_pendings
|
||||
domain.clean_pendings!
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
|
|
|
@ -45,18 +45,4 @@ class DomainMailer < ApplicationMailer
|
|||
subject: "#{I18n.t(:delete_confirmation_subject,
|
||||
name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
||||
private
|
||||
# app/models/DomainMailModel provides the data for mail that can be composed_from
|
||||
# which ensures that values of objects are captured when they are valid, not later when this method is executed
|
||||
def compose_from(params)
|
||||
@params = params
|
||||
return if delivery_off?(params, params[:deliver_emails])
|
||||
return if whitelist_blocked?(params[:recipient])
|
||||
params[:errors].map do |error|
|
||||
logger.warn error
|
||||
return
|
||||
end
|
||||
mail(to: params[:recipient], subject: params[:subject])
|
||||
end
|
||||
end
|
||||
end
|
|
@ -447,31 +447,6 @@ class Contact < ActiveRecord::Base
|
|||
domains
|
||||
end
|
||||
|
||||
def all_registrant_domains(page: nil, per: nil, params: {}, registrant: nil)
|
||||
|
||||
if registrant
|
||||
sorts = params.fetch(:sort, {}).first || []
|
||||
sort = Domain.column_names.include?(sorts.first) ? sorts.first : "valid_to"
|
||||
order = {"asc"=>"desc", "desc"=>"asc"}[sorts.second] || "desc"
|
||||
|
||||
domain_ids = DomainContact.distinct.where(contact_id: registrant.id).pluck(:domain_id)
|
||||
|
||||
domains = Domain.where(id: domain_ids).includes(:registrar).page(page).per(per)
|
||||
if sorts.first == "registrar_name".freeze
|
||||
domains = domains.includes(:registrar).where.not(registrars: {id: nil}).order("registrars.name #{order} NULLS LAST")
|
||||
else
|
||||
domains = domains.order("#{sort} #{order} NULLS LAST")
|
||||
end
|
||||
|
||||
domain_c = Hash.new([])
|
||||
registrant_domains.where(id: domains.map(&:id)).each{|d| domain_c[d.id] |= ["Registrant".freeze] }
|
||||
DomainContact.where(contact_id: id, domain_id: domains.map(&:id)).each{|d| domain_c[d.domain_id] |= [d.type] }
|
||||
domains.each{|d| d.roles = domain_c[d.id].uniq}
|
||||
domains
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def update_prohibited?
|
||||
(statuses & [
|
||||
CLIENT_UPDATE_PROHIBITED,
|
||||
|
|
|
@ -26,7 +26,7 @@ class Directo < ActiveRecord::Base
|
|||
xml.invoice(
|
||||
"SalesAgent" => Setting.directo_sales_agent,
|
||||
"Number" => num,
|
||||
"InvoiceDate" => invoice.created_at.strftime("%Y-%m-%dT%H:%M:%S"),
|
||||
"InvoiceDate" => invoice.created_at.strftime("%Y-%m-%d"),
|
||||
"PaymentTerm" => Setting.directo_receipt_payment_term,
|
||||
"Currency" => invoice.currency,
|
||||
"CustomerCode"=> invoice.buyer.accounting_customer_code
|
||||
|
|
|
@ -294,36 +294,6 @@ class Domain < ActiveRecord::Base
|
|||
save
|
||||
end
|
||||
|
||||
|
||||
# state changes may be done low-level - no validation
|
||||
# in this metod we still save PaperTrail log.
|
||||
def clean_pendings_lowlevel
|
||||
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
|
||||
status_notes[DomainStatus::PENDING_UPDATE] = ''
|
||||
status_notes[DomainStatus::PENDING_DELETE] = ''
|
||||
|
||||
hash = {
|
||||
registrant_verification_token: nil,
|
||||
registrant_verification_asked_at: nil,
|
||||
pending_json: {},
|
||||
status_notes: status_notes,
|
||||
statuses: statuses.presence || [DomainStatus::OK],
|
||||
# need this column in order to update PaperTrail version properly
|
||||
updated_at: Time.now.utc
|
||||
}
|
||||
|
||||
# PaperTrail
|
||||
self.attributes = hash
|
||||
record_update
|
||||
clear_version_instance!
|
||||
reset_transaction_id
|
||||
|
||||
update_columns(hash)
|
||||
end
|
||||
|
||||
def pending_update!
|
||||
return true if pending_update?
|
||||
self.epp_pending_update = true # for epp
|
||||
|
@ -581,10 +551,6 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def send_mail(action)
|
||||
DomainMailer.send(action, DomainMailModel.new(self).send(action)).deliver
|
||||
end
|
||||
|
||||
def admin_contact_names
|
||||
admin_contacts.names
|
||||
end
|
||||
|
|
|
@ -21,7 +21,10 @@ class DomainCron
|
|||
if domain.pending_delete? || domain.pending_delete_confirmation?
|
||||
DomainMailer.pending_delete_expired_notification(domain.id, true).deliver
|
||||
end
|
||||
domain.clean_pendings_lowlevel
|
||||
|
||||
domain.preclean_pendings
|
||||
domain.clean_pendings!
|
||||
|
||||
unless Rails.env.test?
|
||||
STDOUT << "#{Time.zone.now.utc} DomainCron.clean_expired_pendings: ##{domain.id} (#{domain.name})\n"
|
||||
end
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
class DomainMailModel
|
||||
# Capture current values used in app/views/mailers/domain_mailer/* and app/mailers/domain_mailer will send later
|
||||
|
||||
def initialize(domain)
|
||||
@domain = domain
|
||||
@params = {errors: [], deliver_emails: domain.deliver_emails, id: domain.id}
|
||||
end
|
||||
|
||||
def pending_delete_rejected_notification
|
||||
registrant
|
||||
subject(:pending_delete_rejected_notification_subject)
|
||||
compose
|
||||
end
|
||||
|
||||
def pending_delete_expired_notification
|
||||
registrant
|
||||
subject(:pending_delete_expired_notification_subject)
|
||||
compose
|
||||
end
|
||||
|
||||
def delete_confirmation
|
||||
registrant
|
||||
subject(:delete_confirmation_subject)
|
||||
compose
|
||||
end
|
||||
|
||||
def force_delete
|
||||
admins
|
||||
subject(:force_delete_subject)
|
||||
compose
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def registrant_old
|
||||
@params[:recipient] = format Registrant.find(@domain.registrant_id_was).email
|
||||
end
|
||||
|
||||
def registrant
|
||||
@params[:recipient] = format @domain.registrant.email
|
||||
end
|
||||
|
||||
def registrant_pending
|
||||
@params[:recipient] = format @domain.pending_json['new_registrant_email']
|
||||
@params[:new_registrant_name] = @domain.pending_json['new_registrant_name']
|
||||
@params[:old_registrant_name] = @domain.registrant.name
|
||||
end
|
||||
|
||||
# registrant and domain admin contacts
|
||||
def admins
|
||||
emails = ([@domain.registrant.email] + @domain.admin_contacts.map { |x| format(x.email) })
|
||||
@params[:recipient] = emails.uniq.map { |x| format(x) }
|
||||
end
|
||||
|
||||
# puny internet domain name, TODO: username<email>
|
||||
def format(email)
|
||||
return warn_no_email if email.nil?
|
||||
user, host = email.split('@')
|
||||
host = SimpleIDN.to_ascii(host)
|
||||
"#{user}@#{host}"
|
||||
end
|
||||
|
||||
def subject(subject)
|
||||
@params[:name] = @domain.name
|
||||
@params[:subject] = "#{I18n.t(subject, name: @domain.name)}, [#{@domain.name}]"
|
||||
end
|
||||
|
||||
def confirm_update
|
||||
verification_url('domain_update_confirms')
|
||||
end
|
||||
|
||||
def compose
|
||||
@params
|
||||
end
|
||||
|
||||
def verification_url(path)
|
||||
token = verification_token or return
|
||||
@params[:verification_url] = "#{ENV['registrant_url']}/registrant/#{path}/#{@domain.id}?token=#{token}"
|
||||
end
|
||||
|
||||
def verification_token
|
||||
return warn_missing(:registrant_verification_token) if @domain.registrant_verification_token.blank?
|
||||
return warn_missing(:registrant_verification_asked_at) if @domain.registrant_verification_asked_at.blank?
|
||||
@domain.registrant_verification_token
|
||||
end
|
||||
|
||||
def domain_info
|
||||
[:name, :registrar_name,
|
||||
:registrant_name, :registrant_ident, :registrant_email,
|
||||
:registrant_street,:registrant_city
|
||||
].each do |attr|
|
||||
@params.store attr, @domain.send(attr)
|
||||
end
|
||||
@params.store :registrant_country, @domain.registrant_country.name
|
||||
@params.store :registrant_priv, @domain.registrant.priv?
|
||||
@params.store :old_registrant_name, Registrant.find(@domain.registrant_id_was).name
|
||||
@params
|
||||
end
|
||||
|
||||
def warn_no_email(item = 'email')
|
||||
warn_missing item
|
||||
nil
|
||||
end
|
||||
|
||||
def warn_missing(item)
|
||||
warn_not_delivered "#{item.to_s} is missing for #{@domain.name}"
|
||||
end
|
||||
|
||||
def warn_not_delivered(reason)
|
||||
message = "EMAIL NOT DELIVERED: #{reason}"
|
||||
@params[:errors] << message
|
||||
# Rails.logger.warn message
|
||||
nil
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -132,14 +132,20 @@ class Registrar < ActiveRecord::Base
|
|||
# Audit log is needed, therefore no raw SQL
|
||||
def replace_nameservers(hostname, new_attributes)
|
||||
transaction do
|
||||
domain_list = []
|
||||
|
||||
nameservers.where(hostname: hostname).find_each do |original_nameserver|
|
||||
new_nameserver = Nameserver.new
|
||||
new_nameserver.domain = original_nameserver.domain
|
||||
new_nameserver.attributes = new_attributes
|
||||
new_nameserver.save!
|
||||
|
||||
domain_list << original_nameserver.domain.name
|
||||
|
||||
original_nameserver.destroy!
|
||||
end
|
||||
|
||||
domain_list.uniq.sort
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
%dt= t(:id)
|
||||
%dd= @contact.code
|
||||
|
||||
%dt= t(:authinfo_pw)
|
||||
%dt= Contact.human_attribute_name :auth_info
|
||||
%dd
|
||||
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'
|
||||
= tag :input, type: 'text', value: @contact.auth_info, readonly: true,
|
||||
class: 'form-control input-sm'
|
||||
|
||||
%br
|
||||
|
||||
|
|
|
@ -1,24 +1,8 @@
|
|||
<% if flash[:notice] %>
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button class="close" data-dismiss="alert" type=button><span>×</span></button>
|
||||
<% if flash[:notice].respond_to?(:join) %>
|
||||
<p><%= flash[:notice].join('<br>').html_safe %></p>
|
||||
<% else %>
|
||||
<p><%= flash[:notice] %></p>
|
||||
<% end %>
|
||||
<% display = (flash[:notice] || flash[:alert] || flash[:warning]) ? 'block' : 'none' %>
|
||||
<div id="flash" style="display: <%= display %>;">
|
||||
<% type = (flash[:notice]) ? 'bg-success' : 'bg-danger' %>
|
||||
<% type = 'bg-warning' if flash[:warning] %>
|
||||
<div class="<%= type %> alert">
|
||||
<%= flash[:notice] || flash[:alert] || flash[:warning] %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if flash[:alert] %>
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<button class="close" data-dismiss="alert" type=button><span>×</span></button>
|
||||
<p><%= flash[:alert] %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if flash[:info] %>
|
||||
<div class="alert alert-info alert-dismissible">
|
||||
<button class="close" data-dismiss="alert" type=button><span>×</span></button>
|
||||
<p><%= flash[:info] %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'shared/flash' %>
|
||||
<%= render 'flash_messages' %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= I18n.locale.to_s %>">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<% if content_for? :head_title %>
|
||||
<%= yield :head_title %>
|
||||
<% else %>
|
||||
<title>
|
||||
<%= t(:registrar_head_title) %>
|
||||
</title>
|
||||
<% end %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= stylesheet_link_tag 'registrar-manifest', media: 'all' %>
|
||||
<%= favicon_link_tag 'favicon.ico' %>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<%= link_to registrar_root_path, class: 'navbar-brand' do %>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<% if content_for? :head_title %>
|
||||
<%= yield :head_title %>
|
||||
<% else %>
|
||||
<title>
|
||||
<%= t(:registrar_head_title) %>
|
||||
<% if unstable_env.present? %>
|
||||
<div class="text-center">
|
||||
<small style="color: #0074B3;">
|
||||
<%= unstable_env %>
|
||||
</small>
|
||||
</div>
|
||||
<% end %>
|
||||
</title>
|
||||
<% end %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= stylesheet_link_tag 'registrar-manifest', media: 'all' %>
|
||||
<%= favicon_link_tag 'favicon.ico' %>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<%= link_to registrar_root_path, class: 'navbar-brand' do %>
|
||||
<%= t(:registrar_head_title) %>
|
||||
<% if unstable_env.present? %>
|
||||
<div class="text-center">
|
||||
<small style="color: #0074B3;">
|
||||
<%= unstable_env %>
|
||||
</small>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render 'navbar' %>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'flash_messages' %>
|
||||
<% if depp_controller? %>
|
||||
<%= render 'registrar/shared/epp_results' %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
<%= render 'navbar' %>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'flash_messages' %>
|
||||
<% if depp_controller? %>
|
||||
<%= render 'registrar/shared/epp_results' %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= image_tag 'eis-logo-et.png' %>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= image_tag 'eis-logo-et.png' %>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
Version
|
||||
<%= CURRENT_COMMIT_HASH %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
Version
|
||||
<%= CURRENT_COMMIT_HASH %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<%= javascript_include_tag 'registrar-manifest', async: true %>
|
||||
</body>
|
||||
</footer>
|
||||
<%= javascript_include_tag 'registrar-manifest', async: true %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -51,4 +51,4 @@
|
|||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:address)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
- if @contact.org_name.present?
|
||||
%dt= t(:org_name)
|
||||
%dd= @contact.org_name
|
||||
|
||||
%dt= t(:street)
|
||||
%dd= @contact.street
|
||||
|
||||
%dt= t(:city)
|
||||
%dd= @contact.city
|
||||
|
||||
%dt= t(:zip)
|
||||
%dd= @contact.zip
|
||||
|
||||
%dt= t(:state)
|
||||
%dd= @contact.state
|
||||
|
||||
%dt= t(:country)
|
||||
%dd= @contact.country
|
|
@ -1,30 +0,0 @@
|
|||
- domains = contact.all_domains(page: params[:domain_page], per: 20, params: params.merge(leave_domains: domain_ids))
|
||||
#contacts.panel.panel-default
|
||||
.panel-heading
|
||||
.pull-left
|
||||
= t(:domains)
|
||||
.pull-right
|
||||
= form_tag request.path, method: :get do
|
||||
= select_tag :domain_filter, options_for_select(%w(Registrant AdminDomainContact TechDomainContact), selected: params[:domain_filter]),
|
||||
include_blank: true, class: 'form-control2 selectize2'
|
||||
%button.btn.btn-primary
|
||||
%span.glyphicon.glyphicon-search
|
||||
.clearfix
|
||||
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name
|
||||
%th{class: 'col-xs-3'}=custom_sort_link t(:registrar_name), :registrar_name
|
||||
%th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to
|
||||
%th{class: 'col-xs-3'}=custom_sort_link Domain.human_attribute_name(:roles), :roles
|
||||
%tbody
|
||||
- domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.name, [:registrant, x])
|
||||
%td= link_to(x.registrar, [:registrant, x.registrar])
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= x.roles.join(", ")
|
||||
|
||||
= paginate domains, param_name: :domain_page
|
|
@ -1,48 +0,0 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:general)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:id)
|
||||
%dd= @contact.code
|
||||
|
||||
%dt= t(:name)
|
||||
%dd= @contact.name
|
||||
|
||||
%dt= t(:password)
|
||||
%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= Contact.human_attribute_name :created_at
|
||||
%dd
|
||||
= l(@contact.created_at, format: :short)
|
||||
by
|
||||
= @contact.name
|
||||
|
||||
%dt= Contact.human_attribute_name :updated_at
|
||||
%dd
|
||||
= l(@contact.updated_at, format: :short)
|
||||
by
|
||||
= @contact.name
|
||||
|
||||
%dt= t(:registrar_name)
|
||||
%dd
|
||||
- if @contact.registrar.present?
|
||||
= link_to(@contact.registrar, registrant_registrar_path(@contact.registrar))
|
|
@ -1,6 +0,0 @@
|
|||
= search_form_for [:registrant, @q] do |f|
|
||||
= f.search_field :name_cont
|
||||
= f.submit do
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
- panel_class = contact.errors.messages[:statuses] ? 'panel-danger' : 'panel-default'
|
||||
#contact_statuses.panel{class: panel_class}
|
||||
.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
|
||||
- contact.statuses.each do |status|
|
||||
%tr
|
||||
%td= status
|
||||
%td= contact.status_notes[status]
|
||||
|
||||
- if contact.errors.messages[:statuses]
|
||||
%tfoot
|
||||
- @domain.errors.messages[:statuses].each do |s|
|
||||
%tr
|
||||
%td{colspan: 4}= s
|
|
@ -1,11 +0,0 @@
|
|||
= render 'shared/title', name: @contact.name
|
||||
|
||||
.row
|
||||
.col-md-6= render 'registrant/contacts/partials/general'
|
||||
.col-md-6= render 'registrant/contacts/partials/address'
|
||||
.row
|
||||
.col-md-12= render 'registrant/contacts/partials/statuses', contact: @contact
|
||||
.row
|
||||
.col-md-12= render 'registrant/contacts/partials/domains', contact: @contact
|
||||
|
||||
|
25
app/views/registrant/contacts/show.html.erb
Normal file
25
app/views/registrant/contacts/show.html.erb
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div class="page-header">
|
||||
<h1><%= @contact.name %></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= render 'registrant/contacts/show/general' %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<%= render 'registrant/contacts/show/address' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/contacts/show/statuses', contact: @contact %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/contacts/show/domains', contact: @contact %>
|
||||
</div>
|
||||
</div>
|
31
app/views/registrant/contacts/show/_address.html.erb
Normal file
31
app/views/registrant/contacts/show/_address.html.erb
Normal file
|
@ -0,0 +1,31 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t '.header' %>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<% if @contact.org_name.present? %>
|
||||
<dt><%= Contact.human_attribute_name :org_name %></dt>
|
||||
<dd><%= @contact.org_name %></dd>
|
||||
<% end %>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :street %></dt>
|
||||
<dd><%= @contact.street %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :city %></dt>
|
||||
<dd><%= @contact.city %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :zip %></dt>
|
||||
<dd><%= @contact.zip %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :state %></dt>
|
||||
<dd><%= @contact.state %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :country %></dt>
|
||||
<dd><%= @contact.country %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
6
app/views/registrant/contacts/show/_domain.html.erb
Normal file
6
app/views/registrant/contacts/show/_domain.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<tr>
|
||||
<td><%= link_to domain.name, registrant_domain_path(domain) %></td>
|
||||
<td><%= link_to domain.registrar, registrant_registrar_path(domain.registrar) %></td>
|
||||
<td><%= l domain.valid_to %></td>
|
||||
<td><%= domain.roles.join(", ") %></td>
|
||||
</tr>
|
54
app/views/registrant/contacts/show/_domains.html.erb
Normal file
54
app/views/registrant/contacts/show/_domains.html.erb
Normal file
|
@ -0,0 +1,54 @@
|
|||
<% domains = contact.all_domains(page: params[:domain_page], per: 20, params:
|
||||
params.merge(leave_domains: domain_ids)) %>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 text-right">
|
||||
<%= form_tag request.path, method: :get, class: 'form-inline' do %>
|
||||
<%= select_tag :domain_filter,
|
||||
options_for_select(%w(Registrant AdminDomainContact TechDomainContact),
|
||||
selected: params[:domain_filter]),
|
||||
include_blank: t('.all'),
|
||||
class: 'form-control' %>
|
||||
<button class="btn btn-primary">
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-3">
|
||||
<%= custom_sort_link Domain.human_attribute_name(:name), :name %>
|
||||
</th>
|
||||
<th class="col-xs-3">
|
||||
<%= custom_sort_link Registrar.model_name.human, :registrar_name %>
|
||||
</th>
|
||||
<th class="col-xs-3">
|
||||
<%= custom_sort_link Domain.human_attribute_name(:valid_to), :valid_to %>
|
||||
</th>
|
||||
<th class="col-xs-3">
|
||||
<%= custom_sort_link Domain.human_attribute_name(:roles), :roles %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render partial: 'registrant/contacts/show/domain', collection: domains %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<%= paginate domains, param_name: :domain_page %>
|
||||
</div>
|
||||
</div>
|
48
app/views/registrant/contacts/show/_general.html.erb
Normal file
48
app/views/registrant/contacts/show/_general.html.erb
Normal file
|
@ -0,0 +1,48 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t '.header' %>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= Contact.human_attribute_name :code %></dt>
|
||||
<dd><%= @contact.code %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :name %></dt>
|
||||
<dd><%= @contact.name %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :auth_info %></dt>
|
||||
<dd>
|
||||
<%= tag :input, type: 'text', value: @contact.auth_info, readonly: true,
|
||||
class: 'form-control input-sm' %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :ident %></dt>
|
||||
<dd><%= ident_for(@contact) %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :email %></dt>
|
||||
<dd><%= @contact.email %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :phone %></dt>
|
||||
<dd><%= @contact.phone %></dd>
|
||||
|
||||
<% if @contact.fax %>
|
||||
<dt><%= Contact.human_attribute_name :fax %></dt>
|
||||
<dd><%= @contact.fax %></dd>
|
||||
<% end %>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :created_at %></dt>
|
||||
<dd><%= l @contact.created_at %></dd>
|
||||
|
||||
<dt><%= Contact.human_attribute_name :updated_at %></dt>
|
||||
<dd><%= l @contact.updated_at %></dd>
|
||||
|
||||
<dt><%= Registrar.model_name.human %></dt>
|
||||
<dd>
|
||||
<%= link_to @contact.registrar, registrant_registrar_path(@contact.registrar) %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
6
app/views/registrant/contacts/show/_search.html.erb
Normal file
6
app/views/registrant/contacts/show/_search.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= search_form_for [:registrant, @q] do |f| %>
|
||||
<%= f.search_field :name_cont %>
|
||||
<%= f.submit do %>
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
<% end %>
|
||||
<% end %>
|
25
app/views/registrant/contacts/show/_statuses.html.erb
Normal file
25
app/views/registrant/contacts/show/_statuses.html.erb
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= t '.header' %>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-6"><%= t '.status' %></th>
|
||||
<th class="col-xs-6"><%= t '.notes' %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% contact.statuses.each do |status| %>
|
||||
<tr>
|
||||
<td><%= status %></td>
|
||||
<td><%= contact.status_notes[status] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
|
@ -6,9 +6,10 @@
|
|||
%dt= t(:id)
|
||||
%dd= @contact.id
|
||||
|
||||
%dt= t(:authinfo_pw)
|
||||
%dt= Contact.human_attribute_name :auth_info
|
||||
%dd
|
||||
= text_field_tag :password, @contact.password, readonly: true, class: 'partially-hidden'
|
||||
= tag :input, type: 'text', value: @contact.password, readonly: true,
|
||||
class: 'form-control input-sm'
|
||||
|
||||
%br
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue