Display Account#person
This commit is contained in:
parent
3db59dee2f
commit
6d1f967968
4 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,16 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module PeopleHelper
|
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)
|
def person_status(person)
|
||||||
if person.nil? || person.current_relationship.nil?
|
if person.nil? || person.current_relationship.nil?
|
||||||
return translate :not_in_party, scope: %i[helpers person_status]
|
return translate :not_in_party, scope: %i[helpers person_status]
|
||||||
|
|
|
@ -32,5 +32,8 @@
|
||||||
|
|
||||||
<dt><%= Account.human_attribute_name :public_name %></dt>
|
<dt><%= Account.human_attribute_name :public_name %></dt>
|
||||||
<dd><%= @account.public_name %></dd>
|
<dd><%= @account.public_name %></dd>
|
||||||
|
|
||||||
|
<dt><%= Account.human_attribute_name :person %></dt>
|
||||||
|
<dd><%= staff_person_link_or_none @account.person %></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -29,6 +29,7 @@ en:
|
||||||
public_name: Public name
|
public_name: Public name
|
||||||
biography: Bio
|
biography: Bio
|
||||||
avatar: Avatar
|
avatar: Avatar
|
||||||
|
person: Person
|
||||||
federal_subject:
|
federal_subject:
|
||||||
id: ID
|
id: ID
|
||||||
regional_office: Regional department
|
regional_office: Regional department
|
||||||
|
|
|
@ -29,6 +29,7 @@ ru:
|
||||||
public_name: Публичное имя
|
public_name: Публичное имя
|
||||||
biography: Биография
|
biography: Биография
|
||||||
avatar: Аватар
|
avatar: Аватар
|
||||||
|
person: Человек
|
||||||
federal_subject:
|
federal_subject:
|
||||||
id: ID
|
id: ID
|
||||||
regional_office: Региональное отделение
|
regional_office: Региональное отделение
|
||||||
|
|
Reference in a new issue