1
0
Fork 0

Display hierarchy

This commit is contained in:
Alex Kotov 2019-10-02 20:09:17 +05:00
parent bb96b555bd
commit 080e8d0afc
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
5 changed files with 33 additions and 0 deletions

View File

@ -29,6 +29,7 @@
</div>
<div class="col-md-9">
<%= render partial: 'rel_root', locals: { person: @account.person } %>
</div>
</div>
</div>

View File

@ -0,0 +1,23 @@
<span>
<strong>
<% if policy([:staff, relationship.org_unit]).show? %>
<%= link_to relationship.org_unit.name, [:staff, relationship.org_unit] %>
<% else %>
<%= relationship.org_unit.name %>
<% end %>
</strong>
</br>
<%= relationship.status.name %>
<%= translate :since %>
<%= localize relationship.from_date %>
</span>
<ul>
<% relationship.children_rels.each do |children_relationship| %>
<li>
<%= render partial: 'rel_hierarchy', locals: { relationship: children_relationship } %>
</li>
<% end %>
</ul>

View File

@ -0,0 +1,7 @@
<ul>
<% Relationship.where(person: @account.person, parent_rel: nil).each do |relationship| %>
<li>
<%= render partial: 'rel_hierarchy', locals: { relationship: relationship } %>
</li>
<% end %>
</ul>

View File

@ -13,3 +13,4 @@ en:
hello: Hello
new_sign_in: New sign in to your account
sidekiq: Sidekiq
since: since

View File

@ -13,3 +13,4 @@ ru:
hello: Здравствуйте
new_sign_in: Произведён вход в ваш аккаунт
sidekiq: Sidekiq
since: с