1
0
Fork 0

Display Account#person

This commit is contained in:
Alex Kotov 2019-08-14 17:18:18 +05:00
parent 3db59dee2f
commit 6d1f967968
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 15 additions and 0 deletions

View File

@ -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]

View File

@ -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>

View File

@ -29,6 +29,7 @@ en:
public_name: Public name
biography: Bio
avatar: Avatar
person: Person
federal_subject:
id: ID
regional_office: Regional department

View File

@ -29,6 +29,7 @@ ru:
public_name: Публичное имя
biography: Биография
avatar: Аватар
person: Человек
federal_subject:
id: ID
regional_office: Региональное отделение