mirror of
https://github.com/internetee/registry.git
synced 2025-07-13 14:35:05 +02:00
Contact index show ident in correct format
This commit is contained in:
parent
01a43b86f6
commit
921d8374f5
3 changed files with 23 additions and 15 deletions
|
@ -10,11 +10,21 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def ident_for(contact)
|
||||
case contact.ident_type
|
||||
when 'birthday'
|
||||
"#{contact.ident} [#{contact.ident_type}]"
|
||||
if contact.kind_of? Hash
|
||||
ident_country_code = contact[:ident_country_code]
|
||||
ident_type = contact[:ident_type]
|
||||
ident = contact[:ident]
|
||||
else
|
||||
"#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]"
|
||||
ident_country_code = contact.ident_country_code
|
||||
ident_type = contact.ident_type
|
||||
ident = contact.ident
|
||||
end
|
||||
|
||||
case ident_type
|
||||
when 'birthday'
|
||||
"#{ident} [#{ident_type}]"
|
||||
else
|
||||
"#{ident} [#{ident_country_code} #{ident_type}]"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue