mirror of
https://github.com/internetee/registry.git
synced 2025-07-06 03:03:21 +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
|
end
|
||||||
|
|
||||||
def ident_for(contact)
|
def ident_for(contact)
|
||||||
case contact.ident_type
|
if contact.kind_of? Hash
|
||||||
when 'birthday'
|
ident_country_code = contact[:ident_country_code]
|
||||||
"#{contact.ident} [#{contact.ident_type}]"
|
ident_type = contact[:ident_type]
|
||||||
|
ident = contact[:ident]
|
||||||
else
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(c[:name], registrar_contact_path(id: c[:code]))
|
%td= link_to(c[:name], registrar_contact_path(id: c[:code]))
|
||||||
%td= c[:code]
|
%td= c[:code]
|
||||||
%td= c[:ident]
|
%td= ident_for(c)
|
||||||
%td
|
%td
|
||||||
= link_to(t(:edit), edit_registrar_contact_path(c[:code]), class: 'btn btn-primary btn-xs')
|
= link_to(t(:edit), edit_registrar_contact_path(c[:code]), class: 'btn btn-primary btn-xs')
|
||||||
= link_to(t(:delete), delete_registrar_contact_path(c[:code]), class: 'btn btn-default btn-xs')
|
= link_to(t(:delete), delete_registrar_contact_path(c[:code]), class: 'btn btn-default btn-xs')
|
||||||
|
|
|
@ -3,21 +3,19 @@
|
||||||
%h3.panel-title= t(:general)
|
%h3.panel-title= t(:general)
|
||||||
.panel-body
|
.panel-body
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
%dt= t(:ident)
|
%dt= t(:contact_code)
|
||||||
%dd= ident_for(@contact)
|
%dd= @contact.id
|
||||||
|
|
||||||
|
%dt= t(:password)
|
||||||
|
%dd= @contact.password
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
%dt= t(:ident)
|
||||||
|
%dd= ident_for(@contact)
|
||||||
|
|
||||||
%dt= t(:email)
|
%dt= t(:email)
|
||||||
%dd= @contact.email
|
%dd= @contact.email
|
||||||
|
|
||||||
%dt= t(:phone)
|
%dt= t(:phone)
|
||||||
%dd= @contact.phone
|
%dd= @contact.phone
|
||||||
|
|
||||||
%br
|
|
||||||
|
|
||||||
%dt= t(:contact_code)
|
|
||||||
%dd= @contact.id
|
|
||||||
|
|
||||||
%dt= t(:password)
|
|
||||||
%dd= @contact.password
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue