Upstream sync

This commit is contained in:
Senad Uka
2020-08-24 15:52:23 +02:00
parent 41bf88e358
commit a493076f9b
25 changed files with 307 additions and 1000 deletions

View File

@@ -1,9 +1,13 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading", release_type: @releasable_param.name.titleize), close_action_path: [@project, "#{@releasable_param.name.pluralize}"] %>
<div class="card-body">
<embed class="embeded-contract-preview" type="application/pdf" src="<%= url_for [@releasable, :contracts, format: "pdf"] %>" width="90%" height="1200" />
<embed class="embeded-contract-preview mb-3" type="application/pdf" src="<%= url_for [@releasable, :contracts, format: "pdf"] %>" width="90%" height="1200" />
<%= errors_summary_for @releasable %>
<%= bootstrap_form_with model: @releasable, method: :post, url: public_send("#{@releasable_param.name}_approvals_path", @releasable), local: true do |form| %>
<%= card_field_set_tag 'Signature' do %>
<%= render "shared/signature_fields", form: form, signature_field: 'approved_by_user_signature[data]' %>
<% end %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [@releasable.project, "#{@releasable_param.name.pluralize}"], class: "col-3 text-reset" %>
<div class="col-9">
@@ -12,4 +16,4 @@
</div>
<% end %>
</div>
</div>
</div>

View File

@@ -10,4 +10,10 @@
<%= description_list_pair t('.description_labels.issued_to'), releasable.name %>
<%= description_list_pair t('.description_labels.issued_by'), releasable.approved_by_user_name %>
<%= description_list_pair t('.description_labels.date_issued'), releasable.approved_at %>
</dl>
</dl>
<% if preview %>
<%= image_tag dummy_signature %>
<% elsif releasable.approved_by_user_signature.attached? %>
<%= image_tag releasable.approved_by_user_signature.variant(auto_orient: true, resize: "200x200") %>
<% end %>

View File

@@ -16,11 +16,10 @@
<%= contract_template.guardian_clause %>
<% end %>
<%# if releasable.model_name.in? %w(MedicalRelease MiscRelease AppearanceRelease) %>
<% if releasable.respond_to?(:question_1_answer) %>
<div class="page">
<%= render "contracts/questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %>
</div>
</div>
<% end %>
<div class="page">
@@ -47,8 +46,7 @@
<% end %>
<% end %>
<% if releasable.respond_to?(:approved?) && releasable.approved? %>
<% if releasable.try(:approved?) %>
<div class="page">
<%= render "contracts/for_office_use_only", releasable: releasable, preview: preview %>
</div>