Files
old-holivud2/app/views/contracts/_signature_page.html.erb
2020-06-24 04:48:12 +02:00

88 lines
3.6 KiB
Plaintext

<% if preview %>
<h1>PREVIEW ONLY</h1>
<% end %>
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
<p><%= t ".instructions", releasable_name: "#{releasable.model_name.name.titleize}" %></p>
<% # Signer information %>
<dl>
<% # Only guardian signs if talent is a minor %>
<% unless releasable.minor? %>
<dt><%= AppearanceRelease.human_attribute_name(:signature) %>:</dt>
<dd>
<% if preview %>
<%= image_tag dummy_signature %>
<% elsif releasable.signature.attached? %>
<%= image_tag releasable.signature.variant(auto_orient: true, resize: "200x200") %>
<% end %>
</dd>
<% end %>
<%= description_list_pair_for releasable, :name, append: ":" %>
<%= description_list_pair "Contact Address:", releasable.contact_person.address %>
<%= description_list_pair "Contact Phone:", releasable.contact_person.phone %>
<%= description_list_pair "Contact Email:", releasable.contact_person.email %>
<% if releasable.model_name == "AppearanceRelease" %>
<%= description_list_pair "Person Date of Birth:", releasable&.person_date_of_birth&.strftime("%D") %>
<% end %>
<%= description_list_pair_for releasable, :signed_on, append: ":" %>
<% if releasable.model_name == "LocationRelease" %>
<%= description_list_pair "Filming Started On:", releasable&.filming_started_on&.strftime("%D") %>
<%= description_list_pair "Filming Ended On:", releasable&.filming_ended_on&.strftime("%D") %>
<%= description_list_pair "Filming Hours:", releasable&.filming_hours %>
<% end %>
<% if contract_template.fee? %>
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
<% end %>
<% if releasable.model_name == "MaterialRelease" %>
<%= description_list_pair "Description:", releasable.description %>
<% end %>
</dl>
<% if releasable.model_name == "MedicalRelease" %>
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
<% if contract_template.public_send("question_#{n}_text").present? %>
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
<p><%= releasable.public_send("question_#{n}_answer") %></p>
<% end %>
<% end %>
<% end %>
<% if releasable.minor? %>
<br/>
<p class="text-left"><strong>Guardian Information</strong></p>
<% # Guardian information %>
<dl>
<dt><%= AppearanceRelease.human_attribute_name(:signature) %>:</dt>
<dd>
<% if preview %>
<%= image_tag dummy_signature %>
<% elsif releasable.signature.attached? %>
<%= image_tag releasable.signature.variant(auto_orient: true, resize: "200x200") %>
<% end %>
</dd>
<%= description_list_pair_for releasable, :guardian_name, append: ":" %>
<%= description_list_pair_for releasable, :guardian_address, append: ":" %>
<%= description_list_pair_for releasable, :guardian_phone, append: ":" %>
<%= description_list_pair_for releasable, :guardian_email, append: ":" %>
<%= description_list_pair_for releasable, :signed_on, append: ":" %>
</dl>
<% if releasable.respond_to?(:second_guardian_present?) && releasable.second_guardian_present? %>
<br/>
<p class="text-left"><strong>Second guardian Information</strong></p>
<% # Second guardian information %>
<dl>
<%= description_list_pair_for releasable, :guardian_2_name, append: ":" %>
<%= description_list_pair_for releasable, :guardian_2_address, append: ":" %>
<%= description_list_pair_for releasable, :guardian_2_phone, append: ":" %>
<%= description_list_pair_for releasable, :guardian_2_email, append: ":" %>
</dl>
<% end %>
<% end %>