Upstream sync

This commit is contained in:
Senad Uka
2020-08-20 06:50:51 +02:00
parent 190ff2854b
commit 41bf88e358
127 changed files with 1399 additions and 565 deletions

View File

@@ -12,8 +12,8 @@
<%= acquired_media_release.name %>
</td>
<td>
<% if acquired_media_release.file_infos.any? %>
<%= acquired_media_release.file_infos.size %>
<% if acquired_media_release.files.any? %>
<%= acquired_media_release.files.size %>
<% else %>
<%= fa_icon("warning", text: t(".no_media"), class: "text-danger") %>
<% end %>
@@ -40,8 +40,8 @@
<% if policy(acquired_media_release.tags).new? %>
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, acquired_media_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
<% end %>
<% if policy(acquired_media_release).edit_file_infos? %>
<%= link_to fa_icon("file fw", text: "Add Media"), [:edit, acquired_media_release, :file_infos], class: "dropdown-item" %>
<% if policy(acquired_media_release).edit_files? %>
<%= link_to fa_icon("file fw", text: "Media"), [:edit, acquired_media_release, :files], class: "dropdown-item" %>
<% end %>
<% if policy(Contract).show? && (acquired_media_release.contract.attached? || acquired_media_release.contract_template.present?) %>
<%= link_to fa_icon("download fw", text: "Download"), [acquired_media_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>

View File

@@ -44,7 +44,7 @@
<%= fa_icon "warning" %>
<strong>For optimal accuracy, please ensure video file names and photo file names match the source file name in the editing sequence.</strong>
</div>
<%= render "shared/file_infos_dropzone", form: form, releasable: acquired_media_release %>
<%= render "shared/releasable_files_dropzone", form: form, releasable: acquired_media_release %>
<div class="<%= class_string("collapse" => !acquired_media_release.minor?) %>" data-ujs-target="guardian-fields">
<br>

View File

@@ -28,7 +28,7 @@
<th data-behavior="all-selectable"><%= check_box_tag "acquired_media_release_ids[]", false, false %></th>
<th><%= t '.table_headers.approved'%></th>
<th><%= AcquiredMediaRelease.human_attribute_name(:name) %></th>
<th><%= t(".table_headers.file_infos_count") %></th>
<th><%= t(".table_headers.files_count") %></th>
<th><%= t(".table_headers.owner_info") %></th>
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>

View File

@@ -8,6 +8,9 @@
<td>
<%= account.projects.size %>
</td>
<td>
<%= account.total_number_of_releases %>
</td>
<td>
<%= number_with_delimiter convert_duration(account.current_month_video_duration_total, from: :seconds, to: :minutes).round %> minutes
</td>

View File

@@ -15,6 +15,7 @@
<th>Name</th>
<th>Plan</th>
<th># Projects</th>
<th># Releases Signed</th>
<th>Monthly Video Upload Minutes</th>
<th>Total Video Upload Minutes</th>
<th>Total Storage</th>

View File

@@ -1,6 +1,7 @@
<%= errors_summary_for broadcast %>
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= form.text_field :video_conference_url_override %>
<%= form.text_field :stream_url_override %>
<%= form.text_field :stream_key_override %>
<%= form.text_area :director_mode_video_embed %>

View File

@@ -34,6 +34,17 @@
<td>
<%= appearance_release.signed_on %>
</td>
<td class="text-center">
<% if appearance_release.amendment_signed? %>
<i class="fa fa-check-square-o text-dark"
data-toggle="tooltip"
title="<%= t '.messages.amendment_signed_tooltip' %>"></i>
<% elsif appearance_release.amendment_signable? %>
<i class="fa fa-square-o"
data-toggle="tooltip"
title="<%= t '.messages.amendment_not_signed_tooltip' %>"></i>
<% end %>
</td>
<td class="text-right">
<div class="btn-group">
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
@@ -44,6 +55,9 @@
<% if policy(appearance_release.tags).new? %>
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, appearance_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
<% end %>
<% if policy(appearance_release).sign_amendment? && appearance_release.amendment_signable? && !appearance_release.amendment_signed? %>
<%= link_to fa_icon("file-text fw", text: t('.actions.sign_amendment')), [:new, appearance_release.project.account, appearance_release.project, appearance_release.contract_template, appearance_release, :amendment], class: "dropdown-item", target: "_blank" %>
<% end %>
<% if policy(Contract).show? && (appearance_release.contract.attached? || appearance_release.contract_template.present?) %>
<%= link_to fa_icon("download fw", text: "Download"), [appearance_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
<% end %>

View File

@@ -51,6 +51,7 @@
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>
<th><%= t(".table_headers.signed_at") %></th>
<th><%= t '.table_headers.amendment_signed' %></th>
<th></th>
</tr>
</thead>

View File

@@ -2,7 +2,7 @@
<%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
<div class="form-row">
<%= form.text_field :name, wrapper_class: "col-sm-6" %>
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(acquired_media appearance talent material misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical misc), "#amendment_clause": %w(location) } }, class: "form-control custom-select" %>
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(acquired_media appearance talent material misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media misc), "#custom_fields": %w(medical misc appearance), "#amendment_clause": %w(appearance location), "#exhibit_fields": %w(appearance) } }, class: "form-control custom-select" %>
</div>
<div class="form-row mb-3">
<%= form.radio_button :accessibility, :public_template, label: "Public", wrapper_class: "mr-3" %>
@@ -34,6 +34,25 @@
<%= form.rich_text_area :amendment_clause %>
<% end %>
</div>
<div id="exhibit_fields">
<%= form.form_group do %>
<%= form.rich_text_area :exhibit_a_legal_text %>
<small class="form-text text-muted mb-4"><%= t(".exhibits.help.option_field")%></small>
<% end %>
<%= form.form_group do %>
<%= form.text_area :exhibit_a_question_text %>
<small class="form-text text-muted mb-4"><%= t(".exhibits.help.option_field")%></small>
<% end %>
<%= form.form_group do %>
<%= form.rich_text_area :exhibit_b_legal_text %>
<small class="form-text text-muted mb-4"><%= t(".exhibits.help.option_field")%></small>
<% end %>
<%= form.form_group do %>
<%= form.text_area :exhibit_b_question_text %>
<small class="form-text text-muted mb-4"><%= t(".exhibits.help.option_field")%></small>
<% end %>
</div>
<div id="signature_legal_text">
<%= form.form_group do %>
<%= form.rich_text_area :signature_legal_text %>

View File

@@ -0,0 +1,8 @@
<p class="heading"><strong><u><%= t ".heading.#{releasable.model_name.param_key}" %></u></strong></p>
<h4>Legal</h4>
<p><%= releasable.contract_template.exhibit_a_legal_text %></p>
<% if releasable.contract_template.exhibit_a_question_text.present? %>
<h4>Question</h4>
<p><strong><%= releasable.contract_template.exhibit_a_question_text %></strong></p>
<p><%= releasable.exhibit_a_answer %></p>
<% end %>

View File

@@ -0,0 +1,8 @@
<p class="heading"><strong><u><%= t ".heading.#{releasable.model_name.param_key}" %></u></strong></p>
<h4>Legal</h4>
<p><%= releasable.contract_template.exhibit_b_legal_text %></p>
<% if releasable.contract_template.exhibit_b_question_text.present? %>
<h4>Question</h4>
<p><strong><%= releasable.contract_template.exhibit_b_question_text %></strong></p>
<p><%= releasable.exhibit_b_answer %></p>
<% end %>

View File

@@ -8,38 +8,37 @@
Description: <%= release.description %>
</p>
<% end %>
<% photos = release.file_infos.photo %>
<% photos = release.image_files %>
<% unless photos.empty? %>
<h3>Photos</h3>
<ul>
<% photos.each do |file_info| %>
<% photos.each do |blob| %>
<li>
<%= file_info.filename %>
<%= blob.filename %>
</li>
<% end %>
</ul>
<% end %>
<% videos = release.file_infos.video %>
<% videos = release.video_files %>
<% unless videos.empty? %>
<h3>Videos</h3>
<ul>
<% videos.each do |file_info| %>
<% videos.each do |blob| %>
<li>
<%= file_info.filename %>
<%= blob.filename %>
</li>
<% end %>
</ul>
<% end %>
<% other = release.file_infos.other %>
<% other = release.other_files %>
<% unless other.empty? %>
<h3>Other files</h3>
<ul>
<% other.each do |file_info| %>
<% other.each do |blob| %>
<li>
<%= file_info.filename %>
<%= blob.filename %>
</li>
<% end %>
</ul>

View File

@@ -6,3 +6,5 @@
<p><%= releasable.public_send("question_#{n}_answer") %></p>
<% end %>
<% end %>
<%= contract_template.questionnaire_legal_text %>

View File

@@ -16,7 +16,8 @@
<%= contract_template.guardian_clause %>
<% end %>
<% if releasable.model_name.in? %w(MedicalRelease MiscRelease) %>
<%# 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>
@@ -30,7 +31,22 @@
<div class="page">
<%= render "contracts/amendment_page", releasable: releasable, preview: preview %>
</div>
<%end %>
<% end %>
<% if releasable.respond_to?(:exhibit_a_answer) %>
<% if contract_template.has_exhibit_a? %>
<div class="page">
<%= render "contracts/exhibit_a_page", releasable: releasable, preview: preview %>
</div>
<% end %>
<% if contract_template.has_exhibit_b? %>
<div class="page">
<%= render "contracts/exhibit_b_page", releasable: releasable, preview: preview %>
</div>
<% end %>
<% end %>
<% if releasable.respond_to?(:approved?) && releasable.approved? %>
<div class="page">

View File

@@ -1,7 +1,7 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading"), subtext: @releasable.name, close_action_path: [@project, @releasable.model_name.plural] %>
<div class="card-body">
<% if @releasable.file_infos.any? %>
<% if @releasable.files.any? %>
<div class="alert alert-info text-center text-md-left">
<%= fa_icon "info-circle" %>
<strong>To Add Photos & Videos to the release: Drag & Drop Files or Click or Tap here to browse media.</strong>
@@ -11,8 +11,8 @@
<%= fa_icon "warning" %>
<strong>For optimal accuracy, please ensure video file names and photo file names match the source file name in the editing sequence.</strong>
</div>
<%= bootstrap_form_with model: @releasable, url: [@releasable, :file_infos] do |form| %>
<%= render "shared/file_infos_dropzone", form: form, releasable: @releasable %>
<%= bootstrap_form_with model: @releasable, url: [@releasable, :files] do |form| %>
<%= render "shared/releasable_files_dropzone", form: form, releasable: @releasable %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [@project, @releasable.model_name.plural], class: "col-3 text-reset" %>

View File

@@ -0,0 +1,10 @@
<% if policy(Project).new? %>
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
<li class="card h-100 shadow-sm">
<div class="card-body d-flex flex-column justify-content-center align-items-center">
<%= fa_icon("plus-circle", class: "text-success", style: "font-size:4rem") %>
<%= link_to t(".actions.new"), [:new, :project], class: "mt-4 text-reset text-decoration-none stretched-link" %>
</div>
</li>
</div>
<% end %>

View File

@@ -1,17 +1,14 @@
<% if @projects.any? %>
<section class="container mt-5">
<h1 class="h3"><%= t(".heading") %> (<%= @projects.size %>)</h1>
<ul class="list-unstyled mt-2 row">
<% if policy(Project).new? %>
<div class="col-sm-6 col-md-4 col-lg-3 mt-4">
<li class="card h-100 shadow-sm">
<div class="card-body d-flex flex-column justify-content-center align-items-center">
<%= fa_icon("plus-circle", class: "text-success", style: "font-size:4rem") %>
<%= link_to t(".actions.new"), [:new, :project], class: "mt-4 text-reset text-decoration-none stretched-link" %>
</div>
</li>
</div>
<div class="d-flex flex-row justify-content-between align-items-center mb-3">
<h1 class="h3"><%= t(".heading") %> (<%= @projects.size %>)</h1>
<%= bootstrap_form_with url: [@account, :projects], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border rounded-pill-left") %>
<% end %>
</div>
<ul id="projects" class="list-unstyled mt-2 row">
<%= render partial: "new_project_button" %>
<%= render @projects %>
</ul>
</section>

View File

@@ -0,0 +1,4 @@
$("#projects").html("")
$("#projects").append("<%= j render(partial: "new_project_button") %>");
$("#projects").append("<%= j render(@projects) %>");
$("form input[type='search']").val("<%= params[:query] %>");

View File

@@ -55,7 +55,7 @@
<hr>
<%= card_field_set_tag t(".files.heading") do %>
<%= render "shared/file_infos_dropzone", form: form, releasable: @acquired_media_release %>
<%= render "shared/releasable_files_dropzone", form: form, releasable: @acquired_media_release %>
<% end %>
<hr>

View File

@@ -13,6 +13,29 @@
<% end %>
<hr>
<% if @contract_template.has_exhibit_a? %>
<%= card_field_set_tag t(".exhibits.exhibit_a.heading") do %>
<p><%= @contract_template.exhibit_a_legal_text %></p>
<% if @contract_template.exhibit_a_question_text.present? %>
<div class="form-row">
<%= form.text_area :exhibit_a_answer, label: @contract_template.exhibit_a_question_text, wrapper_class: "col-sm-12" %>
</div>
<% end %>
<% end %>
<hr>
<% end %>
<% if @contract_template.has_exhibit_b? %>
<%= card_field_set_tag t(".exhibits.exhibit_b.heading") do %>
<p><%= @contract_template.exhibit_b_legal_text %></p>
<% if @contract_template.exhibit_b_question_text.present? %>
<div class="form-row">
<%= form.text_area :exhibit_b_answer, label: @contract_template.exhibit_b_question_text, wrapper_class: "col-sm-12" %>
</div>
<% end %>
<% end %>
<hr>
<% end %>
<% unless @contract_template.guardian_clause.blank? %>
<%= form.form_group :minor do %>
@@ -25,6 +48,19 @@
<hr>
<% end %>
<% if @contract_template.has_questionnaire? %>
<%= card_field_set_tag t(".questionnaire.heading") do %>
<% (1..AppearanceRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
<% if @contract_template.public_send("question_#{n}_text").present? %>
<div class="form-row">
<%= form.text_area "question_#{n}_answer", wrapper_class: "col-sm-12", label: @contract_template.public_send("question_#{n}_text") %>
</div>
<% end %>
<% end %>
<% end %>
<hr>
<% end %>
<%= card_field_set_tag t(".personal_info.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".personal_info.instructions" %></div>
<div class="form-row">

View File

@@ -4,7 +4,7 @@
<%= bootstrap_form_with model: [@account, @project, @contract_template, @medical_release], local: true, validation_context: :native do |form| %>
<div class="alert alert-warning font-weight-bold"><%= t ".instructions_html", name: @project.name %></div>
<%= card_field_set_tag t(".legal.heading") do %>
<p><%= @contract_template.body %></p>
<%= @contract_template.body %>
<% if @contract_template.fee? %>
<p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span>
@@ -34,6 +34,9 @@
</div>
<% end %>
<% end %>
<% if @contract_template.questionnaire_legal_text.present? %>
<%= @contract_template.questionnaire_legal_text %>
<% end %>
<% end %>
<hr>
<% end %>
@@ -153,4 +156,4 @@
</div>
<% end %>
</div>
</div>
</div>

View File

@@ -3,3 +3,6 @@
<%= form.text_area "question_#{n}_text", wrapper_class: "col-sm-12" %>
</div>
<% end%>
<%= form.form_group do %>
<%= form.rich_text_area :questionnaire_legal_text, hint: true %>
<% end %>

View File

@@ -15,4 +15,3 @@
data-placeholder="<%= dropzone_placeholder_message_for(releasable) %>"
data-submit-button="#submit_release">
</div>

View File

@@ -0,0 +1,17 @@
<div class="field d-none">
<%= form.label :files %>
<%= form.file_field :files, disable: true, direct_upload: true, multiple: true, id: "releasable_files", hide_label: true %>
<% releasable.files.each do |file| %>
<% unless file.persisted? %>
<%= hidden_field_tag "#{releasable.model_name.param_key}[files][]", file.signed_id %>
<% end %>
<% end %>
</div>
<div class="dropzone field border-dashed"
data-accepted-files="audio/*,image/*,video/*,application/*"
data-behavior="dropzone"
data-file-input-id="releasable_files"
data-existing-files="<%= mock_photos_json(releasable.files) %>"
data-placeholder="<%= dropzone_placeholder_message_for(releasable) %>"
data-submit-button="#submit_folder"></div>

View File

@@ -10,5 +10,5 @@
</p>
<p>
If you have questions about how to use the software, please visit <%= link_to "BiGMedia.ai", "https://www.bigmedia.ai/contact" %>.
If you have questions about how to use the software, please visit <%= link_to "MESuite.ai", "https://www.mesuite.ai/contact" %>.
</p>

View File

@@ -7,4 +7,4 @@ Please click below to set your password.
<%= edit_password_reset_url(id: @user.password_reset_token, host: AppHost.new.domain_with_port) %>
<% end %>
If you have questions about how to use the software, please visit https://www.bigmedia.ai/contact.
If you have questions about how to use the software, please visit https://www.mesuite.ai/contact.