Display if FederalSubject#regional_office exists
This commit is contained in:
parent
9cbabe797f
commit
5d35a21e34
6 changed files with 25 additions and 26 deletions
|
@ -22,6 +22,9 @@
|
|||
<th scope="col">
|
||||
<%= FederalSubject.human_attribute_name :timezone %>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<%= FederalSubject.human_attribute_name :regional_office %>
|
||||
</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -33,6 +36,13 @@
|
|||
<td><%= federal_subject.display_name %></td>
|
||||
<td><%= federal_subject.centre %></td>
|
||||
<td><%= federal_subject.timezone %></td>
|
||||
<td>
|
||||
<% if federal_subject.regional_office.nil? %>
|
||||
<%= translate :no %>
|
||||
<% else %>
|
||||
<%= translate :yes %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if policy(federal_subject).show? %>
|
||||
<%= link_to federal_subject,
|
||||
|
|
|
@ -29,31 +29,14 @@
|
|||
|
||||
<dt><%= FederalSubject.human_attribute_name :timezone %></dt>
|
||||
<dd><%= @federal_subject.timezone %></dd>
|
||||
</dl>
|
||||
|
||||
<% if @federal_subject.regional_office %>
|
||||
<hr/>
|
||||
|
||||
<h2><%= RegionalOffice.model_name.human %></h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<dl class="my-4">
|
||||
<dt>
|
||||
<%= RegionalOffice.human_attribute_name :current_supporters_count %>
|
||||
</dt>
|
||||
<dd><%= @federal_subject.regional_office.current_supporters_count %></dd>
|
||||
|
||||
<dt><%= RegionalOffice.human_attribute_name :current_members_count %></dt>
|
||||
<dd><%= @federal_subject.regional_office.current_members_count %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<dt><%= FederalSubject.human_attribute_name :regional_office %></dt>
|
||||
<dd>
|
||||
<% if @federal_subject.regional_office.nil? %>
|
||||
<%= translate :no %>
|
||||
<% else %>
|
||||
<%= translate :yes %>
|
||||
<% end %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
|
|
@ -34,6 +34,7 @@ en:
|
|||
avatar: Avatar
|
||||
federal_subject:
|
||||
id: ID
|
||||
regional_office: Regional department
|
||||
english_name: Name
|
||||
native_name: Name
|
||||
display_name: Name
|
||||
|
|
|
@ -34,6 +34,7 @@ ru:
|
|||
avatar: Аватар
|
||||
federal_subject:
|
||||
id: ID
|
||||
regional_office: Региональное отделение
|
||||
english_name: Название
|
||||
native_name: Название
|
||||
display_name: Название
|
||||
|
|
|
@ -3,3 +3,5 @@ en:
|
|||
staff_services: Staff services
|
||||
none: None
|
||||
current: current
|
||||
:yes: Yes
|
||||
:no: No
|
||||
|
|
|
@ -3,3 +3,5 @@ ru:
|
|||
staff_services: Сервисы для сотрудников
|
||||
none: Нет
|
||||
current: текущее
|
||||
:yes: Да
|
||||
:no: Нет
|
||||
|
|
Reference in a new issue