Create partial "people/_common_descr_list_items"
This commit is contained in:
parent
5a3f8d2a6e
commit
e3f410c223
|
@ -0,0 +1,41 @@
|
|||
<dt><%= Person.human_attribute_name :last_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.last_name.present? do %>
|
||||
<%= truncate person.last_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :first_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.first_name.present? do %>
|
||||
<%= truncate person.first_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :middle_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.middle_name.present? do %>
|
||||
<%= truncate person.middle_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :sex %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.sex.present? do %>
|
||||
<%= translate_enum :sex, person.sex %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :date_of_birth %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.date_of_birth.present? do %>
|
||||
<%= localize person.date_of_birth %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :place_of_birth %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none person.place_of_birth.present? do %>
|
||||
<%= truncate person.place_of_birth %>
|
||||
<% end %>
|
||||
</dd>
|
|
@ -11,47 +11,8 @@
|
|||
</p>
|
||||
<% else %>
|
||||
<dl>
|
||||
<dt><%= Person.human_attribute_name :last_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.last_name.present? do %>
|
||||
<%= truncate @account.person.last_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :first_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.first_name.present? do %>
|
||||
<%= truncate @account.person.first_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :middle_name %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.middle_name.present? do %>
|
||||
<%= truncate @account.person.middle_name %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :sex %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.sex.present? do %>
|
||||
<%= translate_enum :sex, @account.person.sex %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :date_of_birth %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.date_of_birth.present? do %>
|
||||
<%= localize @account.person.date_of_birth %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :place_of_birth %></dt>
|
||||
<dd>
|
||||
<%= maybe_or_none @account.person.place_of_birth.present? do %>
|
||||
<%= truncate @account.person.place_of_birth %>
|
||||
<% end %>
|
||||
</dd>
|
||||
<%= render partial: 'people/common_descr_list_items',
|
||||
locals: { person: @account.person } %>
|
||||
</dl>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-8">
|
||||
<dl>
|
||||
<dt><%= Person.human_attribute_name :account %></dt>
|
||||
<dd>
|
||||
|
@ -36,27 +36,8 @@
|
|||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :last_name %></dt>
|
||||
<dd><%= truncate @person.last_name %></dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :first_name %></dt>
|
||||
<dd><%= truncate @person.first_name %></dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :middle_name %></dt>
|
||||
<dd><%= truncate @person.middle_name %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<dl>
|
||||
<dt><%= Person.human_attribute_name :sex %></dt>
|
||||
<dd><%= translate_enum :sex, @person.sex if @person.sex %></dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :date_of_birth %></dt>
|
||||
<dd><%= localize @person.date_of_birth if @person.date_of_birth %></dd>
|
||||
|
||||
<dt><%= Person.human_attribute_name :place_of_birth %></dt>
|
||||
<dd><%= truncate @person.place_of_birth if @person.place_of_birth %></dd>
|
||||
<%= render partial: 'people/common_descr_list_items',
|
||||
locals: { person: @person } %>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in New Issue