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/staffs/passports/show.html.erb

95 lines
3 KiB
Text

<div class="container">
<%= render partial: 'nav_tabs', locals: { passport: @passport,
tab: :overview } %>
<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/>
<% if @passport.can_have_confirmations? && 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'),
staff_passport_passport_confirmations_path(@passport),
method: :post,
role: :button,
class: 'btn btn-primary' %>
<% end %>
<hr/>
<% end %>
<%= simple_form_for [:staff, @passport], wrapper: :horizontal_form, defaults: { readonly: true } do |f| %>
<div class="row">
<div class="col-md-6">
<%= f.simple_fields_for :passport_maps do |ff| %>
<%= ff.input :first_name %>
<%= ff.input :middle_name %>
<%= ff.input :last_name %>
<%= ff.input :sex,
as: :radio_buttons,
wrapper: :horizontal_collection_inline,
disabled: true,
collection: PassportMap.sexes.keys.map { |sex|
[PassportMap.human_attribute_name("sex.#{sex}"), sex]
} %>
<%= ff.input :date_of_birth,
wrapper: :horizontal_multi_select,
disabled: true,
start_year: Date.today.year - 150,
end_year: Date.today.year %>
<%= ff.input :place_of_birth %>
<%= ff.input :series %>
<%= ff.input :number %>
<%= ff.input :issued_by %>
<%= ff.input :unit_code %>
<%= ff.input :date_of_issue,
wrapper: :horizontal_multi_select,
disabled: true,
start_year: Date.today.year - 150,
end_year: Date.today.year %>
<% end %>
</div>
<% @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 %>
</div>