1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/views/passports/show.html.erb
2018-12-02 21:44:02 +05:00

150 lines
4.4 KiB
Text

<div class="container-fluid">
<% if @passport.image && current_account %>
<% if @passport.passport_confirmations.where(account: current_account).exists? %>
<div role="alert" class="alert alert-success">
<%= translate '.instruction_confirmed' %>
</div>
<button class="btn btn-primary" disabled>
<%= translate '.confirm' %>
</button>
<% else %>
<div role="alert" class="alert alert-warning">
<%= translate '.instruction_unconfirmed' %>
</div>
<%= link_to translate('.confirm'),
passport_passport_confirmations_path(@passport),
method: :post,
role: :button,
class: 'btn btn-primary' %>
<% end %>
<hr/>
<% end %>
<div class="row">
<div class="col-md-4 col-lg-6">
<dl class="row">
<dt class="col-lg-4">
<%= Passport.human_attribute_name :confirmed %>
</dt>
<dd class="col-lg-8">
<% if @passport.confirmed? %>
<span class="badge badge-success">
<%= Passport.human_attribute_name 'confirmed.true' %>
</span>
<% else %>
<span class="badge badge-warning">
<%= Passport.human_attribute_name 'confirmed.false' %>
</span>
<% end %>
</dt>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :passport_confirmations_count %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_confirmations.count %>
/
<%= Passport::REQUIRED_CONFIRMATIONS %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :surname %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.surname %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :given_name %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.given_name %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :patronymic %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.patronymic %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :sex %>
</dt>
<dd class="col-lg-8">
<% if @passport.passport_map %>
<%= Passport.human_attribute_name "sex.#{@passport.passport_map.sex}" %>
<% end %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :date_of_birth %>
</dt>
<dd class="col-lg-8">
<% if @passport.passport_map %>
<%= localize @passport.passport_map.date_of_birth %>
<% end %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :place_of_birth %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.place_of_birth %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :series %>
</dt>
<dd class="col-lg-8">
<% if @passport.passport_map %>
<%= passport_series @passport.passport_map.series %>
<% end %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :number %>
</dt>
<dd class="col-lg-8">
<% if @passport.passport_map %>
<%= passport_number @passport.passport_map.number %>
<% end %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :issued_by %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.issued_by %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :unit_code %>
</dt>
<dd class="col-lg-8">
<%= @passport.passport_map&.unit_code %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :date_of_issue %>
</dt>
<dd class="col-lg-8">
<% if @passport.passport_map %>
<%= localize @passport.passport_map.date_of_issue %>
<% end %>
</dd>
</dl>
</div>
<% @passport.image.try do |image| %>
<div class="col-md-8 col-lg-6">
<div>
<%= image_tag url_for(image), id: :image, class: 'img-fluid', style: 'max-height: 600px' %>
</div>
</div>
<% end %>
</div>
</div>