Compare commits

...

5 Commits

Author SHA1 Message Date
Bilal
a4af845217 fix specs 2020-08-03 18:47:40 +02:00
Bilal
50c5d678c5 change copy 2020-08-03 18:36:28 +02:00
Senad Uka
9cbd8d31a8 Upstream sync 2020-07-29 05:15:02 +00:00
Senad Uka
9c3fac4ab9 Upstream sync 2020-07-27 10:17:56 +00:00
Senad Uka
8f13589c55 upstream sync 2020-07-22 19:14:34 +00:00
64 changed files with 2414 additions and 11425 deletions

View File

@@ -21,12 +21,13 @@ $(document).on "turbolinks:load", ->
refreshBroadcastVideo: (data) ->
$("#broadcast_updates").html data.status_content
stream_selected = $("#broadcast_video").attr('video-type') == 'stream';
stream_selected = $("#broadcast_video").data('videoType') == 'stream';
if data.streamer_status == 'recording' && data.status == 'active' && stream_selected
$("#broadcast_video").html data.video_content
new (Clappr.Player)(
<%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %>
parentId: '#broadcast_video'
source: data.playback_url
source: data.full_live_stream_playback_url
width: '100%',
height: '100%',
mute: true,

View File

@@ -0,0 +1,9 @@
$(document).on("turbolinks:load", function() {
$("#upload_directory_files").on('click', function(e){
const newFilesCount = $('input[name = "directory[files][]"][type = "hidden"]').length;
if (newFilesCount === 0){
e.preventDefault();
}
});
});

View File

@@ -3,7 +3,7 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
return false;
}
$("#broadcast_video").attr('video-type', 'recording');
$("#broadcast_video").data('videoType', 'recording');
var playback_url = $(this).attr("data-playback-url")
$("#broadcast_video").empty();
@@ -25,4 +25,4 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
$(this).prepend('<i class="fa fa-check">&nbsp;</i>');
});
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").attr('video-type', 'stream'); });
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").data('videoType', 'stream'); });

View File

@@ -16,6 +16,7 @@ class BroadcastsChannel < ApplicationCable::Channel
event: :broadcast_stream_update,
status: broadcast.status,
playback_url: broadcast.stream_playback_url,
full_live_stream_playback_url: broadcast.full_live_stream_playback_url,
video_content: video_content,
status_content: status_content,
streamer_status: broadcast.streamer_status

View File

@@ -56,35 +56,74 @@ class AcquiredMediaReleasesController < ApplicationController
end
end
def person_params
%i[
person_first_name
person_last_name
person_phone
person_company
person_email
person_title
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
guardian_photo
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_photo
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
]
end
def acquired_media_release_params
params.require(:acquired_media_release).permit(
:name,
:territory,
:term,
:person_first_name,
:person_last_name,
:person_phone,
:person_email,
:person_company,
:person_title,
:person_address_street1,
:person_address_street2,
:person_address_city,
:person_address_state,
:person_address_zip,
:person_address_country,
:contract,
:applicable_medium_id, :applicable_medium_text,
:territory_id, :territory_text,
:term_id, :term_text,
:restriction_id, :restriction_text,
categories: [],
file_infos_attributes: [
:filename,
:content_type,
:byte_size
]
)
params.require(:acquired_media_release).permit(person_params,
guardian_params,
second_guardian_params,
:minor,
:name,
:territory,
:term,
:contract,
:applicable_medium_id, :applicable_medium_text,
:territory_id, :territory_text,
:term_id, :term_text,
:restriction_id, :restriction_text,
categories: [],
file_infos_attributes: %i[
filename
content_type
byte_size
])
end
def build_acquired_media_release(attrs = {})

View File

@@ -3,7 +3,7 @@ class BroadcastsController < ApplicationController
before_action :set_project
before_action :build_broadcast, only: [:new, :create]
before_action :set_broadcast, only: [:show, :destroy, :update]
before_action :set_broadcast, only: [:show, :destroy, :update, :destroy_file]
before_action :set_multi_view_broadcasts, only: [:show]
before_action :show_splash_screen, only: :index
@@ -39,10 +39,7 @@ class BroadcastsController < ApplicationController
end
@broadcast.update(broadcast_params)
@files = @broadcast.files.order("created_at DESC").paginate(page: 1)
pagination_content = ApplicationController.render html: helpers.will_paginate(@files, params: { active_tab: params[:active_tab], page: params[:page], active_files_tab: params[:active_files_tab] })
BroadcastsChannel.broadcast_file_upload_updates(@broadcast, @files, pagination_content)
update_files_section
end
def destroy
@@ -53,8 +50,23 @@ class BroadcastsController < ApplicationController
end
end
def destroy_file
authorize Broadcast
file = ActiveStorage::Attachment.find(params[:file_id])
file.destroy
update_files_section
end
private
def update_files_section
@files = @broadcast.files.order("created_at DESC").paginate(page: 1)
pagination_content = ApplicationController.render html: helpers.will_paginate(@files, params: { active_tab: params[:active_tab], page: params[:page], active_files_tab: params[:active_files_tab] })
BroadcastsChannel.broadcast_file_upload_updates(@broadcast, @files, pagination_content)
end
def show_splash_screen
render :splash if broadcasts.count.zero?
end

View File

@@ -82,7 +82,7 @@ class ContractTemplatesController < ApplicationController
params
.require(:contract_template)
.permit(:name, :release_type, :body, :guardian_clause,
:signature_legal_text, :fee,
:signature_legal_text, :fee, :amendment_clause,
:applicable_medium_id, :applicable_medium_text,
:territory_id, :territory_text,
:term_id, :term_text, :accessibility,

View File

@@ -50,11 +50,58 @@ class MaterialReleasesController < ApplicationController
private
def person_params
%i[
person_first_name
person_last_name
person_phone
person_company
person_email
person_title
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
guardian_photo
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_photo
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
]
end
def material_release_params
params.require(:material_release).permit(
params.require(:material_release).permit(person_params, guardian_params, second_guardian_params, :minor,
:name, :address_street1, :address_street2, :address_city, :address_state, :address_zip, :address_country,
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
:applicable_medium_id, :applicable_medium_text,
:territory_id, :territory_text,
:term_id, :term_text,

View File

@@ -41,31 +41,70 @@ class Public::AcquiredMediaReleasesController < Public::BaseController
end
end
def person_params
%i[
person_first_name
person_last_name
person_phone
person_fax
person_email
person_title
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
guardian_photo
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_photo
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
]
end
def acquired_media_release_params
params.require(:acquired_media_release).permit(
:name,
:description,
:person_first_name,
:person_last_name,
:person_email,
:person_title,
:person_phone,
:person_fax,
:person_address_street1,
:person_address_street2,
:person_address_city,
:person_address_state,
:person_address_zip,
:person_address_country,
:signature_base64,
:locale, :contract_template,
categories: [],
file_infos_attributes: [
:filename,
:content_type,
:byte_size
]
)
params.require(:acquired_media_release).permit(person_params,
guardian_params,
second_guardian_params,
:minor,
:name,
:description,
:signature_base64,
:locale, :contract_template,
categories: [],
file_infos_attributes: %i[
filename
content_type
byte_size
])
end
def acquired_media_release_params_with_locale

View File

@@ -0,0 +1,47 @@
class Public::AmendmentsController < Public::BaseController
skip_after_action :verify_authorized, :verify_policy_scoped
before_action :set_account, :set_project, :set_contract_template, :set_release
def new
if @release.amendment_signed?
render :create, locals: { already_signed: true }
end
end
def create
if @release.amendment_signed?
render :create, locals: { already_signed: true }
return
end
@release.attributes = amendment_params
render :new unless @release.save(context: :amendment)
end
private
def amendment_params
params.require(releasable_param.name).permit(:amendment_signer_name, :amendment_signature_base64)
end
def releasable_param
@releasable_param ||= ReleasableParam.new(params.to_unsafe_h)
end
def set_release
@release = @contract_template.releases.find(releasable_param.id)
end
def set_contract_template
@contract_template = @project.contract_templates.find(params[:contract_template_id])
end
def set_project
@project = @account.projects.find(params[:project_id])
end
def set_account
@account = Account.find_by(slug: params[:account_id])
end
end

View File

@@ -39,11 +39,59 @@ class Public::MaterialReleasesController < Public::BaseController
authorize material_releases.build(params)
end
def person_params
%i[
person_first_name
person_last_name
person_phone
person_email
person_title
person_company
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
guardian_photo
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_photo
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
]
end
def material_release_params
params.require(:material_release).permit(
params.require(:material_release).permit(person_params, guardian_params, second_guardian_params, :minor,
:name, :address_street1, :address_street2, :address_city, :address_state, :address_zip, :address_country,
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
:signature_base64,
:locale, :contract_template, :description, photos: []
)

View File

@@ -14,6 +14,10 @@ class StreamNotificationsController < ApplicationController
when "video.live_stream.recording"
@broadcast.streamer_recording!
notify_users
when "video.asset.ready"
full_live_stream_playback_uid = notification.dig(:data, :playback_ids, 0, :id)
@broadcast.update(full_live_stream_playback_uid: full_live_stream_playback_uid)
notify_users
when "video.live_stream.active"
@broadcast.active!
notify_users
@@ -59,7 +63,8 @@ class StreamNotificationsController < ApplicationController
end
def set_broadcast
if notification_type == "video.asset.static_renditions.ready"
case notification_type
when "video.asset.static_renditions.ready", "video.asset.ready"
live_stream_id = notification.dig(:stream_notification, :data, :live_stream_id)
@broadcast = Broadcast.find_by(stream_uid: live_stream_id)
else

View File

@@ -11,6 +11,10 @@ class AcquiredMediaRelease < ApplicationRecord
include PersonName
include CsvExportable
include Approvable
include GuardianPhotoable
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
class << self
def custom_csv_exportable_headers
@@ -33,6 +37,38 @@ class AcquiredMediaRelease < ApplicationRecord
%w(person_address_country country)
]
composed_of :guardian_address,
class_name: 'Address',
mapping: [
%w[guardian_address_street1 street1],
%w[guardian_address_street2 street2],
%w[guardian_address_city city],
%w[guardian_address_state state],
%w[guardian_address_zip zip],
%w[guardian_address_country country]
]
composed_of :guardian_2_address,
class_name: 'Address',
mapping: [
%w[guardian_2_address_street1 street1],
%w[guardian_2_address_street2 street2],
%w[guardian_2_address_city city],
%w[guardian_2_address_state state],
%w[guardian_2_address_zip zip],
%w[guardian_2_address_country country]
]
# We don't care for the argument but method WILL receive option name
# when called from inside with_option block, hence * argument
def self.face_photo_acceptable_content_types(*)
['image/png', 'image/jpeg']
end
def self.acceptable_import_file_extensions
['.png', '.jpeg', '.jpg', '.pdf']
end
validates :name, presence: true
validates :person_email, email: true, allow_blank: true
@@ -54,8 +90,8 @@ class AcquiredMediaRelease < ApplicationRecord
# CATEGORIES = ["Artwork", "Film Footage", "Video Footage", "Still Photograph"].freeze
CATEGORIES = ["Film Footage", "Video Footage", "Still Photograph"].freeze
def minor?
false
def second_guardian_present?
guardian_2_first_name.present?
end
def contact_person

View File

@@ -30,6 +30,10 @@ class Broadcast < ApplicationRecord
"https://stream.mux.com/#{stream_playback_uid}.m3u8"
end
def full_live_stream_playback_url
full_live_stream_playback_uid.blank? ? stream_playback_url : "https://stream.mux.com/#{full_live_stream_playback_uid}.m3u8"
end
def stream_server_url
ENV['MUX_BROADCAST_SERVER_URL']
end

View File

@@ -0,0 +1,32 @@
module Amendmenable
extend ActiveSupport::Concern
included do
include ActiveStorageSupport::SupportForBase64
has_one_base64_attached :amendment_signature
with_options on: :amendment do
validates :amendment_signer_name, presence: true
validates :amendment_signature, attached: true
end
end
def amendment_signable?
contract_template.present? && contract_template.amendment_clause.present?
end
def amendment_signed?
amendment_signature.attached?
end
def amendment_signature_base64
nil
end
def amendment_signature_base64=(data_uri)
return if data_uri.blank?
amendment_signature.attach(data: data_uri, filename: "amendment_signature.png", content_type: "image/png", identify: "false")
end
end

View File

@@ -22,6 +22,7 @@ class ContractTemplate < ApplicationRecord
has_rich_text :body
has_rich_text :guardian_clause
has_rich_text :signature_legal_text
has_rich_text :amendment_clause
validates :name, presence: true
validates :release_type, presence: true

View File

@@ -12,6 +12,7 @@ class LocationRelease < ApplicationRecord
include PersonName
include CsvExportable
include Approvable
include Amendmenable
class << self
def custom_csv_exportable_headers

View File

@@ -12,6 +12,11 @@ class MaterialRelease < ApplicationRecord
include PersonName
include CsvExportable
include Approvable
include GuardianPhotoable
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
class << self
def custom_csv_exportable_headers
@@ -30,6 +35,39 @@ class MaterialRelease < ApplicationRecord
%w(person_address_country country)
]
composed_of :guardian_address,
class_name: 'Address',
mapping: [
%w[guardian_address_street1 street1],
%w[guardian_address_street2 street2],
%w[guardian_address_city city],
%w[guardian_address_state state],
%w[guardian_address_zip zip],
%w[guardian_address_country country]
]
composed_of :guardian_2_address,
class_name: 'Address',
mapping: [
%w[guardian_2_address_street1 street1],
%w[guardian_2_address_street2 street2],
%w[guardian_2_address_city city],
%w[guardian_2_address_state state],
%w[guardian_2_address_zip zip],
%w[guardian_2_address_country country]
]
# We don't care for the argument but method WILL receive option name
# when called from inside with_option block, hence * argument
def self.face_photo_acceptable_content_types(*)
['image/png', 'image/jpeg']
end
def self.acceptable_import_file_extensions
['.png', '.jpeg', '.jpg', '.pdf']
end
validates :name, presence: true
validates :person_email, email: true, allow_blank: true
@@ -47,8 +85,8 @@ class MaterialRelease < ApplicationRecord
@contact_person ||= Contact.new(person_name, person_address, person_email, person_phone)
end
def minor?
false
def second_guardian_present?
guardian_2_first_name.present?
end
def uses_edl?

View File

@@ -18,4 +18,12 @@ class BroadcastPolicy < ApplicationPolicy
def update?
true
end
def destroy_file?
if user.nil? || user.user.nil?
return false
end
user.manager? || user.account_manager?
end
end

View File

@@ -39,6 +39,10 @@ class LocationReleasePolicy < ReleasePolicy
user.account_manager?
end
def sign_amendment?
user.manager? || user.account_manager?
end
def approve?
review?
end

View File

@@ -1,6 +1,10 @@
<%= errors_summary_for acquired_media_release %>
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= field_set_tag content_tag(:span, t(".acquired_media_details.heading"), class: "h6 text-muted text-uppercase") do %>
<%= form.form_group :minor do %>
<%= form.check_box :minor, label: t("helpers.label.talent_release.minor"), data: { target: "[data-ujs-target=guardian-fields]", toggle: "collapse" } %>
<% end %>
<div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
</div>
@@ -9,6 +13,28 @@
<%= form.check_box :categories, { multiple: true, label: category }, category, false %>
<% end %>
<% end %>
<div class="<%= class_string("collapse" => !acquired_media_release.minor?) %>" data-ujs-target="guardian-fields">
<%= card_field_set_tag t(".guardian_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: acquired_media_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_last_name, required: acquired_media_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian" %>
<% end %>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
</div>
<% end %>
<hr>
@@ -19,6 +45,44 @@
<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 %>
<div class="<%= class_string("collapse" => !acquired_media_release.minor?) %>" data-ujs-target="guardian-fields">
<br>
<div class="text-left">
<p><%= t(".photos.guardian_photo.heading") %></p>
<div id="guardian-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if acquired_media_release.guardian_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-photo-preview", "<%= url_for(acquired_media_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if acquired_media_release.guardian_photo.attached?%>
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: acquired_media_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
<p><%= t(".photos.guardian_2_photo.heading") %></p>
<div id="guardian-2-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if acquired_media_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-2-photo-preview", "<%= url_for(acquired_media_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if acquired_media_release.guardian_2_photo.attached?%>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, help: "PNG or JPG only", accept: acquired_media_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
</div>
<hr>
</div>
<% end %>
<hr>

View File

@@ -1,12 +1,25 @@
<li class="my-2" id="<%= dom_id(file) %>">
<% if file.variable? %>
<%= link_to image_tag(file.variant(resize_and_pad: [300, 300, background: "#F7F8F9"]), class: "bg-light img-thumbnail img-fluid"), file, target: "_blank" %>
<% else %>
<div class="border rounded bg-light text-muted d-flex justify-content-center align-items-center fix-h-and-w">
<%= link_to file, target: "_blank" do %>
<%= fa_icon("file", style: "font-size: 2rem") %>
<div class="mt-2"><%= file.filename %></div>
<div class="row">
<% broadcast = file.record %>
<% show_delete = controller.class.module_parent.to_s == "Public" ? false : policy(broadcast).destroy_file? %>
<% file_class = show_delete ? "col-8" : "col-12" %>
<div class="<%= file_class %>">
<li class="my-2" id="<%= dom_id(file) %>">
<% if file.variable? %>
<%= link_to image_tag(file.variant(resize_and_pad: [300, 300, background: "#F7F8F9"]), class: "bg-light img-thumbnail img-fluid"), file, target: "_blank" %>
<% else %>
<div class="border rounded bg-light text-muted d-flex justify-content-center align-items-center img-fluid fix-h-and-w">
<%= link_to file, target: "_blank" do %>
<%= fa_icon("file", style: "font-size: 2rem") %>
<div class="mt-2"><%= file.filename %></div>
<% end %>
</div>
<% end %>
</li>
</div>
<% if show_delete %>
<div class="col-4 align-self-center p-0 m-0">
<% url = url_for [:destroy_file, broadcast.project, broadcast, { file_id: file.id }] %>
<%= link_to fa_icon("trash fw", text: t('.actions.delete_file')), url, class: "btn btn-danger", remote: true, method: :delete, data: { confirm: t('.confirm_delete') } %>
</div>
<% end %>
</li>
</div>

View File

@@ -1,7 +1,7 @@
<% if broadcast.streamer_recording? && broadcast.active? %>
<div id="broadcast_video" class="embed-responsive-item"></div>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
<% else %>
<div id="broadcast_video" class="embed-responsive-item">
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream">
<table class="w-100 h-100 bg-secondary">
<tbody>
<tr>

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(appearance talent 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) } }, 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), "#custom_fields": %w(medical misc), "#amendment_clause": %w(location) } }, class: "form-control custom-select" %>
</div>
<div class="form-row mb-3">
<%= form.radio_button :accessibility, :public_template, label: "Public", wrapper_class: "mr-3" %>
@@ -29,6 +29,11 @@
<%= form.rich_text_area :guardian_clause %>
<% end %>
</div>
<div id="amendment_clause">
<%= form.form_group do %>
<%= form.rich_text_area :amendment_clause %>
<% end %>
</div>
<div id="signature_legal_text">
<%= form.form_group do %>
<%= form.rich_text_area :signature_legal_text %>

