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 18:27:52 +05:00

148 lines
4 KiB
Text

<div class="container-fluid">
<h1>
<%= @passport.surname %>
<%= @passport.given_name %>
<%= @passport.patronymic %>
</h1>
<hr/>
<% 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.surname %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :given_name %>
</dt>
<dd class="col-lg-8">
<%= @passport.given_name %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :patronymic %>
</dt>
<dd class="col-lg-8">
<%= @passport.patronymic %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :sex %>
</dt>
<dd class="col-lg-8">
<%= Passport.human_attribute_name "sex.#{@passport.sex}" %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :date_of_birth %>
</dt>
<dd class="col-lg-8">
<%= localize @passport.date_of_birth %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :place_of_birth %>
</dt>
<dd class="col-lg-8">
<%= @passport.place_of_birth %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :series %>
</dt>
<dd class="col-lg-8">
<%= passport_series @passport.series %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :number %>
</dt>
<dd class="col-lg-8">
<%= passport_number @passport.number %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :issued_by %>
</dt>
<dd class="col-lg-8">
<%= @passport.issued_by %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :unit_code %>
</dt>
<dd class="col-lg-8">
<%= @passport.unit_code %>
</dd>
<dt class="col-lg-4">
<%= Passport.human_attribute_name :date_of_issue %>
</dt>
<dd class="col-lg-8">
<%= localize @passport.date_of_issue %>
</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>