Display Account#person
This commit is contained in:
parent
3db59dee2f
commit
6d1f967968
|
@ -1,6 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PeopleHelper
|
||||
def staff_person_link_or_none(person)
|
||||
if person.nil?
|
||||
translate :none
|
||||
elsif policy([:staff, person]).show?
|
||||
link_to person.full_name, [:staff, person]
|
||||
else
|
||||
person.full_name
|
||||
end
|
||||
end
|
||||
|
||||
def person_status(person)
|
||||
if person.nil? || person.current_relationship.nil?
|
||||
return translate :not_in_party, scope: %i[helpers person_status]
|
||||
|
|
|
@ -32,5 +32,8 @@
|
|||
|
||||
<dt><%= Account.human_attribute_name :public_name %></dt>
|
||||
<dd><%= @account.public_name %></dd>
|
||||
|
||||
<dt><%= Account.human_attribute_name :person %></dt>
|
||||
<dd><%= staff_person_link_or_none @account.person %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
|
|
@ -29,6 +29,7 @@ en:
|
|||
public_name: Public name
|
||||
biography: Bio
|
||||
avatar: Avatar
|
||||
person: Person
|
||||
federal_subject:
|
||||
id: ID
|
||||
regional_office: Regional department
|
||||
|
|
|
@ -29,6 +29,7 @@ ru:
|
|||
public_name: Публичное имя
|
||||
biography: Биография
|
||||
avatar: Аватар
|
||||
person: Человек
|
||||
federal_subject:
|
||||
id: ID
|
||||
regional_office: Региональное отделение
|
||||
|
|
Reference in New Issue