1
0
Fork 0

Display if FederalSubject#regional_office exists

This commit is contained in:
Alex Kotov 2019-08-11 20:11:38 +05:00
parent 9cbabe797f
commit 5d35a21e34
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
6 changed files with 25 additions and 26 deletions

View file

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

View file

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

View file

@ -34,6 +34,7 @@ en:
avatar: Avatar
federal_subject:
id: ID
regional_office: Regional department
english_name: Name
native_name: Name
display_name: Name

View file

@ -34,6 +34,7 @@ ru:
avatar: Аватар
federal_subject:
id: ID
regional_office: Региональное отделение
english_name: Название
native_name: Название
display_name: Название

View file

@ -3,3 +3,5 @@ en:
staff_services: Staff services
none: None
current: current
:yes: Yes
:no: No

View file

@ -3,3 +3,5 @@ ru:
staff_services: Сервисы для сотрудников
none: Нет
current: текущее
:yes: Да
:no: Нет