View File

@@ -6,7 +6,8 @@
<%= link_to t(".actions.book_demo"), 'https://meetings.hubspot.com/bray2', class: "btn btn-primary border align-self-center h-50 ml-auto mr-2 pb-2", target: '_blank' %>
<% if policy(ContractTemplate).new? %>
<%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 pb-2" %>
<%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 mr-2 pb-2" %>
<%= link_to t(".actions.import_template"), [:new, @project, :release_template_imports], class: "btn btn-light border align-self-center h-50 pb-2" %>
<% end %>
</div>
@@ -47,4 +48,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,19 @@
<% if preview %>
<h1>PREVIEW ONLY</h1>
<% end %>
<p class="heading"><strong><u><%= t '.heading' %></u></strong></p>
<dl>
<%= description_list_pair "#{t('.description_labels.amendment_clause')}:", releasable.contract_template.amendment_clause %>
<%= description_list_pair "#{t('.description_labels.amendment_signer_name')}:", releasable.amendment_signer_name %>
<dt><%= t('.description_labels.amendment_signature') %>:</dt>
<dd>
<% if preview %>
<%= image_tag dummy_signature %>
<% elsif releasable.amendment_signature.attached? %>
<%= image_tag releasable.amendment_signature.variant(auto_orient: true, resize: "200x200") %>
<% end %>
</dd>
</dl>

View File

@@ -18,10 +18,14 @@
<% 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 %>
<%= description_list_pair t(".labels.#{releasable.model_name.param_key}.name", default: "Name"), releasable.name, append: ":" %>
<% if releasable.model_name == "LocationRelease" %>
<%= description_list_pair "Location Address:", releasable.address %>
<%= description_list_pair "Owner Name", releasable.person_name, append: ":" %>
<% end %>
<%= description_list_pair t(".labels.#{releasable.model_name.param_key}.contact_person_address", default: "Contact Address"), releasable.contact_person.address, append: ":" %>
<%= description_list_pair t(".labels.#{releasable.model_name.param_key}.contact_person_phone", default: "Contact Phone"), releasable.contact_person.phone, append: ":" %>
<%= description_list_pair t(".labels.#{releasable.model_name.param_key}.contact_person_email", default: "Contact Email"), releasable.contact_person.email, append: ":" %>
<% if releasable.model_name == "AppearanceRelease" %>
<%= description_list_pair "Person Date of Birth:", releasable&.person_date_of_birth&.strftime("%D") %>
<% end %>

View File

@@ -26,6 +26,12 @@
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
</div>
<% if releasable.respond_to?(:amendment_signed?) && releasable.amendment_signed? %>
<div class="page">
<%= render "contracts/amendment_page", releasable: releasable, preview: preview %>
</div>
<%end %>
<% if releasable.respond_to?(:approved?) && releasable.approved? %>
<div class="page">
<%= render "contracts/for_office_use_only", releasable: releasable, preview: preview %>

View File

@@ -3,6 +3,6 @@
<%= render "shared/files_dropzone_fields", form: form, directory: directory %>
<% end %>
<div class="pt-3">
<%= form.submit t(".submit"), class: "btn btn-block btn-success", data: { disable_with: t("shared.disable_with") } %>
<%= form.submit t(".submit"), id: "upload_directory_files", class: "btn btn-block btn-success", data: { disable_with: t("shared.disable_with") } %>
</div>
<% end %>

View File

