mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Improve ContactMailer
- Add detailed registrar info - Refactor contact domain list - Fix english translation #480
This commit is contained in:
parent
37004c24ba
commit
49552fc67e
11 changed files with 220 additions and 37 deletions
|
@ -8,6 +8,7 @@ class RegistrantPresenter
|
|||
:reg_no,
|
||||
:street, :city, :state, :zip, :country,
|
||||
:ident_country,
|
||||
:used?,
|
||||
to: :registrant
|
||||
|
||||
def initialize(registrant:, view:)
|
||||
|
@ -23,6 +24,17 @@ class RegistrantPresenter
|
|||
registrant.ident_country.translation(locale)
|
||||
end
|
||||
|
||||
def domain_names_with_roles(locale: I18n.locale, line_break: "\n")
|
||||
lines = []
|
||||
|
||||
registrant.domain_names_with_roles.each do |domain_name, roles|
|
||||
lines << "#{domain_name} (#{roles.map { |role| role.to_s.classify.constantize.model_name.human(locale: locale) }
|
||||
.join(', ')})"
|
||||
end
|
||||
|
||||
lines.join(line_break)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :registrant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue