Initial commit
This commit is contained in:
46
app/views/contracts/_files.html.erb
Normal file
46
app/views/contracts/_files.html.erb
Normal file
@@ -0,0 +1,46 @@
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
|
||||
<p class="heading"><strong><u>Files</u></strong></p>
|
||||
<% unless release.description.blank? %>
|
||||
<p>
|
||||
Description: <%= release.description %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% photos = release.file_infos.photo %>
|
||||
<% unless photos.empty? %>
|
||||
<h3>Photos</h3>
|
||||
<ul>
|
||||
<% photos.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% videos = release.file_infos.video %>
|
||||
<% unless videos.empty? %>
|
||||
<h3>Videos</h3>
|
||||
<ul>
|
||||
<% videos.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% other = release.file_infos.other %>
|
||||
<% unless other.empty? %>
|
||||
<h3>Other files</h3>
|
||||
<ul>
|
||||
<% other.each do |file_info| %>
|
||||
<li>
|
||||
<%= file_info.filename %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
2
app/views/contracts/_logo.html.erb
Normal file
2
app/views/contracts/_logo.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<%= image_tag account_logo_variant(logo) %>
|
||||
<br />
|
||||
12
app/views/contracts/_notes.html.erb
Normal file
12
app/views/contracts/_notes.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<p class="heading"><strong><u>Notes</u></strong></p>
|
||||
<ul>
|
||||
<% notable.notes.order(created_at: :desc).each do |note| %>
|
||||
<li>
|
||||
<%= note.content %>
|
||||
<br>
|
||||
<%= note.email %>
|
||||
<br>
|
||||
<%= note.created_at.strftime("%D %l:%M %p") %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
34
app/views/contracts/_photos.html.erb
Normal file
34
app/views/contracts/_photos.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
<% @total_photos_count = release.photos.size %>
|
||||
<% if release.respond_to? :guardian_photo %>
|
||||
<% @total_photos_count += release.guardian_photo.attached? ? 1 : 0 %>
|
||||
<% end %>
|
||||
<p class="heading"><strong><u><%= t '.heading', count: @total_photos_count %></u></strong></p>
|
||||
|
||||
<ul>
|
||||
<% if preview %>
|
||||
<%= image_tag dummy_photo, size: "200x200" %>
|
||||
Dummy photo
|
||||
<% else %>
|
||||
<% if release.minor? %>
|
||||
<p class="heading"><strong><%= t '.minor_photos_heading', count: release.photos.size %></strong></p>
|
||||
<% end %>
|
||||
<% release.photos.each do |photo| %>
|
||||
<li>
|
||||
<%= image_tag photo.variant(auto_orient: true, resize: "200x200") %><br />
|
||||
<%= photo.filename.to_s %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if release.respond_to?(:guardian_photo) && release.guardian_photo.attached? %>
|
||||
<br>
|
||||
<p class="heading"><strong><%= t '.guardian_photo_heading' %></strong></p>
|
||||
<li>
|
||||
<%= image_tag release.guardian_photo.variant(auto_orient: true, resize: "200x200") %><br />
|
||||
<%= release.guardian_photo.filename.to_s %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
9
app/views/contracts/_project_info.html.erb
Normal file
9
app/views/contracts/_project_info.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
<dl>
|
||||
<%= description_list_pair_for project, :producer_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :producer_address, append: ":" %>
|
||||
<%= description_list_pair_for project, :name, append: ":" %>
|
||||
<%= description_list_pair_for project, :client_name, append: ":" %>
|
||||
<%= description_list_pair_for project, :description, append: ":" %>
|
||||
<%= description_list_pair_for project, :details, append: ":" %>
|
||||
</dl>
|
||||
61
app/views/contracts/_signature_page.html.erb
Normal file
61
app/views/contracts/_signature_page.html.erb
Normal file
@@ -0,0 +1,61 @@
|
||||
<% 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") %>
|
||||
<% 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.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, :signed_on, append: ":" %>
|
||||
</dl>
|
||||
|
||||
<% end %>
|
||||
8
app/views/contracts/_tags.html.erb
Normal file
8
app/views/contracts/_tags.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<p class="heading"><strong><u>Tags</u></strong></p>
|
||||
<ul>
|
||||
<% taggable.tags.each do |tag| %>
|
||||
<li>
|
||||
<%= tag %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
41
app/views/contracts/pdf.html.erb
Normal file
41
app/views/contracts/pdf.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<% if local_assigns[:logo] %>
|
||||
<div class="logo">
|
||||
<%= render "contracts/logo", logo: logo %>
|
||||
</div>
|
||||
<hr>
|
||||
<% end %>
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
<% if contract_template.body.present? %>
|
||||
<%= contract_template.body %>
|
||||
<br/>
|
||||
<% end %>
|
||||
<% if releasable.minor? && contract_template.guardian_clause.present? %>
|
||||
<p class="text-left"><strong>Guardian Clause</strong></p>
|
||||
<%= contract_template.guardian_clause %>
|
||||
<% end %>
|
||||
<div class="page">
|
||||
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||
</div>
|
||||
<% if releasable.class == AcquiredMediaRelease %>
|
||||
<div class="page">
|
||||
<%= render "contracts/files", release: releasable, preview: preview %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if releasable.try(:photos).present? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/photos", release: releasable, preview: preview %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.notes.any? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/notes", notable: releasable %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if releasable.tags.any? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/tags", taggable: releasable %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user