@@ -30,6 +30,17 @@
<td>
<%= location_release.signed_on %>
</td>
<td class="text-center">
<% if location_release.amendment_signed? %>
<i class="fa fa-check-square-o text-dark"
data-toggle="tooltip"
title="<%= t '.messages.amendment_signed_tooltip' %>"></i>
<% elsif location_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">
@@ -44,6 +55,9 @@
<% if policy(location_release).edit_photos? %>
<%= link_to fa_icon("picture-o fw", text: "Photos"), [:edit, location_release, :photos], class: "dropdown-item" %>
<% end %>
<% if policy(location_release).sign_amendment? && location_release.amendment_signable? && !location_release.amendment_signed? %>
<%= link_to fa_icon("file-text fw", text: t('.actions.sign_amendment')), [:new, location_release.project.account, location_release.project, location_release.contract_template, location_release, :amendment], class: "dropdown-item", target: "_blank" %>
<% end %>
<% if policy(Contract).show? && (location_release.contract.attached? || location_release.contract_template.present?) %>
<%= link_to fa_icon("download fw", text: "Download"), [location_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
<% end %>

View File

@@ -28,12 +28,12 @@
<th data-behavior="all-selectable"><%= check_box_tag "location_release_ids[]", false, false %></th>
<th><%= t '.table_headers.approved'%></th>
<th></th>
<th><%= LocationRelease.human_attribute_name(:name) %></th>
<th><%= t(".table_headers.name") %></th>
<th><%= t(".table_headers.address") %>
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>
<th><%= t(".table_headers.signed_at") %></th>
<th><%= t(".table_headers.signed_at") %></th>
<th><%= t(".table_headers.amendment_signed") %></th>
<th></th>
</tr>
</thead>

View File

@@ -12,6 +12,9 @@
<hr>
<%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %>
<%= form.form_group :minor do %>
<%= form.check_box :minor, label: t("helpers.label.material_release.minor"), data: { target: "[data-ujs-target=guardian-fields]", toggle: "collapse" } %>
<% end %>
<div class="form-row">
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
@@ -21,6 +24,28 @@
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "person" %>
<div class="<%= class_string("collapse" => !material_release.minor?) %>" data-ujs-target="guardian-fields">
<%= card_field_set_tag t(".guardian_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: material_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_last_name, required: material_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian" %>
<% end %>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
</div>
<% end %>
<hr>
@@ -34,6 +59,44 @@
<%= field_set_tag content_tag(:span, t(".photos.heading"), class: "h6 text-muted text-uppercase") do %>
<%= render "shared/photos_dropzone_fields", form: form, release: material_release %>
<div class="<%= class_string("collapse" => !material_release.minor?) %>" data-ujs-target="guardian-fields">
<br>
<div class="text-left">
<p><%= t(".photos.guardian_photo.heading") %></p>
<div id="guardian-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if material_release.guardian_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-photo-preview", "<%= url_for(material_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if material_release.guardian_photo.attached?%>
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: material_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
<p><%= t(".photos.guardian_2_photo.heading") %></p>
<div id="guardian-2-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if material_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-2-photo-preview", "<%= url_for(material_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if material_release.guardian_2_photo.attached?%>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, help: "PNG or JPG only", accept: material_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
</div>
<hr>
</div>
<% end %>
<div class="row align-items-center text-center mt-4">

View File

@@ -13,6 +13,17 @@
<hr>
<% unless @contract_template.guardian_clause.blank? %>
<%= form.form_group :minor do %>
<%= form.check_box :minor, label: t("helpers.label.appearance_release.minor"), data: { behavior: "update-required-status", target: "[data-ujs-target=guardian-fields]", toggle: "collapse" } %>
<% end %>
<%= card_field_set_tag t(".guardian_clause.heading") do %>
<p><%= @contract_template.guardian_clause %></p>
<% end %>
<hr>
<% end %>
<%= card_field_set_tag t(".acquired_media_info.heading") do %>
<div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
@@ -49,6 +60,91 @@
<hr>
<% unless @contract_template.guardian_clause.blank? %>
<div class="<%= class_string("collapse" => !@acquired_media_release.minor?) %>" data-ujs-target="guardian-fields">
<%= card_field_set_tag t(".guardian_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: @acquired_media_release.minor?, wrapper_class: "col-sm-3", data: { required_tag: "guardian" } %>
<%= form.text_field :guardian_last_name, required: @acquired_media_release.minor?, wrapper_class: "col-sm-3", data: { required_tag: "guardian" } %>
<%= form.phone_field :guardian_phone, required: @acquired_media_release.minor?, wrapper_class: "col-sm-6", data: { required_tag: "guardian" } %>
<%= form.text_field :guardian_email, required: @acquired_media_release.minor?, wrapper_class: "col-sm-6", data: { required_tag: "guardian" } %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian", required: @acquired_media_release.minor?, data: { required_tag: "guardian" } %>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_photo.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".guardian_photo.instructions" %></div>
<div class="text-center">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span><%= t ".photo.no_photo" %></span>
</div>
</div>
<div class="d-inline-block text-left">
<% if @acquired_media_release.guardian_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(@acquired_media_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="hidden-file-input">
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if @acquired_media_release.guardian_photo.attached? %>
<%= form.file_field :guardian_photo, required: @acquired_media_release.minor?, hide_label: true, data: { ujs_target: "guardian-photo-input" }, accept: @acquired_media_release.class.face_photo_acceptable_content_types.join(","), direct_upload: true %>
</div>
<%= button_tag t(".photo.take_photo"), type: "button", class: "btn btn-lg btn-primary take-photo-button", data: { behavior: "trigger-click", target: "[data-ujs-target=guardian-photo-input]" } %>
</div>
<p class="p-2 font-weight-bold">
<small class="text-muted"><%= t ".photo.warning" %></small>
</p>
</div>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_photo.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".guardian_2_photo.instructions" %></div>
<div class="text-center">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span><%= t ".photo.no_photo" %></span>
</div>
</div>
<div class="d-inline-block text-left">
<% if @acquired_media_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(@acquired_media_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="hidden-file-input">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if @acquired_media_release.guardian_2_photo.attached? %>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, accept: @acquired_media_release.class.face_photo_acceptable_content_types.join(","), direct_upload: true %>
</div>
<%= button_tag t(".photo.take_photo"), type: "button", class: "btn btn-lg btn-primary take-photo-button", data: { behavior: "trigger-click", target: "[data-ujs-target=guardian-2-photo-input]" } %>
</div>
<p class="p-2 font-weight-bold">
<small class="text-muted"><%= t ".photo.warning" %></small>
</p>
</div>
<% end %>
<hr>
</div>
<% end %>
<%= card_field_set_tag t(".signature.heading") do %>
<%= render "shared/signature_fields", form: form, signature_legal_text: @contract_template.signature_legal_text %>
<% end %>

View File

@@ -0,0 +1,3 @@
<% message = local_assigns[:already_signed] ? t('.amendment_already_signed_message') : t('.amendment_signed_message') %>
<% alert_type = local_assigns[:already_signed] ? "alert-warning" : "alert-success" %>
<p class="alert <%= alert_type %> p-3 lead text-center"><%= message %></p>

View File

@@ -0,0 +1,30 @@
<button type="button" class="btn btn-success mb-3" data-behavior="clipboard" href="<%= polymorphic_url [:new, @account, @project, @contract_template, @release, :amendment] %>">
<i class="fa fa-clipboard"></i>
<%= t '.copy_url' %>
</button>
<div class="card shadow-sm">
<div class="card-body">
<%= errors_summary_for @release %>
<%= bootstrap_form_with model: @release, method: :post, url: public_send("account_project_contract_template_#{@contract_template.release_type}_release_amendments_path"), local: true do |form| %>
<%= card_field_set_tag t(".amendment.heading") do %>
<p><%= @contract_template.amendment_clause %></p>
<% end %>
<hr>
<div class="form-row">
<%= form.text_field :amendment_signer_name, required: true, wrapper_class: "col-sm-6" %>
</div>
<%= card_field_set_tag t(".signature.heading") do %>
<%= render "shared/signature_fields", signature_field: :amendment_signature_base64, form: form %>
<% end %>
<div class="mt-5">
<%= form.button t("shared.submit_release_long"), class: "btn btn-block btn-lg btn-success", data: { disable_with: t("shared.disable_with") } %>
</div>
<% end %>
</div>
</div>

View File

@@ -13,6 +13,17 @@
<hr>
<% unless @contract_template.guardian_clause.blank? %>
<%= form.form_group :minor do %>
<%= form.check_box :minor, label: t("helpers.label.appearance_release.minor"), data: { behavior: "update-required-status", target: "[data-ujs-target=guardian-fields]", toggle: "collapse" } %>
<% end %>
<%= card_field_set_tag t(".guardian_clause.heading") do %>
<p><%= @contract_template.guardian_clause %></p>
<% end %>
<hr>
<% end %>
<%= card_field_set_tag t(".release_info.heading") do %>
<div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
@@ -40,6 +51,91 @@
<hr>
<% unless @contract_template.guardian_clause.blank? %>
<div class="<%= class_string("collapse" => !@material_release.minor?) %>" data-ujs-target="guardian-fields">
<%= card_field_set_tag t(".guardian_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: @material_release.minor?, wrapper_class: "col-sm-3", data: { required_tag: "guardian" } %>
<%= form.text_field :guardian_last_name, required: @material_release.minor?, wrapper_class: "col-sm-3", data: { required_tag: "guardian" } %>
<%= form.phone_field :guardian_phone, required: @material_release.minor?, wrapper_class: "col-sm-6", data: { required_tag: "guardian" } %>
<%= form.text_field :guardian_email, required: @material_release.minor?, wrapper_class: "col-sm-6", data: { required_tag: "guardian" } %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian", required: @material_release.minor?, data: { required_tag: "guardian" } %>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_photo.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".guardian_photo.instructions" %></div>
<div class="text-center">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span><%= t ".photo.no_photo" %></span>
</div>
</div>
<div class="d-inline-block text-left">
<% if @material_release.guardian_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(@material_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="hidden-file-input">
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if @material_release.guardian_photo.attached? %>
<%= form.file_field :guardian_photo, required: @material_release.minor?, hide_label: true, data: { ujs_target: "guardian-photo-input" }, accept: @material_release.class.face_photo_acceptable_content_types.join(","), direct_upload: true %>
</div>
<%= button_tag t(".photo.take_photo"), type: "button", class: "btn btn-lg btn-primary take-photo-button", data: { behavior: "trigger-click", target: "[data-ujs-target=guardian-photo-input]" } %>
</div>
<p class="p-2 font-weight-bold">
<small class="text-muted"><%= t ".photo.warning" %></small>
</p>
</div>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_photo.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".guardian_2_photo.instructions" %></div>
<div class="text-center">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span><%= t ".photo.no_photo" %></span>
</div>
</div>
<div class="d-inline-block text-left">
<% if @material_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(@material_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="hidden-file-input">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if @material_release.guardian_2_photo.attached? %>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, accept: @material_release.class.face_photo_acceptable_content_types.join(","), direct_upload: true %>
</div>
<%= button_tag t(".photo.take_photo"), type: "button", class: "btn btn-lg btn-primary take-photo-button", data: { behavior: "trigger-click", target: "[data-ujs-target=guardian-2-photo-input]" } %>
</div>
<p class="p-2 font-weight-bold">
<small class="text-muted"><%= t ".photo.warning" %></small>
</p>
</div>
<% end %>
<hr>
</div>
<% end %>
<%= card_field_set_tag t(".signature.heading") do %>
<%= render "shared/signature_fields", form: form, instruction: 'For Owner or Authorized Signatory', signature_legal_text: @contract_template.signature_legal_text %>
<% end %>

View File

@@ -1,3 +1,4 @@
<% signature_field = local_assigns[:signature_field] ? local_assigns[:signature_field] : :signature_base64 %>
<canvas class="border bg-light w-100" data-behavior="digital-signature" data-signature-input="[data-ujs-target=signature-input]" style="height: 150px"></canvas>
<% if local_assigns[:instruction] %>
@@ -6,7 +7,7 @@
</small>
<% end %>
<%= form.hidden_field :signature_base64, data: { ujs_target: "signature-input" } %>
<%= form.hidden_field signature_field, data: { ujs_target: "signature-input" } %>
<div class="text-right">
<%= button_tag class: "btn btn-sm btn-danger", data: { behavior: "clear-digital-signature" } do %>
<%= fa_icon "refresh" %> <%= t "shared.clear" %>

View File

@@ -46,6 +46,15 @@ en:
heading: 3 of 3 Contract & Exploitable Rights
files:
heading: 2 of 3 Files
guardian_2_info:
heading: Second Guardian Information (if company requires)
guardian_info:
heading: Guardian Information
photos:
guardian_2_photo:
heading: Second Guardian Photo
guardian_photo:
heading: Guardian Photo
index:
actions:
new: Import Release
@@ -214,6 +223,10 @@ en:
destroy:
alert: A live stream has been deleted
api_error: Something went wrong, please try again later after some time
file:
actions:
delete_file: Delete
confirm_delete: Are you sure?
index:
actions:
new: Create New Live Stream
@@ -307,6 +320,7 @@ en:
actions:
book_demo: Schedule a Demo
create_template: Create New Release Template
import_template: Import Template
headings:
benefits: Benefits
how_it_works: How It Works
@@ -323,6 +337,12 @@ en:
update:
notice: The release template has been updated
contracts:
amendment_page:
description_labels:
amendment_clause: Amendment Clause
amendment_signature: Amendment Signature
amendment_signer_name: Amendment Signer Name
heading: Amendment
for_office_use_only:
description_labels:
date_issued: Date Issued
@@ -347,6 +367,12 @@ en:
signature_page:
heading: Signature Page
instructions: "By signing this signature page, as of the date listed below, I hereby agree, acknowledge and accept the terms and conditions listed in this %{releasable_name}."
labels:
location_release:
contact_person_address: Owner Address
contact_person_email: Owner Email
contact_person_phone: Owner Phone
name: Location Name
directories:
destroy:
alert: The folder has been deleted
@@ -405,6 +431,7 @@ en:
helpers:
help:
contract_template:
amendment_clause: Leave blank if not required for this contract
fee: Leave at $0.00 for no-fee
guardian_clause: Leave blank if not required for this contract
signature_legal_text: Leave blank if not required for this contract
@@ -418,6 +445,27 @@ en:
label:
acquired_media_release:
description: Description of property
guardian_2_address_city: Guardian 2 city
guardian_2_address_country: Guardian 2 country
guardian_2_address_state: Guardian 2 state
guardian_2_address_street1: Guardian 2 address
guardian_2_address_street2: Guardian 2 address (Line 2)
guardian_2_address_zip: Guardian 2 zip code
guardian_2_email: Guardian 2 email
guardian_2_first_name: Guardian 2 first name
guardian_2_last_name: Guardian 2 last name
guardian_2_phone: Guardian 2 phone
guardian_address_city: Guardian city
guardian_address_country: Guardian country
guardian_address_state: Guardian state
guardian_address_street1: Guardian address
guardian_address_street2: Guardian address (Line 2)
guardian_address_zip: Guardian zip code
guardian_email: Guardian email
guardian_first_name: Guardian first name
guardian_last_name: Guardian last name
guardian_phone: Guardian phone
minor: Is the person a minor?
name: Name of property
person_address: Address
person_address_city: City
@@ -463,6 +511,8 @@ en:
person_last_name: Last name
person_name: Name
person_phone: Phone number
contract_template:
amendment_clause: Additional Contract Clause
location_release:
address_city: City
address_country: Country
@@ -483,6 +533,27 @@ en:
person_last_name: Owner last name
material_release:
description: Description of licensed material
guardian_2_address_city: Guardian 2 city
guardian_2_address_country: Guardian 2 country
guardian_2_address_state: Guardian 2 state
guardian_2_address_street1: Guardian 2 address
guardian_2_address_street2: Guardian 2 address (Line 2)
guardian_2_address_zip: Guardian 2 zip code
guardian_2_email: Guardian 2 email
guardian_2_first_name: Guardian 2 first name
guardian_2_last_name: Guardian 2 last name
guardian_2_phone: Guardian 2 phone
guardian_address_city: Guardian city
guardian_address_country: Guardian country
guardian_address_state: Guardian state
guardian_address_street1: Guardian address
guardian_address_street2: Guardian address (Line 2)
guardian_address_zip: Guardian zip code
guardian_email: Guardian email
guardian_first_name: Guardian first name
guardian_last_name: Guardian last name
guardian_phone: Guardian phone
minor: Is the person a minor?
name: Name of licensed material
person_address: Address
person_address_city: City
@@ -703,6 +774,8 @@ en:
acquired_media_release:
create: Import Release
update: Save Changes
acquired_media_releases:
create: Import Release
appearance_release:
create: Import Release
update: Save Changes
@@ -771,8 +844,9 @@ en:
empty: Location Releases will appear here
table_headers:
address: Address
amendment_signed: Additional Clause
approved: Approved
name: Name
name: Location Name
notes: Notes
signed_at: Date Signed
tags: Tags
@@ -780,7 +854,10 @@ en:
actions:
manage: Manage
review: Review
sign_amendment: Sign Additional Clause
messages:
amendment_not_signed_tooltip: Amendment not yet signed
amendment_signed_tooltip: Amendment Signed
approved_tooltip: Approved by %{user} on %{timestamp}
no_photos: Needs Photo
new:
@@ -797,10 +874,18 @@ en:
form:
contract_and_rights:
heading: 3 of 4 Contract & Exploitable Rights
guardian_2_info:
heading: Second Guardian Information (if company requires)
guardian_info:
heading: Guardian Information
material_details:
heading: 1 of 3 Material Details
photos:
dropzone_label: Tap to take a photo of Licensed Material (optional)
guardian_2_photo:
heading: Second Guardian Photo
guardian_photo:
heading: Guardian Photo
heading: 4 of 4 Photos
signer_details:
heading: 2 of 4 Licensor/Owner Details
@@ -1021,10 +1106,38 @@ en:
cancel: Cancel
files:
heading: File Information
guardian_2_info:
heading: Second Guardian Information (if company requires)
guardian_2_photo:
heading: Second Guardian Photo
instructions: >
Lastly, it's time for second guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese!
guardian_clause:
heading: Guardian Clause
guardian_info:
heading: Guardian Information
guardian_photo:
heading: Guardian Photo
instructions: >
Lastly, it's time for guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese!
legal:
heading: Legal
personal_info:
heading: Licensor/Owner Contact Information
photo:
no_photo: No photo yet
take_photo: Take Photo
warning: If your photo appears sideways, it will be autocorrected when you submit your release.
signature:
heading: Signature
amendments:
create:
amendment_already_signed_message: Release amendment is already signed!
amendment_signed_message: Release amendment signed successfully! Thank you
new:
amendment:
heading: Additional Clause
copy_url: Copy sign amendment URL
signature:
heading: Signature
appearance_releases:
@@ -1100,10 +1213,27 @@ en:
cancel: Cancel
contact_info:
heading: Licensor/Owner Contact Information
guardian_2_info:
heading: Second Guardian Information (if company requires)
guardian_2_photo:
heading: Second Guardian Photo
instructions: >
Lastly, it's time for second guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese!
guardian_clause:
heading: Guardian Clause
guardian_info:
heading: Guardian Information
guardian_photo:
heading: Guardian Photo
instructions: >
Lastly, it's time for guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese!
legal:
heading: Legal
photo:
heading: Photos
no_photo: No photo yet
take_photo: Take Photo
warning: If your photo appears sideways, it will be autocorrected when you submit your release.
release_info:
heading: Release Information
signature:

View File

@@ -2,6 +2,18 @@ es:
acquired_media_releases:
acquired_media_release:
no_media: No Media (ES)
create:
notice: The acquired media release has been created (ES)
form:
guardian_2_info:
heading: Guardian Information (if company requires) [ES]
guardian_info:
heading: Guardian Information (ES)
photos:
guardian_2_photo:
heading: Second Guardian Photo
guardian_photo:
heading: Guardian Photo
index:
table_headers:
file_infos_count: No. Files (ES)
@@ -81,6 +93,10 @@ es:
do_not_copy_warning: "Do not copy (ES)"
serial_number_label: "Serial Number (ES)"
broadcasts:
file:
actions:
delete_file: Delete
confirm_delete: Are you sure? (ES)
show:
actions:
reset_url: Reset URL (ES)
@@ -148,6 +164,12 @@ es:
update:
notice: The release template has been updated (ES)
contracts:
amendment_page:
description_labels:
amendment_clause: Amendment Clause (ES)
amendment_signature: Amendment Signature (ES)
amendment_signer_name: Amendment Signer Name (ES)
heading: Amendment (ES)
for_office_use_only:
description_labels:
date_issued: Date Issued (ES)
@@ -207,10 +229,34 @@ es:
helpers:
help:
contract_template:
amendment_clause: Leave blank if not required for this contract (ES)
fee: Leave at $0.00 for no-fee (ES)
guardian_clause: Leave blank if not required for this contract (ES)
signature_legal_text: Leave blank if not required for this contract (ES)
label:
acquired_media_release:
guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES)
guardian_2_address_state: Guardian 2 state (ES)
guardian_2_address_street1: Guardian 2 address (ES)
guardian_2_address_street2: Guardian 2 address (Line 2) (ES)
guardian_2_address_zip: Guardian 2 zip code (ES)
guardian_2_email: Guardian 2 email (ES)
guardian_2_first_name: Guardian 2 first name (ES)
guardian_2_last_name: Guardian 2 last name (ES)
guardian_2_phone: Guardian 2 phone (ES)
guardian_address_city: Guardian city (ES)
guardian_address_country: Guardian country (ES)
guardian_address_state: Guardian state (ES)
guardian_address_street1: Dirección del tutor legal
guardian_address_street2: Dirección del tutor legal (Línea 2)
guardian_address_zip: Guardian zip code (ES)
guardian_email: Guardian email (ES)
guardian_first_name: Guardian first name (ES)
guardian_last_name: Guardian last name (ES)
guardian_name: Nómbre del tutor legal
guardian_phone: Número de teléfono del tutor legal
minor: El firmante es un menor
appearance_release:
guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES)
@@ -239,6 +285,31 @@ es:
person_email: Dirección de correo electrónico
person_name: Nómbre
person_phone: Número de teléfono
contract_template:
amendment_clause: Additional Contract Clause (ES)
material_release:
guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES)
guardian_2_address_state: Guardian 2 state (ES)
guardian_2_address_street1: Guardian 2 address (ES)
guardian_2_address_street2: Guardian 2 address (Line 2) (ES)
guardian_2_address_zip: Guardian 2 zip code (ES)
guardian_2_email: Guardian 2 email (ES)
guardian_2_first_name: Guardian 2 first name (ES)
guardian_2_last_name: Guardian 2 last name (ES)
guardian_2_phone: Guardian 2 phone (ES)
guardian_address_city: Guardian city (ES)
guardian_address_country: Guardian country (ES)
guardian_address_state: Guardian state (ES)
guardian_address_street1: Dirección del tutor legal
guardian_address_street2: Dirección del tutor legal (Línea 2)
guardian_address_zip: Guardian zip code (ES)
guardian_email: Guardian email (ES)
guardian_first_name: Guardian first name (ES)
guardian_last_name: Guardian last name (ES)
guardian_name: Nómbre del tutor legal
guardian_phone: Número de teléfono del tutor legal
minor: El firmante es un menor
medical_release:
guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES)
@@ -317,6 +388,8 @@ es:
person_name: Jane Doe
person_phone: 555-555-5555
submit:
acquired_media_releases:
create: Import Release (ES)
appearance_release:
create: Crear Autorización
broadcast:
@@ -325,6 +398,8 @@ es:
contract_template:
update: Save changes (ES)
create: 'Crear %{model}'
material_release:
create: Import Release (ES)
medical_release:
update: Approve (ES)
update: 'Actualizar %{model}'
@@ -335,13 +410,30 @@ es:
index:
table_headers:
address: Address (ES)
amendment_signed: Additional Clause (ES)
notes: Notes (ES)
signed_at: Date Signed (ES)
tags: Tags (ES)
location_release:
actions:
sign_amendment: Sign Additional Clause (ES)
messages:
amendment_not_signed_tooltip: Amendment not yet signed (ES)
amendment_signed_tooltip: Amendment Signed (ES)
material_releases:
create:
notice: The acquired media release has been created (ES)
form:
guardian_2_info:
heading: Guardian Information (if company requires) [ES]
guardian_info:
heading: Guardian Information (ES)
photos:
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES)
guardian_2_photo:
heading: Second Guardian Photo
guardian_photo:
heading: Guardian Photo
index:
table_headers:
name: Name (ES)
@@ -384,6 +476,36 @@ es:
signed_at: Date Signed (ES)
tags: Tags (ES)
public:
acquired_media_releases:
new:
guardian_2_info:
heading: Second Guardian Information (if company requires) [ES]
guardian_2_photo:
heading: Second Guardian Photo (ES)
instructions: >
(ES) Lastly, it's time for second guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese! (ES)
guardian_clause:
heading: Guardian Clause (ES)
guardian_info:
heading: Guardian Information (ES)
guardian_photo:
heading: Guardian Photo (ES)
instructions: >
(ES) Lastly, it's time for guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese! (ES)
photo:
no_photo: No photo yet (ES)
take_photo: Take Photo (ES)
warning: If your photo appears sideways, it will be autocorrected when you submit your release. (ES)
amendments:
create:
amendment_already_signed_message: Release amendment is already signed! (ES)
amendment_signed_message: Release amendment signed successfully! Thank you (ES)
new:
amendment:
heading: Additional Clause (ES)
copy_url: Copy sign amendment URL (ES)
signature:
heading: Signature (ES)
appearance_releases:
create:
notice: La autorización está firmada. ¡Gracias!
@@ -423,8 +545,25 @@ es:
heading: Photos (ES)
material_releases:
new:
guardian_2_info:
heading: Second Guardian Information (if company requires) [ES]
guardian_2_photo:
heading: Second Guardian Photo (ES)
instructions: >
(ES) Lastly, it's time for second guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese! (ES)
guardian_clause:
heading: Guardian Clause (ES)
guardian_info:
heading: Guardian Information (ES)
guardian_photo:
heading: Guardian Photo (ES)
instructions: >
(ES) Lastly, it's time for guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese! (ES)
photo:
heading: Photos (ES)
no_photo: No photo yet (ES)
take_photo: Take Photo (ES)
warning: If your photo appears sideways, it will be autocorrected when you submit your release. (ES)
medical_releases:
new:
guardian_2_info:

View File

@@ -96,6 +96,9 @@ Rails.application.routes.draw do
end
resources :projects, only: [] do
resources :broadcasts, except: [:edit] do
member do
delete :destroy_file
end
resource :zoom_meeting, only: [:show]
end
resources :directories, except: [:index] do
@@ -128,7 +131,9 @@ Rails.application.routes.draw do
resources :talent_releases, only: [:new, :create]
resources :appearance_releases, only: [:new, :create]
resources :acquired_media_releases, only: [:new, :create]
resources :location_releases, only: [:new, :create]
resources :location_releases, only: [:new, :create] do
resources :amendments, only: [:new, :create]
end
resources :material_releases, only: [:new, :create]
resources :medical_releases, only: [:new, :create]
resources :misc_releases, only: [:new, :create]

View File

@@ -0,0 +1,5 @@
class AddFullLiveStreamPlaybackUrlToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :full_live_stream_playback_uid, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddAmendmentSignerDetailsToLocationReleases < ActiveRecord::Migration[6.0]
def change
add_column :location_releases, :amendment_signer_name, :string
end
end

View File

@@ -0,0 +1,25 @@
class AddGuardiansFieldsToAcquiredMediaReleases < ActiveRecord::Migration[6.0]
def change
add_column :acquired_media_releases, :minor, :boolean, default: false
add_column :acquired_media_releases, :guardian_first_name, :string
add_column :acquired_media_releases, :guardian_last_name, :string
add_column :acquired_media_releases, :guardian_email, :string
add_column :acquired_media_releases, :guardian_phone, :string
add_column :acquired_media_releases, :guardian_address_street1, :string
add_column :acquired_media_releases, :guardian_address_street2, :string
add_column :acquired_media_releases, :guardian_address_city, :string
add_column :acquired_media_releases, :guardian_address_state, :string
add_column :acquired_media_releases, :guardian_address_zip, :string
add_column :acquired_media_releases, :guardian_address_country, :string
add_column :acquired_media_releases, :guardian_2_first_name, :string
add_column :acquired_media_releases, :guardian_2_last_name, :string
add_column :acquired_media_releases, :guardian_2_email, :string
add_column :acquired_media_releases, :guardian_2_phone, :string
add_column :acquired_media_releases, :guardian_2_address_street1, :string
add_column :acquired_media_releases, :guardian_2_address_street2, :string
add_column :acquired_media_releases, :guardian_2_address_city, :string
add_column :acquired_media_releases, :guardian_2_address_state, :string
add_column :acquired_media_releases, :guardian_2_address_zip, :string
add_column :acquired_media_releases, :guardian_2_address_country, :string
end
end

View File

@@ -0,0 +1,25 @@
class AddGuardiansFieldsToMaterialReleases < ActiveRecord::Migration[6.0]
def change
add_column :material_releases, :minor, :boolean, default: false
add_column :material_releases, :guardian_first_name, :string
add_column :material_releases, :guardian_last_name, :string
add_column :material_releases, :guardian_email, :string
add_column :material_releases, :guardian_phone, :string
add_column :material_releases, :guardian_address_street1, :string
add_column :material_releases, :guardian_address_street2, :string
add_column :material_releases, :guardian_address_city, :string
add_column :material_releases, :guardian_address_state, :string
add_column :material_releases, :guardian_address_zip, :string
add_column :material_releases, :guardian_address_country, :string
add_column :material_releases, :guardian_2_first_name, :string
add_column :material_releases, :guardian_2_last_name, :string
add_column :material_releases, :guardian_2_email, :string
add_column :material_releases, :guardian_2_phone, :string
add_column :material_releases, :guardian_2_address_street1, :string
add_column :material_releases, :guardian_2_address_street2, :string
add_column :material_releases, :guardian_2_address_city, :string
add_column :material_releases, :guardian_2_address_state, :string
add_column :material_releases, :guardian_2_address_zip, :string
add_column :material_releases, :guardian_2_address_country, :string
end
end

View File

@@ -9,20 +9,6 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
@@ -175,7 +161,28 @@ CREATE TABLE public.acquired_media_releases (
signed_at timestamp without time zone,
approved_by_user_name text,
approved_by_user_email text,
approved_at timestamp without time zone
approved_at timestamp without time zone,
minor boolean DEFAULT false,
guardian_first_name character varying,
guardian_last_name character varying,
guardian_email character varying,
guardian_phone character varying,
guardian_address_street1 character varying,
guardian_address_street2 character varying,
guardian_address_city character varying,
guardian_address_state character varying,
guardian_address_zip character varying,
guardian_address_country character varying,
guardian_2_first_name character varying,
guardian_2_last_name character varying,
guardian_2_email character varying,
guardian_2_phone character varying,
guardian_2_address_street1 character varying,
guardian_2_address_street2 character varying,
guardian_2_address_city character varying,
guardian_2_address_state character varying,
guardian_2_address_zip character varying,
guardian_2_address_country character varying
);
@@ -554,7 +561,8 @@ CREATE TABLE public.broadcasts (
stream_playback_uid character varying,
token character varying,
streamer_status integer DEFAULT 0,
shoot_location_time_zone character varying DEFAULT 'UTC'::character varying
shoot_location_time_zone character varying DEFAULT 'UTC'::character varying,
full_live_stream_playback_uid character varying
);
@@ -901,7 +909,8 @@ CREATE TABLE public.location_releases (
filming_hours text,
approved_by_user_name text,
approved_by_user_email text,
approved_at timestamp without time zone
approved_at timestamp without time zone,
amendment_signer_name character varying
);
@@ -993,7 +1002,28 @@ CREATE TABLE public.material_releases (
person_last_name character varying,
approved_by_user_name text,
approved_by_user_email text,
approved_at timestamp without time zone
approved_at timestamp without time zone,
minor boolean DEFAULT false,
guardian_first_name character varying,
guardian_last_name character varying,
guardian_email character varying,
guardian_phone character varying,
guardian_address_street1 character varying,
guardian_address_street2 character varying,
guardian_address_city character varying,
guardian_address_state character varying,
guardian_address_zip character varying,
guardian_address_country character varying,
guardian_2_first_name character varying,
guardian_2_last_name character varying,
guardian_2_email character varying,
guardian_2_phone character varying,
guardian_2_address_street1 character varying,
guardian_2_address_street2 character varying,
guardian_2_address_city character varying,
guardian_2_address_state character varying,
guardian_2_address_zip character varying,
guardian_2_address_country character varying
);
@@ -3954,6 +3984,10 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200716094927'),
('20200716103525'),
('20200716105723'),
('20200720051634');
('20200720051634'),
('20200720131309'),
('20200721140821'),
('20200725231419'),
('20200727143209');

11246
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
event: "broadcast_stream_update",
status: broadcast.status,
playback_url: broadcast.stream_playback_url,
full_live_stream_playback_url: broadcast.full_live_stream_playback_url,
status_content: status_content,
video_content: video_content,
streamer_status: broadcast.streamer_status

View File

@@ -106,7 +106,7 @@ RSpec.describe Api::BroadcastsController, type: :controller do
included = JSON.parse(response.body).dig('included')
expect(relationships.keys).to include('files')
expect(included.size).to eq 1
expect(included.size).to eq 3
expect(included.first.dig("id")).to eq broadcast.files.first.id.to_s
expect(included.first.dig("type")).to eq 'active_storage_attachment'
end

View File

@@ -94,7 +94,7 @@ RSpec.describe Api::SyncController, type: :controller do
expect(appearance_releases.first).to include('guardian_photo')
expect(talent_releases.first).to include('guardian_photo')
expect(location_releases.first).not_to include('guardian_photo')
expect(material_releases.first).not_to include('guardian_photo')
expect(material_releases.first).to include('guardian_photo')
end
it 'guardian photo has same format as other photos' do

View File

@@ -43,8 +43,21 @@ describe ContractTemplatesController do
get :index, params: { project_id: project }
expect(response.body).to have_link "Create New Release Template"
expect(response.body).to have_link "Import Template"
expect(response.body).to have_link schedule_demo
end
context 'when current user is an associate' do
let(:current_user) { create(:user, :associate) }
it 'does not show the new contract template button' do
get :index, params: { project_id: project }
expect(response.body).not_to have_link "Create New Release Template"
expect(response.body).not_to have_link "Import Template"
expect(response.body).to have_link schedule_demo
end
end
end
context 'when current user is an associate' do

View File

@@ -0,0 +1,112 @@
require 'rails_helper'
RSpec.describe Public::AmendmentsController, type: :controller do
let(:user) { create(:user) }
let(:account) { user.primary_account }
let(:project) { create(:project, account: account) }
let(:contract_template) { create(:location_release_contract_template, :with_amendment_clause, project: project) }
let(:location_release) { create(:location_release, contract_template: contract_template, project: project) }
render_views
describe "#new" do
it "shows amendment signing form for non-signed amendment of a release" do
expect(location_release.amendment_signed?).to be_falsey
get :new, params: {
account_id: account,
project_id: project,
contract_template_id: location_release.contract_template,
location_release_id: location_release
}
expect(response).to be_successful
body = CGI.unescape_html(response.body)
expect(body).not_to match already_signed_message
end
it "shows already signed message for signed amendment of a release" do
signed_release = create(:location_release, :amendment_signed, contract_template: contract_template, project: project)
expect(signed_release.amendment_signed?).to be_truthy
get :new, params: {
account_id: account,
project_id: project,
contract_template_id: location_release.contract_template,
location_release_id: signed_release
}
expect(response).to be_successful
body = CGI.unescape_html(response.body)
expect(body).to match already_signed_message
end
end
describe "#create" do
it "signs amendment" do
expect(location_release.amendment_signed?).to be_falsey
post :create, params: {
account_id: account,
project_id: project,
contract_template_id: location_release.contract_template,
location_release_id: location_release,
location_release: {
amendment_signer_name: "Signer Name",
amendment_signature_base64: signature_base64
}
}
expect(response).to be_successful
body = CGI.unescape_html(response.body)
expect(body).not_to match already_signed_message
expect(body).to match signed_successfully_message
expect(LocationRelease.last.amendment_signed?).to be_truthy
expect(LocationRelease.last.amendment_signer_name).to eq "Signer Name"
end
it "shows already signed message for signed amendment of a release" do
signed_release = create(:location_release, :amendment_signed, name: "Test Loc", amendment_signer_name: "Big Signer", contract_template: contract_template, project: project)
expect(signed_release.amendment_signed?).to be_truthy
post :create, params: {
account_id: account,
project_id: project,
contract_template_id: location_release.contract_template,
location_release_id: signed_release,
location_release: {
amendment_signer_name: "Signer Who",
amendment_signature_base64: signature_base64
}
}
expect(response).to be_successful
body = CGI.unescape_html(response.body)
expect(body).to match already_signed_message
expect(signed_release.amendment_signed?).to be_truthy
expect(signed_release.amendment_signer_name).to eq "Big Signer"
end
end
private
def already_signed_message
t 'public.amendments.create.amendment_already_signed_message'
end
def signed_successfully_message
t 'public.amendments.create.amendment_signed_message'
end
def signature_base64
@signature_base64 ||= Base64Image.from_image(file_fixture('signature.png')).data_uri
end
end

View File

@@ -87,6 +87,7 @@ RSpec.describe Public::BroadcastsController, type: :controller do
let!(:broadcast) { create(:broadcast, :with_stream, skip_create_callback: true, project: project ) }
it "uploads files to broadcast" do
allow(BroadcastsChannel).to receive(:broadcast_file_upload_updates)
patch :update, params: { token: broadcast.token, broadcast: file_params }, xhr: true
expect(broadcast.files.count).to eq(1)

View File

@@ -4,27 +4,45 @@ RSpec.describe StreamNotificationsController, type: :controller do
render_views
let!(:broadcast) { create(:broadcast, :with_stream, skip_create_callback: true, name: "Live Stream") }
let(:active_status) { {type: "video.live_stream.active", object: { id: "mux_stream" }} }
let(:disconnected_status) { {type: "video.live_stream.disconnected", object: { id: "mux_stream" }} }
let(:idle_status) { {type: "video.live_stream.idle", object: { id: "mux_stream" }} }
let(:idle_status_for_unknown_broadcast) { {type: "video.live_stream.idle", object: { id: "unknown-id" }} }
let(:asset_ready) { {
type: "video.asset.static_renditions.ready",
object: { id: "asset_uid" },
data: {
playback_ids: [
{id: "playback_uid"}
],
static_renditions: {
files: [{name: "high.mp4"}]
}
},
stream_notification: {
let(:active_status) { { type: "video.live_stream.active", object: { id: "mux_stream" } } }
let(:disconnected_status) { { type: "video.live_stream.disconnected", object: { id: "mux_stream" } } }
let(:idle_status) { { type: "video.live_stream.idle", object: { id: "mux_stream" } } }
let(:idle_status_for_unknown_broadcast) { { type: "video.live_stream.idle", object: { id: "unknown-id" } } }
let(:asset_ready) do
{
type: "video.asset.static_renditions.ready",
object: { id: "asset_uid" },
data: {
live_stream_id: "mux_stream"
playback_ids: [
{ id: "playback_uid" }
],
static_renditions: {
files: [{ name: "high.mp4" }]
}
},
stream_notification: {
data: {
live_stream_id: "mux_stream"
}
}
}
} }
end
let(:full_live_stream_ready) do
{
type: "video.asset.ready",
object: { id: "active_asset_uid" },
data: {
playback_ids: [
{ id: "full_live_stream_playback_uid" }
]
},
stream_notification: {
data: {
live_stream_id: "mux_stream"
}
}
}
end
describe "#create" do
before do
@@ -54,13 +72,20 @@ RSpec.describe StreamNotificationsController, type: :controller do
end
it "creates a broadcast recording when static_renditions.ready is received in notification" do
expect {
expect do
post :create, params: asset_ready
}.to change(BroadcastRecording, :count).by(1)
end.to change(BroadcastRecording, :count).by(1)
expect(BroadcastsChannel).to have_received(:stream_recording_ready)
end
it "stores full livestream playback uid and updates the broadcast" do
post :create, params: full_live_stream_ready
expect(Broadcast.last.full_live_stream_playback_uid).to eq "full_live_stream_playback_uid"
expect(BroadcastsChannel).to have_received(:broadcast_stream_updates).with(be_kind_of(Broadcast))
end
it "returns OK response even for non-existing broadcast" do
post :create, params: idle_status_for_unknown_broadcast

View File

@@ -18,6 +18,16 @@ FactoryBot.define do
end
end
trait :minor do
minor true
guardian_first_name "Guardian1"
guardian_last_name "First"
guardian_2_first_name "Guardian2"
guardian_2_last_name "Second"
guardian_phone "1111"
guardian_2_phone "2222"
end
factory :acquired_media_release_with_contract_template do
after(:build) do |acquired_media_release, _|
acquired_media_release.contract_template = build(:acquired_media_release_contract_template)

View File

@@ -11,12 +11,19 @@ FactoryBot.define do
stream_uid "mux_stream"
stream_key "mux_key"
stream_playback_uid "mux_playback_id"
full_live_stream_playback_uid "full_live_stream_playback_uid"
status "created"
streamer_status "idle"
end
trait :with_files do
files { [Rack::Test::UploadedFile.new('spec/fixtures/files/contract.pdf', 'application/pdf')] }
files do
[
Rack::Test::UploadedFile.new('spec/fixtures/files/contract.pdf', 'application/pdf'),
Rack::Test::UploadedFile.new('spec/fixtures/files/audio.mp3', 'audio/mpeg'),
Rack::Test::UploadedFile.new('spec/fixtures/files/video_file.mp4', 'video/mp4')
]
end
end
after(:build) do |broadcast, evaluator|

View File

@@ -13,6 +13,10 @@ FactoryBot.define do
archived_at Time.zone.now
end
trait :with_amendment_clause do
amendment_clause "Amendment Legal Language"
end
factory :appearance_release_contract_template do
release_type "appearance"
end

View File

@@ -22,6 +22,14 @@ FactoryBot.define do
end
end
trait :amendment_signed do
amendment_signature do
path = Rails.root.join("spec", "fixtures", "files", "signature.png")
Rack::Test::UploadedFile.new(path, "image/png")
end
amendment_signer_name "Amendment Signer"
end
trait :non_native do
contract do
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")

View File

@@ -15,6 +15,16 @@ FactoryBot.define do
end
end
trait :minor do
minor true
guardian_first_name "Guardian1"
guardian_last_name "First"
guardian_2_first_name "Guardian2"
guardian_2_last_name "Second"
guardian_phone "1111"
guardian_2_phone "2222"
end
trait :with_photo do
photos do
path = Rails.root.join("spec", "fixtures", "files", "material_photo.png")

View File

@@ -11,11 +11,12 @@ RSpec.feature 'User manages contract templates', type: :feature do
sign_in(current_user)
end
scenario 'splash page is shown if tehre are no contract templates' do
scenario 'splash page is shown if there are no contract templates' do
visit project_contract_templates_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_release_template
expect(page).to have_content import_release_template
end
scenario 'creating a new release template' do
@@ -30,7 +31,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
fill_in 'Describe other territory', with: 'North America only'
select 'In perpetuity', from: 'Term'
select 'None', from: 'Restriction'
click_on 'Create Release Template'
click_on create_release_template_button
expect(page).to have_content(create_contract_template_success_message)
end
@@ -48,18 +49,30 @@ RSpec.feature 'User manages contract templates', type: :feature do
fill_in_trix signature_legal_text_field, with: 'LL'
expect do
click_on 'Create Release Template'
click_on create_release_template_button
end.to change(ContractTemplate, :count).by(1)
end
end
scenario 'location release template has a amendment clause field' do
visit new_project_contract_template_path(project)
fill_in 'Name', with: 'My Release Template'
select 'Location Release', from: 'Release type'
fill_hidden amendment_clause_field, with: 'Amendment clause text'
click_on create_release_template_button
expect(page).to have_content(create_contract_template_success_message)
expect(ContractTemplate.last.amendment_clause.body.to_s).to match /Amendment clause text/
end
scenario 'medical release template has a guardian clause field' do
visit new_project_contract_template_path(project)
fill_in 'Name', with: 'My Release Template'
select 'Medical Release', from: 'Release type'
fill_hidden guardian_clause_field, with: 'Guardian clause text'
click_on 'Create Release Template'
click_on create_release_template_button
expect(page).to have_content(create_contract_template_success_message)
expect(ContractTemplate.last.guardian_clause.body.to_s).to match /Guardian clause text/
@@ -78,7 +91,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
fill_in_trix 'contract_template_guardian_clause', with: 'Guardian clause text'
fill_in question_field(1), with: 'How much experience do you have in the industry?'
click_on 'Create Release Template'
click_on create_release_template_button
expect(page).to have_content(create_contract_template_success_message)
end
@@ -147,7 +160,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(content_disposition).to include('inline')
expect(pdf_body).to have_content('PREVIEW ONLY')
expect(pdf_body).to have_content('Acquired Media Release')
expect(pdf_body).not_to have_content('Guardian')
expect(pdf_body).to have_content('Guardian')
visit new_project_contract_template_path(project)
select 'Location Release', from: 'Release type'
@@ -165,7 +178,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(content_disposition).to include('inline')
expect(pdf_body).to have_content('PREVIEW ONLY')
expect(pdf_body).to have_content('Material Release')
expect(pdf_body).not_to have_content('Guardian')
expect(pdf_body).to have_content('Guardian')
end
context 'preventing creation of release template with wrong fee value' do
@@ -185,13 +198,13 @@ RSpec.feature 'User manages contract templates', type: :feature do
scenario 'Should not allow negative fees' do
fill_in 'Fee', with: '-200'
click_on 'Create Release Template'
click_on create_release_template_button
expect(page).not_to have_content(create_contract_template_success_message)
end
scenario 'Should not allow fees with more than 9 digits' do
fill_in 'Fee', with: '9999999999'
click_on 'Create Release Template'
click_on create_release_template_button
expect(page).not_to have_content(create_contract_template_success_message)
end
end
@@ -366,6 +379,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(page).to have_content schedule_demo
expect(page).not_to have_content create_release_template
expect(page).not_to have_content import_release_template
end
it 'does not show edit button' do
@@ -397,11 +411,12 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(page).to have_content('Delete')
end
it 'does not show create release button on splash page' do
it 'shows create release button on splash page' do
visit project_contract_templates_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_release_template
expect(page).to have_content import_release_template
end
it 'shows edit button when contract template is not signed' do
@@ -465,6 +480,10 @@ RSpec.feature 'User manages contract templates', type: :feature do
'contract_template_guardian_clause_trix_input_contract_template'
end
def amendment_clause_field
'contract_template_amendment_clause_trix_input_contract_template'
end
def signature_legal_text_field
'contract_template_signature_legal_text'
end
@@ -489,6 +508,10 @@ RSpec.feature 'User manages contract templates', type: :feature do
t 'contract_templates.splash.actions.create_template'
end
def import_release_template
t 'contract_templates.splash.actions.import_template'
end
def signature_legal_text_trix_field
'Signature legal text'
end
@@ -516,4 +539,8 @@ RSpec.feature 'User manages contract templates', type: :feature do
def duplicate_release_name(template_name = '')
t 'contract_templates.duplicate.name_prefix', template_name: template_name
end
def create_release_template_button
'Create Release Template'
end
end

View File

@@ -51,6 +51,13 @@ RSpec.feature "User manages project custom folders", type: :feature do
expect(page).to have_content("UPLOAD NEW FILES")
expect do
click_button "Upload Files"
end.not_to raise_exception
expect(page).to have_content("UPLOAD NEW FILES")
expect(page).not_to have_content("The folder has been updated")
drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
click_button "Upload Files"

View File

@@ -12,7 +12,7 @@ feature "User managing acquired_media releases" do
expect(country_field_value).to eq "US"
end
scenario "creating a release", js: true do
scenario "creating a release for an adult", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
@@ -35,11 +35,121 @@ feature "User managing acquired_media releases" do
draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
end
click_button "I have read and agree to the above"
click_button submit_release_button
expect(AcquiredMediaRelease.last.categories).to include("Video Footage")
expect(AcquiredMediaRelease.last.categories).to include("Still Photograph")
expect(page).to have_content("Your release was successfully submitted. Thank you.")
expect(page).to have_content successful_submission_message
end
scenario "creating a release for a minor - guardian fields are required when minor checkbox is checked", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'false'
expect(field).not_to be_visible
end
page.check person_is_minor_checkbox
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'true'
expect(field).to be_visible
end
end
scenario 'creating a release for a minor', js: true do
project = create(:project, members: current_user, account: current_user.primary_account)
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
fill_in acquired_media_name_field, with: "Jane Doe"
acquired_media_category_fields
fill_in acquried_media_description_field, with: "Description"
fill_in acquried_media_owner_first_name, with: "Jane"
fill_in acquried_media_owner_last_name, with: "Doe"
fill_in acquired_media_person_title, with: "Ms."
fill_in acquired_media_person_phone, with: "555-5555-5555"
fill_in acquired_media_person_email, with: "person@example.com"
fill_in acquired_media_person_fax, with: "FAX"
fill_in acquired_media_person_address_street_1, with: "Street 1"
fill_in acquired_media_person_address_city, with: "City"
fill_in acquired_media_person_address_state, with: "State"
fill_in acquired_media_release_person_address_zip, with: "ZIP"
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
click_button submit_release_button
expect(page).to have_content(successful_submission_message)
end
scenario 'creating a release for a minor with two guardians', js: true do
project = create(:project, members: current_user, account: current_user.primary_account)
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_2_photo_heading.upcase
expect(page).to have_content guardian_2_phone_field.titleize
fill_in acquired_media_name_field, with: "Jane Doe"
acquired_media_category_fields
fill_in acquried_media_description_field, with: "Description"
fill_in acquried_media_owner_first_name, with: "Jane"
fill_in acquried_media_owner_last_name, with: "Doe"
fill_in acquired_media_person_title, with: "Ms."
fill_in acquired_media_person_phone, with: "555-5555-5555"
fill_in acquired_media_person_email, with: "person@example.com"
fill_in acquired_media_person_fax, with: "FAX"
fill_in acquired_media_person_address_street_1, with: "Street 1"
fill_in acquired_media_person_address_city, with: "City"
fill_in acquired_media_person_address_state, with: "State"
fill_in acquired_media_release_person_address_zip, with: "ZIP"
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
fill_in guardian_2_first_name_field, with: 'Second'
fill_in guardian_2_last_name_field, with: 'Guardian'
fill_in guardian_2_phone_field, with: '999'
click_button submit_release_button
expect(page).to have_content(successful_submission_message)
expect(AcquiredMediaRelease.last.guardian_2_first_name).to eq 'Second'
end
scenario "creating a release, if contract template contains signature legal language, it is shown" do
@@ -51,6 +161,106 @@ feature "User managing acquired_media releases" do
end
context "when signed in" do
before do
sign_in current_user
end
scenario "creating a release for an adult", js: true do
visit new_project_acquired_media_release_path(project)
fill_in acquired_media_name_field, with: "Jane Doe"
acquired_media_category_fields
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
click_button import_release_button
expect(page).to have_content successful_import_message
end
scenario "creating a release for a minor - guardian fields are required when minor checkbox is checked", js: true do
visit new_project_acquired_media_release_path(project)
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'false'
expect(field).not_to be_visible
end
page.check person_is_minor_checkbox
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'true'
expect(field).to be_visible
end
end
scenario "creating a release for a minor", js: true do
visit new_project_acquired_media_release_path(project)
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading
expect(page).to have_content guardian_email_field.titleize
fill_in acquired_media_name_field, with: "Jane Doe"
acquired_media_category_fields
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
click_button import_release_button
expect(page).to have_content successful_import_message
expect(AcquiredMediaRelease.last.guardian_first_name).to eq 'Guardian'
end
scenario "creating a release for a minor with two guardians", js: true do
visit new_project_acquired_media_release_path(project)
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading
expect(page).to have_content guardian_email_field.titleize
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_2_photo_heading
expect(page).to have_content guardian_2_phone_field.titleize
fill_in acquired_media_name_field, with: "Jane Doe"
acquired_media_category_fields
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
fill_in guardian_2_first_name_field, with: 'Second'
fill_in guardian_2_last_name_field, with: 'Guardian'
fill_in guardian_2_phone_field, with: '999'
click_button import_release_button
expect(page).to have_content successful_import_message
expect(AcquiredMediaRelease.last.guardian_first_name).to eq 'Guardian'
expect(AcquiredMediaRelease.last.guardian_2_first_name).to eq 'Second'
end
scenario "creating, updating, destroying a release", js: true do
release_data = {
name: "Test Acquired Media Release",
@@ -65,7 +275,7 @@ feature "User managing acquired_media releases" do
visit new_project_acquired_media_release_path(project)
by "attaching only a contract" do
attach_file "acquired_media_release[contract]", Rails.root.join(file_fixture("contract.pdf")), visible: false
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
click_button create_release_button
expect(page).to have_invalid_field(acquired_media_name_field)
@@ -117,7 +327,7 @@ feature "User managing acquired_media releases" do
end
end
scenario "viewing the contract PDF" do
scenario "viewing the contract PDF for an adult" do
acquired_media_release = create(:acquired_media_release_with_contract_template,
:native,
project: project,
@@ -176,6 +386,25 @@ feature "User managing acquired_media releases" do
expect(pdf_body).to have_content("Other files")
end
scenario "viewing the contract PDF for a minor" do
acquired_media_release = create(:acquired_media_release_with_contract_template,
:native,
:minor,
project: project,
person_name: "Jane Doe")
visit project_acquired_media_releases_path(project)
click_link *view_release_pdf_link_for(acquired_media_release)
expect(content_type).to eq("application/pdf")
expect(pdf_body).to have_content acquired_media_release.guardian_first_name
expect(pdf_body).to have_content acquired_media_release.guardian_last_name
expect(pdf_body).to have_content acquired_media_release.guardian_2_first_name
expect(pdf_body).to have_content acquired_media_release.guardian_2_last_name
expect(pdf_body).to have_content acquired_media_release.guardian_phone
expect(pdf_body).to have_content acquired_media_release.guardian_2_phone
end
scenario "searching for a release", js: true do
collection1 = create(:acquired_media_release, name: "EDM Music", project: project)
collection2 = create(:acquired_media_release, name: "Classical Music", project: project)
@@ -508,4 +737,103 @@ feature "User managing acquired_media releases" do
def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued'
end
def person_is_minor_checkbox
'acquired_media_release_minor'
end
def guardian_2_first_name_field
t 'helpers.label.acquired_media_release.guardian_2_first_name'
end
def guardian_2_last_name_field
t 'helpers.label.acquired_media_release.guardian_2_last_name'
end
def guardian_2_phone_field
t 'helpers.label.acquired_media_release.guardian_2_phone'
end
def guardian_first_name_field
t 'helpers.label.acquired_media_release.guardian_first_name'
end
def guardian_last_name_field
t 'helpers.label.acquired_media_release.guardian_last_name'
end
def guardian_phone_field
t 'helpers.label.acquired_media_release.guardian_phone'
end
def guardian_email_field
t 'helpers.label.acquired_media_release.guardian_email'
end
def guardian_address_street1_field
t('helpers.label.acquired_media_release.guardian_address_street1')
end
def guardian_address_city_field
t('helpers.label.acquired_media_release.guardian_address_city')
end
def guardian_address_state_field
t('helpers.label.acquired_media_release.guardian_address_state')
end
def guardian_address_zip_field
t('helpers.label.acquired_media_release.guardian_address_zip')
end
def guardian_photo_field
'acquired_media_release[guardian_photo]'
end
def guardian_2_photo_field
'acquired_media_release[guardian_2_photo]'
end
def fill_in_guardian_address_fields
fill_in guardian_address_street1_field, with: "124 Test Lane"
fill_in guardian_address_city_field, with: "New York"
fill_in guardian_address_state_field, with: "NY"
fill_in guardian_address_zip_field, with: '1000'
end
def submit_release_button
'I have read and agree to the above'
end
def successful_submission_message
'Your release was successfully submitted. Thank you.'
end
def guardian_information_heading
t 'public.acquired_media_releases.new.guardian_info.heading'
end
def guardian_photo_heading
t 'public.acquired_media_releases.new.guardian_photo.heading'
end
def guardian_2_information_heading
t 'public.acquired_media_releases.new.guardian_2_info.heading'
end
def guardian_2_photo_heading
t 'public.acquired_media_releases.new.guardian_2_photo.heading'
end
def contract_field
'acquired_media_release[contract]'
end
def import_release_button
t 'helpers.submit.acquired_media_releases.create'
end
def successful_import_message
t 'acquired_media_releases.create.notice'
end
end

View File

@@ -93,7 +93,7 @@ feature 'User managing broadcasts' do
BroadcastsChannel.broadcast_stream_updates(broadcast)
expect(page).to have_content stream_begun_message
expect(page).to have_selector('div#broadcast_video', count: 1)
expect(page).to have_selector('div#broadcast_video', count: 2)
broadcast.streamer_status = :idle
broadcast.status = :idle
@@ -164,6 +164,21 @@ feature 'User managing broadcasts' do
click_on add_file_button
end
scenario 'manager user can click delete button next to the file and delete file', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
visit project_broadcast_path(project, broadcast)
expect(page).to have_content delete_file_button, count: 3
accept_alert do
first('a', text: delete_file_button).click
end
expect(page).to have_content delete_file_button, count: 2
expect(Broadcast.find(broadcast.id).files.count).to eq 2
end
scenario 'visit multi-view broadcast page', js: true do
broadcast_one = create(:broadcast, :with_stream, :with_files, name: 'Broadcast 1', project: project)
broadcast_two = create(:broadcast, :with_stream, :with_files, name: 'Broadcast 2', project: project)
@@ -198,6 +213,14 @@ feature 'User managing broadcasts' do
expect(page).to have_content schedule_demo
expect(page).not_to have_content create_stream
end
scenario 'associate user does not see delete button next to the file', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
visit project_broadcast_path(project, broadcast)
expect(page).to have_content delete_file_button, count: 0
end
end
context 'When the user is account manager' do
@@ -209,6 +232,21 @@ feature 'User managing broadcasts' do
expect(page).to have_content schedule_demo
expect(page).to have_content create_stream
end
scenario 'account manager user can click delete button next to the file and delete file', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
visit project_broadcast_path(project, broadcast)
expect(page).to have_content delete_file_button, count: 3
accept_alert do
first('a', text: delete_file_button).click
end
expect(page).to have_content delete_file_button, count: 2
expect(Broadcast.find(broadcast.id).files.count).to eq 2
end
end
end
@@ -262,5 +300,9 @@ feature 'User managing broadcasts' do
'Live stream is waiting to begin'
end
def delete_file_button
t 'broadcasts.file.actions.delete_file'
end
end

View File

@@ -78,6 +78,47 @@ feature "User managing location releases" do
expect(page).to have_content dummy_signature_legal_text
end
scenario "signing amendment for a not-signed amendment release", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_falsey
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content amendments_heading.upcase
fill_in amendment_signer_name_field, with: 'Big Signer'
draw_signature file_fixture("signature.png"), amendment_signature_field
click_button sign_amendment_button
expect(page).to have_content signed_successfully_message
expect(LocationRelease.find(release.id).amendment_signed?).to be_truthy
end
scenario "opening signing amendment page for a signed amendment release shows already signed message", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, :amendment_signed, contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_truthy
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).not_to have_content amendments_heading
expect(page).not_to have_content signed_successfully_message
expect(page).to have_content already_signed_message
end
scenario "amendment signing form has copy URL button" do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
end
context "when signed in" do
@@ -86,6 +127,14 @@ feature "User managing location releases" do
sign_in current_user
end
scenario "listing all releases, table have correct headers", js:true do
ct = create(:contract_template, :with_amendment_clause, project: project)
create(:location_release, :native, project: project, contract_template: ct)
visit project_location_releases_path(project)
table_headers.each { |s| expect(page).to have_content s }
end
scenario "creating a release", js: true do
visit new_project_location_release_path(project)
@@ -108,9 +157,9 @@ feature "User managing location releases" do
fill_in filming_hours_field, with: "04:00 - 22:00"
click_button create_release_button
expect(page).to have_content(create_release_notice)
expect(page).to have_photo("location_photo.png")
expect(page).to have_photo("location_photo.png", visible: :all)
click_on "Manage"
click_on manage_button
expect(page).to have_link("Download")
end
end
@@ -119,7 +168,7 @@ feature "User managing location releases" do
location_release = create(:location_release_with_photo, :non_native, project: project)
visit project_location_releases_path(project)
click_on "Manage"
click_on manage_button
click_link *update_location_release_link(location_release)
within ".dropzone" do
@@ -139,7 +188,7 @@ feature "User managing location releases" do
location_release = create(:location_release, project: project)
visit project_location_releases_path(project)
click_on "Manage"
click_on manage_button
accept_alert do
click_link *destroy_location_release_link(location_release)
@@ -172,7 +221,7 @@ feature "User managing location releases" do
expect(page).to have_content("Needs Photo")
click_on "Manage"
click_on manage_button
click_on "Photos"
expect(page).to have_content("Add Photos")
@@ -182,11 +231,85 @@ feature "User managing location releases" do
click_on "Save Changes"
expect(page).to have_content("The release has been updated")
expect(page).to have_photo("location_photo.png")
expect(page).to have_photo("location_photo.png", visible: :all)
end
scenario "signing amendment for a not-signed amendment release", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, name: "Test Loc", contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_falsey
visit project_location_releases_path(project)
expect(page).to have_content "Test Loc"
click_on manage_button
expect(page).to have_link sign_amendment_link
new_window = window_opened_by { click_link sign_amendment_link }
within_window new_window do
expect(page).to have_content amendments_heading.upcase
fill_in amendment_signer_name_field, with: 'Big Signer'
draw_signature file_fixture("signature.png"), amendment_signature_field
click_button sign_amendment_button
expect(page).to have_content signed_successfully_message
expect(LocationRelease.find(release.id).amendment_signed?).to be_truthy
end
end
scenario "signed amendment release does not have sign amendment option in manage dropdown", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, :amendment_signed, name: "Test Loc", contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_truthy
visit project_location_releases_path(project)
expect(page).to have_content "Test Loc"
click_on manage_button
expect(page).not_to have_link sign_amendment_link
end
scenario "signed amendment release have checked box in location releases index table", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
not_signed_release = create(:location_release, name: "Not Yet Loc", contract_template: contract_template, project: project)
expect(not_signed_release.amendment_signed?).to be_falsey
visit project_location_releases_path(project)
expect(page).to have_content "Not Yet Loc"
expect(page).to have_css('i.fa.fa-square-o', count: 1)
expect(page).to have_css('i.fa.fa-check-square', count: 0)
signed_release = create(:location_release, :amendment_signed, name: "Signed A Loc", contract_template: contract_template, project: project)
expect(signed_release.amendment_signed?).to be_truthy
visit project_location_releases_path(project)
expect(page).to have_content "Signed A Loc"
expect(page).to have_css('i.fa.fa-square-o', count: 1)
expect(page).to have_css('i.fa.fa-check-square-o', count: 1)
end
scenario "amendment signing form has copy URL button when user is signed in", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
end
scenario "viewing the contract PDF" do
scenario "viewing the contract PDF when amendment is not yet signed" do
location_release = create(:location_release_with_contract_template_and_photo,
:native,
project: project,
@@ -198,16 +321,13 @@ feature "User managing location releases" do
content: "Note 1",
user: build(:user, email: "jane.doe@test.com"),
email: "jane.doe@test.com",
created_at: DateTime.new(2020, 2, 21, 12, 0, 0),
),
created_at: DateTime.new(2020, 2, 21, 12, 0, 0),),
build(:note,
content: "Note 2",
user: build(:user, email: "john.doe@test.com"),
email: "john.doe@test.com",
created_at: DateTime.new(2020, 2, 20, 11, 0, 0),
),
]
)
created_at: DateTime.new(2020, 2, 20, 11, 0, 0),),
])
sign_in(current_user)
visit project_location_releases_path(project)
@@ -216,6 +336,8 @@ feature "User managing location releases" do
expect(content_type).to eq("application/pdf")
expect(content_disposition).to include("inline")
expect(pdf_filename).to include("benny-s-burritos")
expect(pdf_body).not_to have_content amendment_page_heading
expect(pdf_body).to have_content("Benny's Burritos")
expect(pdf_body).to have_content("NOTES")
expect(pdf_body).to have_content("Note 1")
@@ -232,6 +354,34 @@ feature "User managing location releases" do
expect(pdf_body).to have_content("06:00 - 20:00")
end
scenario "viewing the contract PDF when amendment is signed" do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
location_release = create(:location_release,
:amendment_signed,
:native,
contract_template: contract_template,
project: project,
name: "Test Loc")
sign_in(current_user)
visit project_location_releases_path(project)
click_link *view_release_pdf_link_for(location_release)
expect(content_type).to eq("application/pdf")
expect(content_disposition).to include("inline")
expect(pdf_filename).to include("test-loc")
expect(pdf_body).to have_content("Test Loc")
expect(pdf_body).to have_content amendment_page_heading
expect(pdf_body).to have_content amendment_clause_label
expect(pdf_body).to have_content amendment_signer_name_label
expect(pdf_body).to have_content amendment_signature_label
expect(pdf_body).to have_content contract_template.amendment_clause.to_plain_text
expect(pdf_body).to have_content location_release.amendment_signer_name
end
context "when the user is account manager" do
let(:current_user) { create(:user, :account_manager) }
@@ -327,7 +477,7 @@ feature "User managing location releases" do
create(:location_release_with_contract_template, :native, project: project)
visit project_location_releases_path(project)
click_on "Manage"
click_on manage_button
expect(page).not_to have_link(review_action, exact: true)
end
@@ -345,7 +495,7 @@ feature "User managing location releases" do
visit project_location_releases_path(project)
click_on "Manage"
click_on manage_button
expect(page).not_to have_link("Download", exact: true)
end
@@ -353,7 +503,7 @@ feature "User managing location releases" do
create(:location_release_with_contract_template, :native, project: project)
visit project_location_releases_path(project)
click_on "Manage"
click_on manage_button
expect(page).not_to have_link(review_action, exact: true)
end
@@ -437,8 +587,8 @@ feature "User managing location releases" do
"location_release[filming_hours]"
end
def have_photo(filename, attr: "src")
have_selector("img[#{attr}*='#{filename}']")
def have_photo(filename, attr: "src", visible: true)
have_selector("img[#{attr}*='#{filename}']", visible: visible)
end
def import_location_release_link(project)
@@ -535,4 +685,68 @@ feature "User managing location releases" do
def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued'
end
def amendments_heading
t 'public.amendments.new.amendment.heading'
end
def amendment_signer_name_field
'location_release[amendment_signer_name]'
end
def amendment_signature_field
'location_release_amendment_signature_base64'
end
def sign_amendment_button
t 'shared.submit_release_long'
end
def already_signed_message
t 'public.amendments.create.amendment_already_signed_message'
end
def signed_successfully_message
t 'public.amendments.create.amendment_signed_message'
end
def manage_button
t 'location_releases.location_release.actions.manage'
end
def sign_amendment_link
t 'location_releases.location_release.actions.sign_amendment'
end
def copy_url_button
t 'public.amendments.new.copy_url'
end
def amendment_page_heading
t 'contracts.amendment_page.heading'
end
def amendment_signer_name_label
t 'contracts.amendment_page.description_labels.amendment_signer_name'
end
def amendment_clause_label
t 'contracts.amendment_page.description_labels.amendment_clause'
end
def amendment_signature_label
t 'contracts.amendment_page.description_labels.amendment_signature'
end
def table_headers
[
t('location_releases.index.table_headers.approved'),
t('location_releases.index.table_headers.name'),
t('location_releases.index.table_headers.address'),
t('location_releases.index.table_headers.notes'),
t('location_releases.index.table_headers.tags'),
t('location_releases.index.table_headers.signed_at'),
t('location_releases.index.table_headers.amendment_signed')
]
end
end

