mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Improve RegistrantChangeMailer
- Do not show registrant address unless "address_processing" is enabled - Add missing registrant state and zip attributes #480
This commit is contained in:
parent
2c648ddc84
commit
bfc0c0b74f
14 changed files with 164 additions and 43 deletions
|
@ -1,4 +1,6 @@
|
|||
class RegistrantChangeMailer < ApplicationMailer
|
||||
helper_method :address_processing
|
||||
|
||||
def confirm(domain:, registrar:, current_registrant:, new_registrant:)
|
||||
@domain = DomainPresenter.new(domain: domain, view: view_context)
|
||||
@registrar = RegistrarPresenter.new(registrar: registrar, view: view_context)
|
||||
|
@ -42,4 +44,8 @@ class RegistrantChangeMailer < ApplicationMailer
|
|||
def confirm_url(domain)
|
||||
registrant_domain_update_confirm_url(domain, token: domain.registrant_verification_token)
|
||||
end
|
||||
|
||||
def address_processing
|
||||
Contact.address_processing?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -594,4 +594,8 @@ class Contact < ActiveRecord::Base
|
|||
return unless priv?
|
||||
ident
|
||||
end
|
||||
|
||||
def ident_country
|
||||
Country.new(ident_country_code)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
class RegistrantPresenter
|
||||
delegate :name, :ident, :email, :priv?, :street, :city, :id_code, :reg_no, to: :registrant
|
||||
delegate :name, :ident, :email, :priv?, :id_code, :reg_no,
|
||||
:street, :city, :state, :zip, :country,
|
||||
:ident_country,
|
||||
to: :registrant
|
||||
|
||||
def initialize(registrant:, view:)
|
||||
@registrant = registrant
|
||||
@view = view
|
||||
end
|
||||
|
||||
def country
|
||||
def country(locale: I18n.locale)
|
||||
registrant.country.translation(locale)
|
||||
end
|
||||
|
||||
def ident_country(locale: I18n.locale)
|
||||
registrant.ident_country.translation(locale)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -4,6 +4,12 @@ Name: <%= registrant.name %><br>
|
|||
<% else %>
|
||||
Business Registry code: <%= registrant.ident %><br>
|
||||
<% end %>
|
||||
Street: <%= registrant.street %><br>
|
||||
City: <%= registrant.city %><br>
|
||||
Country: <%= registrant.country %>
|
||||
<% if address_processing %>
|
||||
Street: <%= registrant.street %><br>
|
||||
City: <%= registrant.city %><br>
|
||||
State: <%= registrant.state %><br>
|
||||
Zip-code: <%= registrant.zip %><br>
|
||||
Country: <%= registrant.country %>
|
||||
<% else %>
|
||||
Country: <%= registrant.ident_country %>
|
||||
<% end %>
|
||||
|
|
|
@ -4,6 +4,12 @@ Name: <%= registrant.name %>
|
|||
<% else %>
|
||||
Business Registry code: <%= registrant.ident %>
|
||||
<% end %>
|
||||
Street: <%= registrant.street %>
|
||||
City: <%= registrant.city %>
|
||||
Country: <%= registrant.country %>
|
||||
<% if address_processing %>
|
||||
Street: <%= registrant.street %>
|
||||
City: <%= registrant.city %>
|
||||
State: <%= registrant.state %>
|
||||
Zip-code: <%= registrant.zip %>
|
||||
Country: <%= registrant.country %>
|
||||
<% else %>
|
||||
Country: <%= registrant.ident_country %>
|
||||
<% end %>
|
||||
|
|
|
@ -4,6 +4,12 @@ Nimi: <%= registrant.name %><br>
|
|||
<% else %>
|
||||
Äriregistrikood: <%= registrant.ident %><br>
|
||||
<% end %>
|
||||
Tänav: <%= registrant.street %><br>
|
||||
Linn: <%= registrant.city %><br>
|
||||
Riik: <%= registrant.country %>
|
||||
<% if address_processing %>
|
||||
Tänav: <%= registrant.street %><br>
|
||||
Linn: <%= registrant.city %><br>
|
||||
Maakond: <%= registrant.state %><br>
|
||||
Sihtnumber: <%= registrant.zip %><br>
|
||||
Riik: <%= registrant.country(locale: :et) %>
|
||||
<% else %>
|
||||
Riik: <%= registrant.ident_country(locale: :et) %>
|
||||
<% end %>
|
||||
|
|
|
@ -4,6 +4,12 @@ Nimi: <%= registrant.name %>
|
|||
<% else %>
|
||||
Äriregistrikood: <%= registrant.ident %>
|
||||
<% end %>
|
||||
Tänav: <%= registrant.street %>
|
||||
Linn: <%= registrant.city %>
|
||||
Riik: <%= registrant.country %>
|
||||
<% if address_processing %>
|
||||
Tänav: <%= registrant.street %>
|
||||
Linn: <%= registrant.city %>
|
||||
Maakond: <%= registrant.state %>
|
||||
Sihtnumber: <%= registrant.zip %>
|
||||
Riik: <%= registrant.country(locale: :et) %>
|
||||
<% else %>
|
||||
Riik: <%= registrant.ident_country(locale: :et) %>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue