mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Merge branch 'master' of github.com:domify/registry
Conflicts: CHANGELOG.md app/mailers/domain_mailer.rb app/models/domain.rb app/views/layouts/registrant/application.haml config/application-example.yml config/locales/en.yml config/routes.rb spec/mailers/domain_mailer_spec.rb
This commit is contained in:
commit
412ececd9c
13 changed files with 82 additions and 25 deletions
5
app/controllers/registrant/whois_controller.rb
Normal file
5
app/controllers/registrant/whois_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Registrant::WhoisController < RegistrantController
|
||||
def index
|
||||
authorize! :view, Registrant::Whois
|
||||
end
|
||||
end
|
|
@ -1,18 +1,18 @@
|
|||
class DomainMailer < ApplicationMailer
|
||||
def registrant_updated(domain)
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(domain.registrant_email)
|
||||
@domain = domain
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email)
|
||||
# turn on delivery on specific request only, thus rake tasks does not deliver anything
|
||||
return if domain.deliver_emails != true
|
||||
if domain.registrant_verification_token.blank?
|
||||
return if @domain.deliver_emails != true
|
||||
if @domain.registrant_verification_token.blank?
|
||||
logger.warn "EMAIL DID NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
@old_registrant = Registrant.find(domain.registrant_id_was)
|
||||
@old_registrant = Registrant.find(@domain.registrant_id_was)
|
||||
@verification_url = "#{ENV['registrant_url']}/etc/"
|
||||
|
||||
@domain = domain
|
||||
mail(to: @old_registrant.email,
|
||||
mail(to: @old_registrant.email,
|
||||
subject: "#{I18n.t(:domain_registrant_update_subject, name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,7 @@ class Ability
|
|||
when 'ApiUser'
|
||||
epp
|
||||
registrar
|
||||
registrant # refactor
|
||||
end
|
||||
|
||||
can :show, :dashboard
|
||||
|
@ -63,6 +64,10 @@ class Ability
|
|||
can :manage, :deposit
|
||||
end
|
||||
|
||||
def registrant
|
||||
can :manage, Registrant::Whois
|
||||
end
|
||||
|
||||
def user
|
||||
can :show, :dashboard
|
||||
end
|
||||
|
|
|
@ -60,9 +60,10 @@ class Domain < ActiveRecord::Base
|
|||
def manage_statuses
|
||||
return unless registrant_id_changed?
|
||||
if registrant_verification_asked_at.present?
|
||||
domain_statuses.build(value: DomainStatus::PENDING_UPDATE)
|
||||
domain_statuses.build(value: DomainStatus::PENDING_UPDATE)
|
||||
DomainMailer.registrant_updated(self).deliver_now
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
before_save :touch_always_version
|
||||
|
@ -140,8 +141,8 @@ class Domain < ActiveRecord::Base
|
|||
def included
|
||||
includes(
|
||||
:registrant,
|
||||
:registrar,
|
||||
:nameservers,
|
||||
:registrar,
|
||||
:nameservers,
|
||||
:whois_record,
|
||||
{ tech_contacts: :registrar },
|
||||
{ admin_contacts: :registrar }
|
||||
|
@ -253,7 +254,7 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# otherwise domain_statuses are in old state for domain object
|
||||
domain_statuses.reload
|
||||
domain_statuses.reload
|
||||
end
|
||||
|
||||
def children_log
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
- active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:domains), registrant_domains_path
|
||||
|
||||
- active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:whois), registrant_whois_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
- if user_signed_in?
|
||||
%li= link_to t(:log_out, user: current_user), '/registrant/logout'
|
||||
|
|
21
app/views/registrant/whois/index.haml
Normal file
21
app/views/registrant/whois/index.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
= render 'shared/title', name: t(:whois)
|
||||
|
||||
- if ENV['restful_whois_url'].blank?
|
||||
%p
|
||||
Registrant configuration issue: missing restful_whois_url
|
||||
- else
|
||||
.row
|
||||
.col-md-12{style: 'margin-bottom: -15px;'}
|
||||
= form_tag registrant_whois_path, class: 'form-horizontal', method: :get do
|
||||
.col-md-11
|
||||
.form-group
|
||||
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t(:domain_name), autocomplete: 'off', autofocus: true
|
||||
.col-md-1.text-right.text-center-xs
|
||||
.form-group
|
||||
%button.btn.btn-default
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%hr
|
||||
- if @results
|
||||
= @results
|
Loading…
Add table
Add a link
Reference in a new issue