View File

@@ -40,6 +40,93 @@ feature "User managing material releases" do
expect(MaterialRelease.last.photos.attached?).to eq true
end
scenario "creating a release for a minor - guardian fields are required when minor checkbox is checked", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'false'
expect(field).not_to be_visible
end
page.check person_is_minor_checkbox
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'true'
expect(field).to be_visible
end
end
scenario 'creating a release for a minor', js: true do
project = create(:project, members: current_user, account: current_user.primary_account)
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
fill_all_fields
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
draw_signature file_fixture("signature.png"), signature_field
click_button submit_release_button
expect(page).to have_content(successful_submission_message)
end
scenario 'creating a release for a minor with two guardians', js: true do
project = create(:project, members: current_user, account: current_user.primary_account)
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_email_field.titleize
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_2_photo_heading.upcase
expect(page).to have_content guardian_2_phone_field.titleize
fill_all_fields
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
draw_signature file_fixture("signature.png"), signature_field
fill_in guardian_2_first_name_field, with: 'Second'
fill_in guardian_2_last_name_field, with: 'Guardian'
fill_in guardian_2_phone_field, with: '999'
click_button submit_release_button
expect(page).to have_content(successful_submission_message)
expect(MaterialRelease.last.guardian_2_first_name).to eq 'Second'
end
scenario "creating release is possible only after filling all fields", js: true do
contract_template = create(:contract_template, project: project)
@@ -98,7 +185,7 @@ feature "User managing material releases" do
sign_in current_user
end
scenario "creating a release", js: true do
scenario "creating a release for and adult", js: true do
visit new_project_material_release_path(project)
by "attaching only a contract" do
@@ -120,13 +207,94 @@ feature "User managing material releases" do
click_button create_release_button
expect(page).to have_content(create_release_notice)
expect(page).to have_photo("material_photo.png")
expect(page).to have_photo("material_photo.png", visible: :all)
click_on "Manage"
expect(page).to have_link("Download")
end
end
scenario "creating a release for a minor - guardian fields are required when minor checkbox is checked", js: true do
visit new_project_material_release_path(project)
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'false'
expect(field).not_to be_visible
end
page.check person_is_minor_checkbox
all('input[data-required-tag="guardian"]').each do |field|
expect(field['required']).to eq 'true'
expect(field).to be_visible
end
end
scenario "creating a release for a minor", js: true do
visit new_project_material_release_path(project)
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading
expect(page).to have_content guardian_email_field.titleize
fill_in_release_fields name: "Apple Laptop"
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
click_button import_release_button
expect(page).to have_content successful_import_message
expect(MaterialRelease.last.guardian_first_name).to eq 'Guardian'
end
scenario "creating a release for a minor with two guardians", js: true do
visit new_project_material_release_path(project)
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_photo_heading
expect(page).to have_content guardian_email_field.titleize
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_2_photo_heading
expect(page).to have_content guardian_2_phone_field.titleize
fill_in_release_fields name: "Apple Laptop"
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
fill_in guardian_first_name_field, with: 'Guardian'
fill_in guardian_last_name_field, with: 'Name'
fill_in guardian_phone_field, with: '001101'
fill_in guardian_email_field, with: 'valid@email.com'
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
fill_in_guardian_address_fields
fill_in guardian_2_first_name_field, with: 'Second'
fill_in guardian_2_last_name_field, with: 'Guardian'
fill_in guardian_2_phone_field, with: '999'
click_button import_release_button
expect(page).to have_content successful_import_message
expect(MaterialRelease.last.guardian_first_name).to eq 'Guardian'
expect(MaterialRelease.last.guardian_2_first_name).to eq 'Second'
end
scenario "updating an existing release", js: true do
material_release = create(:material_release, :non_native, project: project)
@@ -190,7 +358,7 @@ feature "User managing material releases" do
click_on "Save Changes"
expect(page).to have_content("The release has been updated")
expect(page).to have_photo("material_photo.png")
expect(page).to have_photo("material_photo.png", visible: :all)
end
scenario "viewing the contract PDF" do
@@ -419,8 +587,8 @@ feature "User managing material releases" do
"material_release[person_address_zip]"
end
def have_photo(filename)
have_selector("img[src*='#{filename}']")
def have_photo(filename, visible: true)
have_selector("img[src*='#{filename}']", visible: visible)
end
def import_material_release_link(project)
@@ -542,4 +710,107 @@ feature "User managing material releases" do
def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued'
end
def person_is_minor_checkbox
'material_release_minor'
end
def guardian_2_first_name_field
t 'helpers.label.material_release.guardian_2_first_name'
end
def guardian_2_last_name_field
t 'helpers.label.material_release.guardian_2_last_name'
end
def guardian_2_phone_field
t 'helpers.label.material_release.guardian_2_phone'
end
def guardian_first_name_field
t 'helpers.label.material_release.guardian_first_name'
end
def guardian_last_name_field
t 'helpers.label.material_release.guardian_last_name'
end
def guardian_phone_field
t 'helpers.label.material_release.guardian_phone'
end
def guardian_email_field
t 'helpers.label.material_release.guardian_email'
end
def guardian_address_street1_field
t('helpers.label.material_release.guardian_address_street1')
end
def guardian_address_city_field
t('helpers.label.material_release.guardian_address_city')
end
def guardian_address_state_field
t('helpers.label.material_release.guardian_address_state')
end
def guardian_address_zip_field
t('helpers.label.material_release.guardian_address_zip')
end
def guardian_photo_field
'material_release[guardian_photo]'
end
def guardian_2_photo_field
'material_release[guardian_2_photo]'
end
def fill_in_guardian_address_fields
fill_in guardian_address_street1_field, with: "124 Test Lane"
fill_in guardian_address_city_field, with: "New York"
fill_in guardian_address_state_field, with: "NY"
fill_in guardian_address_zip_field, with: '1000'
end
def submit_release_button
'I have read and agree to the above'
end
def successful_submission_message
'Your release was successfully submitted. Thank you.'
end
def guardian_information_heading
t 'public.material_releases.new.guardian_info.heading'
end
def guardian_photo_heading
t 'public.material_releases.new.guardian_photo.heading'
end
def guardian_2_information_heading
t 'public.material_releases.new.guardian_2_info.heading'
end
def guardian_2_photo_heading
t 'public.material_releases.new.guardian_2_photo.heading'
end
def contract_field
'material_release[contract]'
end
def import_release_button
t 'helpers.submit.material_release.create'
end
def successful_import_message
t 'material_releases.create.notice'
end
def signature_field
'material_release_signature_base64'
end
end