mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
refactor ident_for helper
This commit is contained in:
parent
b52ec4e35e
commit
1264cde50d
3 changed files with 6 additions and 6 deletions
|
@ -9,12 +9,12 @@ module ApplicationHelper
|
|||
"background-image: url(#{image_path(unstable_env.to_s + '.png')});"
|
||||
end
|
||||
|
||||
def ident_indicator(contact)
|
||||
def ident_for(contact)
|
||||
case contact.ident_type
|
||||
when 'birthday'
|
||||
"[#{contact.ident_type}]"
|
||||
"#{contact.ident} [#{contact.ident_type}]"
|
||||
else
|
||||
"[#{contact.ident_country_code} #{contact.ident_type}]"
|
||||
"#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.row
|
||||
.col-sm-12
|
||||
%h2.text-center-xs= t('contacts')
|
||||
%h2.text-center-xs= t(:contacts)
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
@ -35,7 +35,7 @@
|
|||
- @contacts.each do |contact|
|
||||
%tr
|
||||
%td= link_to(contact, admin_contact_path(contact))
|
||||
%td= "#{contact.ident} #{ident_indicator(contact)}"
|
||||
%td= ident_for(contact)
|
||||
%td= contact.email
|
||||
%td= contact.code
|
||||
%td
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:ident)
|
||||
%dd= "#{@contact.ident} #{ident_indicator(@contact)}"
|
||||
%dd= ident_for(@contact)
|
||||
|
||||
%br
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue