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

95 lines
3 KiB
Text
Raw Normal View History

2018-12-02 17:48:00 -05:00
<div class="container">
2018-12-03 08:34:42 -05:00
<%= render partial: 'nav_tabs', locals: { tab: :overview } %>
2018-12-02 17:48:00 -05:00
<div>
<% 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 %>
<span>
<%= Passport.human_attribute_name :passport_confirmations_count %>
<%= @passport.passport_confirmations.count %>
/
<%= Passport::REQUIRED_CONFIRMATIONS %>
</span>
</div>
<hr/>
2018-12-02 18:21:28 -05:00
<% if @passport.can_have_confirmations? && current_account %>
2018-12-01 21:28:34 -05:00
<% if @passport.passport_confirmations.where(account: current_account).exists? %>
2018-11-30 09:59:29 -05:00
<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 %>
2018-12-02 18:21:28 -05:00
<hr/>
<% end %>
2018-11-30 01:09:56 -05:00
2018-12-02 18:18:07 -05:00
<%= simple_form_for @passport, wrapper: :horizontal_form, defaults: { readonly: true } do |f| %>
2018-12-02 17:48:00 -05:00
<div class="row">
2018-12-02 12:40:31 -05:00
<div class="col-md-6">
2018-12-02 17:48:00 -05:00
<%= f.simple_fields_for :passport_maps do |ff| %>
2018-12-02 18:18:07 -05:00
<%= ff.input :surname %>
<%= ff.input :given_name %>
<%= ff.input :patronymic %>
2018-12-02 17:48:00 -05:00
<%= ff.input :sex,
as: :radio_buttons,
wrapper: :horizontal_collection_inline,
2018-12-02 17:54:55 -05:00
disabled: true,
2018-12-02 17:48:00 -05:00
collection: PassportMap.sexes.keys.map { |sex|
[PassportMap.human_attribute_name("sex.#{sex}"), sex]
} %>
<%= ff.input :date_of_birth,
wrapper: :horizontal_multi_select,
2018-12-02 17:54:55 -05:00
disabled: true,
2018-12-02 17:48:00 -05:00
start_year: Date.today.year - 150,
end_year: Date.today.year %>
2018-12-02 18:18:07 -05:00
<%= ff.input :place_of_birth %>
<%= ff.input :series %>
<%= ff.input :number %>
<%= ff.input :issued_by %>
<%= ff.input :unit_code %>
2018-12-02 17:48:00 -05:00
<%= ff.input :date_of_issue,
wrapper: :horizontal_multi_select,
2018-12-02 17:54:55 -05:00
disabled: true,
2018-12-02 17:48:00 -05:00
start_year: Date.today.year - 150,
end_year: Date.today.year %>
<% end %>
2018-12-01 04:59:41 -05:00
</div>
2018-12-02 17:48:00 -05:00
<% @passport.image.try do |image| %>
<div class="col-md-6">
<div>
<%= image_tag url_for(image), id: :image, class: 'img-fluid', style: 'max-height: 600px' %>
</div>
</div>
<% end %>
</div>
<% end %>
2018-11-29 21:34:46 -05:00
</div>