diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6829040c2..122fc40d4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -9,6 +9,14 @@ module ApplicationHelper "background-image: url(#{image_path("#{unstable_env}.png")});" end + def ident_for(contact) + ident = contact.ident + description = "[#{contact.ident_country_code} #{contact.ident_type}]" + description.prepend("#{ident} ") if ident.present? + + description + end + def current_commit_link hash = `git rev-parse --short HEAD` current_repo = `git remote get-url origin`.gsub('com:', 'com/') diff --git a/app/views/admin/contact_versions/index.haml b/app/views/admin/contact_versions/index.haml index 97c267d30..8f973ee40 100644 --- a/app/views/admin/contact_versions/index.haml +++ b/app/views/admin/contact_versions/index.haml @@ -69,7 +69,7 @@ %tr %td= link_to(contact.name, admin_contact_version_path(version.id)) %td= contact.code - %td= contact.ident_human_description + %td= ident_for(contact) %td - if contact.registrar = link_to(contact.registrar, admin_registrar_path(contact.registrar)) diff --git a/app/views/admin/contact_versions/show.haml b/app/views/admin/contact_versions/show.haml index 57c8c3ccc..546ff4287 100644 --- a/app/views/admin/contact_versions/show.haml +++ b/app/views/admin/contact_versions/show.haml @@ -22,7 +22,7 @@ %dt= t(:ident) %dd{class: changing_css_class(@version,"ident_country_code", "ident_type", "ident")} - = contact.ident_human_description + = ident_for(contact) - if contact.email.present? %dt= t(:email) diff --git a/app/views/admin/contacts/index.haml b/app/views/admin/contacts/index.haml index b4198b8cc..0812913a1 100644 --- a/app/views/admin/contacts/index.haml +++ b/app/views/admin/contacts/index.haml @@ -100,7 +100,7 @@ %tr %td= link_to(contact, admin_contact_path(contact)) %td= contact.code - %td= contact.ident_human_description + %td= ident_for(contact) %td= contact.email %td= l(contact.created_at, format: :short) %td diff --git a/app/views/admin/contacts/partials/_general.haml b/app/views/admin/contacts/partials/_general.haml index 4b8d4ec32..2396861fb 100644 --- a/app/views/admin/contacts/partials/_general.haml +++ b/app/views/admin/contacts/partials/_general.haml @@ -14,7 +14,7 @@ %br %dt.left_25= t(:ident) - %dd.left_25= @contact.ident_human_description + %dd.left_25= ident_for(@contact) %dt.left_25= t(:email) %dd.left_25= @contact.email diff --git a/app/views/registrar/contacts/index.html.erb b/app/views/registrar/contacts/index.html.erb index 35683360e..4a7e8759a 100644 --- a/app/views/registrar/contacts/index.html.erb +++ b/app/views/registrar/contacts/index.html.erb @@ -44,7 +44,7 @@ <%= contact.code %>