Compare commits

...

5 Commits

Author SHA1 Message Date
Bilal
a1b45ce85a fix MR comments 2020-08-05 11:05:23 +02:00
Bilal
1134424e37 fix location feature spec 2020-08-04 10:37:21 +02:00
Bilal
ee710d7cd1 implement amendment signing for appearance releases 2020-08-04 10:28:41 +02:00
Senad Uka
8214ba9e67 Changes 2020-08-03 21:52:04 +00:00
Senad Uka
9cbd8d31a8 Upstream sync 2020-07-29 05:15:02 +00:00
72 changed files with 2419 additions and 185 deletions

View File

@@ -16,9 +16,10 @@ REDIS_URL=
# Required for Zoom.us integration # Required for Zoom.us integration
ZOOM_API_KEY= ZOOM_API_KEY=
ZOOM_API_SECRET= ZOOM_API_SECRET=
ZOOM_ACCOUNT_NUMBER=
ZOOM_PRO_USERS_LIMIT= # defaults to 3 ZOOM_PRO_USERS_LIMIT= # defaults to 3
ZOOM_USER_TYPE= # 'pro' / 'basic' ZOOM_USER_TYPE= # 'pro' / 'basic'
ZOOM_ENABLE_RECORDINGS=0 # 0 / 1 ZOOM_ENABLE_RECORDINGS= # true / false (default: false)
# Token for webhooks authorization # Token for webhooks authorization
ZOOM_VERIFICATION_TOKEN= ZOOM_VERIFICATION_TOKEN=

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

@@ -56,35 +56,74 @@ class AcquiredMediaReleasesController < ApplicationController
end end
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 def acquired_media_release_params
params.require(:acquired_media_release).permit( params.require(:acquired_media_release).permit(person_params,
:name, guardian_params,
:territory, second_guardian_params,
:term, :minor,
:person_first_name, :name,
:person_last_name, :territory,
:person_phone, :term,
:person_email, :contract,
:person_company, :applicable_medium_id, :applicable_medium_text,
:person_title, :territory_id, :territory_text,
:person_address_street1, :term_id, :term_text,
:person_address_street2, :restriction_id, :restriction_text,
:person_address_city, categories: [],
:person_address_state, file_infos_attributes: %i[
:person_address_zip, filename
:person_address_country, content_type
:contract, byte_size
: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
]
)
end end
def build_acquired_media_release(attrs = {}) def build_acquired_media_release(attrs = {})

View File

@@ -20,6 +20,7 @@ class Admin::AccountsController < Admin::ApplicationController
def show def show
@videos = filtered_account_videos.order(created_at: :desc, project_id: :desc).paginate(page: params[:page]) @videos = filtered_account_videos.order(created_at: :desc, project_id: :desc).paginate(page: params[:page])
@broadcasts = account_broadcasts.order(created_at: :desc, project_id: :desc).paginate(page: params[:page])
end end
def edit def edit
@@ -70,4 +71,8 @@ class Admin::AccountsController < Admin::ApplicationController
@account.videos @account.videos
end end
end end
def account_broadcasts
@account.broadcasts
end
end end

View File

@@ -0,0 +1,24 @@
class Admin::BroadcastsController < Admin::ApplicationController
before_action :set_broadcast, only: [:edit, :update]
def edit
end
def update
if @broadcast.update(broadcast_update_params)
redirect_to [:admin, @broadcast.project.account], notice: t(".notice")
else
render :edit
end
end
private
def set_broadcast
@broadcast = authorize policy_scope(Broadcast).find(params[:id])
end
def broadcast_update_params
params.require(:broadcast).permit(:stream_url_override, :stream_key_override, :director_mode_video_embed)
end
end

View File

@@ -0,0 +1,26 @@
class BroadcastRecordingsController < ApplicationController
layout "project"
before_action :set_project
before_action :set_broadcast
before_action :set_recording
def destroy
@recording.update(hidden: true)
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
end
private
def set_project
@project = policy_scope(Project).find(params[:project_id])
end
def set_broadcast
@broadcast = authorize policy_scope(@project.broadcasts).find(params[:broadcast_id])
end
def set_recording
@recording = authorize policy_scope(@broadcast.broadcast_recordings).find(params[:id])
end
end

View File

@@ -27,7 +27,7 @@ class BroadcastsController < ApplicationController
def show def show
@conference_url = url_for [@broadcast.project, @broadcast, :zoom_meeting] @conference_url = url_for [@broadcast.project, @broadcast, :zoom_meeting]
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page]) @recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page]) @files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
render layout: 'application' render layout: 'application'
end end

View File

@@ -50,11 +50,58 @@ class MaterialReleasesController < ApplicationController
private 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 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, :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, :applicable_medium_id, :applicable_medium_text,
:territory_id, :territory_text, :territory_id, :territory_text,
:term_id, :term_text, :term_id, :term_text,

View File

@@ -41,31 +41,70 @@ class Public::AcquiredMediaReleasesController < Public::BaseController
end end
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 def acquired_media_release_params
params.require(:acquired_media_release).permit( params.require(:acquired_media_release).permit(person_params,
:name, guardian_params,
:description, second_guardian_params,
:person_first_name, :minor,
:person_last_name, :name,
:person_email, :description,
:person_title, :signature_base64,
:person_phone, :locale, :contract_template,
:person_fax, categories: [],
:person_address_street1, file_infos_attributes: %i[
:person_address_street2, filename
:person_address_city, content_type
:person_address_state, byte_size
:person_address_zip, ])
:person_address_country,
:signature_base64,
:locale, :contract_template,
categories: [],
file_infos_attributes: [
:filename,
:content_type,
:byte_size
]
)
end end
def acquired_media_release_params_with_locale def acquired_media_release_params_with_locale

View File

@@ -5,7 +5,7 @@ class Public::BroadcastsController < Public::BaseController
def show def show
@conference_url = broadcast_zoom_meeting_url(@broadcast.token) @conference_url = broadcast_zoom_meeting_url(@broadcast.token)
@multi_view_broadcasts = multi_view_broadcasts @multi_view_broadcasts = multi_view_broadcasts
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page]) @recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page]) @files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
render 'broadcasts/show' render 'broadcasts/show'

View File

@@ -39,11 +39,59 @@ class Public::MaterialReleasesController < Public::BaseController
authorize material_releases.build(params) authorize material_releases.build(params)
end 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 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, :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, :signature_base64,
:locale, :contract_template, :description, photos: [] :locale, :contract_template, :description, photos: []
) )

View File

@@ -35,7 +35,7 @@ class StreamNotificationsController < ApplicationController
duration = notification.dig(:data, :duration) duration = notification.dig(:data, :duration)
recording = @broadcast.broadcast_recordings.create!(asset_uid: asset_uid, asset_playback_uid: playback_uid, file_name: file_name, duration: duration) recording = @broadcast.broadcast_recordings.create!(asset_uid: asset_uid, asset_playback_uid: playback_uid, file_name: file_name, duration: duration)
recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page]) recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
link = helpers.link_to(recording.broadcast_name.titleize, recording.download_url, target: "_blank") link = helpers.link_to(recording.broadcast_name.titleize, recording.download_url, target: "_blank")
message = "Your recent live stream has been recorded and is available for download here: #{link}" message = "Your recent live stream has been recorded and is available for download here: #{link}"

View File

@@ -5,6 +5,7 @@ class Account < ApplicationRecord
has_many :users, through: :account_auths has_many :users, through: :account_auths
has_many :projects, dependent: :destroy has_many :projects, dependent: :destroy
has_many :videos, through: :projects has_many :videos, through: :projects
has_many :broadcasts, through: :projects
has_many :contract_templates, through: :projects has_many :contract_templates, through: :projects
validates :name, presence: true validates :name, presence: true

View File

@@ -11,6 +11,10 @@ class AcquiredMediaRelease < ApplicationRecord
include PersonName include PersonName
include CsvExportable include CsvExportable
include Approvable include Approvable
include GuardianPhotoable
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
class << self class << self
def custom_csv_exportable_headers def custom_csv_exportable_headers
@@ -33,6 +37,38 @@ class AcquiredMediaRelease < ApplicationRecord
%w(person_address_country country) %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 :name, presence: true
validates :person_email, email: true, allow_blank: 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 = ["Artwork", "Film Footage", "Video Footage", "Still Photograph"].freeze
CATEGORIES = ["Film Footage", "Video Footage", "Still Photograph"].freeze CATEGORIES = ["Film Footage", "Video Footage", "Still Photograph"].freeze
def minor? def second_guardian_present?
false guardian_2_first_name.present?
end end
def contact_person def contact_person

View File

@@ -17,6 +17,7 @@ class AppearanceRelease < ApplicationRecord
include SecondGuardianName include SecondGuardianName
include CsvExportable include CsvExportable
include Approvable include Approvable
include Amendmenable
class << self class << self
def custom_csv_exportable_headers def custom_csv_exportable_headers

View File

@@ -35,7 +35,11 @@ class Broadcast < ApplicationRecord
end end
def stream_server_url def stream_server_url
ENV['MUX_BROADCAST_SERVER_URL'] stream_url_override.presence || ENV["MUX_BROADCAST_SERVER_URL"]
end
def stream_server_key
stream_key_override.presence || stream_key
end end
def zoom_meeting_url def zoom_meeting_url

View File

@@ -5,6 +5,8 @@ class BroadcastRecording < ApplicationRecord
validates :asset_uid, uniqueness: true validates :asset_uid, uniqueness: true
scope :visible, -> { where(hidden: false) }
def download_url def download_url
"https://stream.mux.com/#{asset_playback_uid}/#{file_name}?download=#{download_file_name}" "https://stream.mux.com/#{asset_playback_uid}/#{file_name}?download=#{download_file_name}"
end end

View File

@@ -12,6 +12,11 @@ class MaterialRelease < ApplicationRecord
include PersonName include PersonName
include CsvExportable include CsvExportable
include Approvable include Approvable
include GuardianPhotoable
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
class << self class << self
def custom_csv_exportable_headers def custom_csv_exportable_headers
@@ -30,6 +35,39 @@ class MaterialRelease < ApplicationRecord
%w(person_address_country country) %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 :name, presence: true
validates :person_email, email: true, allow_blank: 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) @contact_person ||= Contact.new(person_name, person_address, person_email, person_phone)
end end
def minor? def second_guardian_present?
false guardian_2_first_name.present?
end end
def uses_edl? def uses_edl?

View File

@@ -34,4 +34,8 @@ class AppearanceReleasePolicy < ReleasePolicy
def approve? def approve?
review? review?
end end
def sign_amendment?
user.manager? || user.account_manager?
end
end end

View File

@@ -0,0 +1,9 @@
class BroadcastRecordingPolicy < ApplicationPolicy
def destroy?
if user.nil? || user.user.nil?
return false
end
user.manager? || user.account_manager?
end
end

View File

@@ -1,6 +1,10 @@
<%= errors_summary_for acquired_media_release %> <%= errors_summary_for acquired_media_release %>
<%= bootstrap_form_with model: model, local: true do |form| %> <%= 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 %> <%= 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"> <div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %> <%= form.text_field :name, required: true, wrapper_class: "col-12" %>
</div> </div>
@@ -9,6 +13,28 @@
<%= form.check_box :categories, { multiple: true, label: category }, category, false %> <%= form.check_box :categories, { multiple: true, label: category }, category, false %>
<% end %> <% end %>
<% 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 %> <% end %>
<hr> <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> <strong>For optimal accuracy, please ensure video file names and photo file names match the source file name in the editing sequence.</strong>
</div> </div>
<%= render "shared/file_infos_dropzone", form: form, releasable: acquired_media_release %> <%= 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 %> <% end %>
<hr> <hr>

View File

@@ -0,0 +1,13 @@
<tr>
<td><%= broadcast.project.name %></td>
<td><%= broadcast.name %></td>
<td class="text-right">
<div class="btn-group">
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<%= link_to "View on Mux", "#{ENV['MUX_LIVE_STREAM_DASHBOARD_URL']}/#{broadcast.stream_uid}", class: "dropdown-item", target: "_blank" %>
<%= link_to "Edit", [:edit, :admin, broadcast, locale: I18n.locale], class: "dropdown-item" %>
</div>
</div>
</td>
</tr>

View File

@@ -34,5 +34,25 @@
<%= will_paginate @videos %> <%= will_paginate @videos %>
</div> </div>
<% end %> <% end %>
<hr>
<%= card_field_set_tag "Broadcasts" do %>
<div class="table-responsive-sm">
<table class="table table-striped tr-px-4 align-all-middle">
<thead class="thead-light">
<tr>
<th>Project</th>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody id="broadcasts">
<%= render partial: "admin/accounts/broadcast", collection: @broadcasts %>
</tbody>
</table>
</div>
<div id="broadcasts_pagination">
<%= will_paginate @broadcasts %>
</div>
<% end %>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,14 @@
<%= errors_summary_for broadcast %>
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= form.text_field :stream_url_override %>
<%= form.text_field :stream_key_override %>
<%= form.text_area :director_mode_video_embed %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [:admin, broadcast.project.account], class: "col-3 text-reset" %>
<div class="col-9">
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => broadcast.new_record?), data: { disable_with: t("shared.disable_with") } %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading"), close_action_path: [:admin, @broadcast.project.account] %>
<div class="card-body">
<%= render "form", model: [:admin, @broadcast], broadcast: @broadcast %>
</div>
</div>

View File

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

View File

@@ -51,6 +51,7 @@
<th><%= t(".table_headers.notes") %></th> <th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></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> <th></th>
</tr> </tr>
</thead> </thead>

View File

@@ -0,0 +1,6 @@
var dom_id = "<%= dom_id(@recording) %>"
$('[data-id="' + dom_id + '"]').remove();
<% if @recordings.empty? %>
$("#broadcast_recordings_nav").append('<p class="dropdown-item text-muted">Recordings will appear here</p>')
<% end %>
$("#broadcast_recordings").html("<%= j render(partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast }) %>");

View File

@@ -16,8 +16,8 @@
<div class="btn-group"> <div class="btn-group">
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %> <%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<%= link_to fa_icon("link fw", text: "Copy Stream URL"), ENV['MUX_BROADCAST_SERVER_URL'], class: "dropdown-item", data: { behavior: "clipboard" } %> <%= link_to fa_icon("link fw", text: "Copy Stream URL"), broadcast.stream_server_url, class: "dropdown-item", data: { behavior: "clipboard" } %>
<%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_key, class: "dropdown-item", data: { behavior: "clipboard" } %> <%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_server_key, class: "dropdown-item", data: { behavior: "clipboard" } %>
<% if policy(broadcast).show? %> <% if policy(broadcast).show? %>
<%= link_to fa_icon("file-video-o fw", text: "View"), [broadcast.project, broadcast], class: "dropdown-item", target: '_blank' %> <%= link_to fa_icon("file-video-o fw", text: "View"), [broadcast.project, broadcast], class: "dropdown-item", target: '_blank' %>
<% end %> <% end %>

View File

@@ -1,2 +1,3 @@
<%= link_to broadcast_recording.download_file_name, "javascript:void(0);", class: "dropdown-item", data: { behavior: "play_recording", playback_url: broadcast_recording.playback_url } %> <%= link_to broadcast_recording.download_file_name, "javascript:void(0);", class: "dropdown-item", data: { behavior: "play_recording", playback_url: broadcast_recording.playback_url, id: dom_id(broadcast_recording) } %>

View File

@@ -2,7 +2,12 @@
<p>Click below to download the recordings of the live stream.</p> <p>Click below to download the recordings of the live stream.</p>
<ul class="mt-2"> <ul class="mt-2">
<% recordings.each do |recording| %> <% recordings.each do |recording| %>
<li><%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %></li> <li>
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
<% end %>
</li>
<% end %> <% end %>
</ul> </ul>
<div id="recordings_pagination" class="row mt-5 justify-content-center"> <div id="recordings_pagination" class="row mt-5 justify-content-center">

View File

@@ -1,5 +1,9 @@
<% if broadcast.streamer_recording? && broadcast.active? %> <% if broadcast.streamer_recording? && broadcast.active? %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div> <div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
<% elsif broadcast.director_mode_video_embed.present? && params[:director_mode] == "true" %>
<div class="embed-responsive-item" data-video-type="stream">
<%= raw broadcast.director_mode_video_embed %>
</div>
<% else %> <% else %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"> <div id="broadcast_video" class="embed-responsive-item" data-video-type="stream">
<table class="w-100 h-100 bg-secondary"> <table class="w-100 h-100 bg-secondary">
@@ -12,4 +16,4 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<% end %> <% end %>

View File

@@ -39,6 +39,15 @@
<%= link_to broadcast.name.titleize, broadcast.url, data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %> <%= link_to broadcast.name.titleize, broadcast.url, data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% end %> <% end %>
<% end %> <% end %>
<% if @broadcast.director_mode_video_embed.present? %>
<h5 class="dropdown-header">Director Mode</h5>
<% unless params[:director_mode] %>
<%= link_to "Enable Director Mode", url_for(params.permit!.merge(director_mode: true)), class: "dropdown-item" %>
<% else %>
<%= link_to "Disable Director Mode", url_for(params.permit!.except(:director_mode)), class: "dropdown-item" %>
<% end %>
<% end %>
<h5 class="dropdown-header">Previous Sessions</h5> <h5 class="dropdown-header">Previous Sessions</h5>
<div id="broadcast_recordings_nav"> <div id="broadcast_recordings_nav">
<% if @recordings.any? %> <% if @recordings.any? %>

View File

@@ -2,7 +2,7 @@
<%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %> <%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
<div class="form-row"> <div class="form-row">
<%= form.text_field :name, wrapper_class: "col-sm-6" %> <%= 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), "#amendment_clause": %w(location) } }, class: "form-control custom-select" %> <%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(acquired_media appearance talent material misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical misc), "#amendment_clause": %w(appearance location) } }, class: "form-control custom-select" %>
</div> </div>
<div class="form-row mb-3"> <div class="form-row mb-3">
<%= form.radio_button :accessibility, :public_template, label: "Public", wrapper_class: "mr-3" %> <%= form.radio_button :accessibility, :public_template, label: "Public", wrapper_class: "mr-3" %>

View File

@@ -3,6 +3,6 @@
<%= render "shared/files_dropzone_fields", form: form, directory: directory %> <%= render "shared/files_dropzone_fields", form: form, directory: directory %>
<% end %> <% end %>
<div class="pt-3"> <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> </div>
<% end %> <% end %>

View File

@@ -16,10 +16,10 @@
<% end %> <% end %>
</td> </td>
<td> <td>
<%= location_release.name %> <%= contact_info(name: location_release.name, address: location_release.address) %>
</td> </td>
<td> <td>
<%= contact_info address: location_release.address %> <%= contact_info_for(location_release.contact_person) %>
</td> </td>
<td> <td>
<%= notes_preview location_release.notes.order_by_recent %> <%= notes_preview location_release.notes.order_by_recent %>

View File

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

View File

@@ -12,6 +12,9 @@
<hr> <hr>
<%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %> <%= 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"> <div class="form-row">
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %> <%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
<%= form.text_field :person_last_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" %> <%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
</div> </div>
<%= render "shared/address_fields", form: form, subject: "person" %> <%= 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 %> <% end %>
<hr> <hr>
@@ -34,6 +59,44 @@
<%= field_set_tag content_tag(:span, t(".photos.heading"), class: "h6 text-muted text-uppercase") do %> <%= 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 %> <%= 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 %> <% end %>
<div class="row align-items-center text-center mt-4"> <div class="row align-items-center text-center mt-4">

View File

@@ -13,6 +13,17 @@
<hr> <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 %> <%= card_field_set_tag t(".acquired_media_info.heading") do %>
<div class="form-row"> <div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %> <%= form.text_field :name, required: true, wrapper_class: "col-12" %>
@@ -49,6 +60,91 @@
<hr> <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 %> <%= card_field_set_tag t(".signature.heading") do %>
<%= render "shared/signature_fields", form: form, signature_legal_text: @contract_template.signature_legal_text %> <%= render "shared/signature_fields", form: form, signature_legal_text: @contract_template.signature_legal_text %>
<% end %> <% end %>

View File

@@ -8,6 +8,10 @@
<div class="card-body"> <div class="card-body">
<%= errors_summary_for @release %> <%= 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| %> <%= 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('.signed_contract_preview') do %>
<embed class="embeded-contract-preview" type="application/pdf" src="<%= url_for([@release, :contracts, format: "pdf"]) %>" width="80%" height="1200" />
<% end %>
<%= card_field_set_tag t(".amendment.heading") do %> <%= card_field_set_tag t(".amendment.heading") do %>
<p><%= @contract_template.amendment_clause %></p> <p><%= @contract_template.amendment_clause %></p>
<% end %> <% end %>

View File

@@ -13,6 +13,17 @@
<hr> <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 %> <%= card_field_set_tag t(".release_info.heading") do %>
<div class="form-row"> <div class="form-row">
<%= form.text_field :name, required: true, wrapper_class: "col-12" %> <%= form.text_field :name, required: true, wrapper_class: "col-12" %>
@@ -40,6 +51,91 @@
<hr> <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 %> <%= 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 %> <%= render "shared/signature_fields", form: form, instruction: 'For Owner or Authorized Signatory', signature_legal_text: @contract_template.signature_legal_text %>
<% end %> <% end %>

View File

@@ -46,6 +46,15 @@ en:
heading: 3 of 3 Contract & Exploitable Rights heading: 3 of 3 Contract & Exploitable Rights
files: files:
heading: 2 of 3 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: index:
actions: actions:
new: Import Release new: Import Release
@@ -102,6 +111,11 @@ en:
application: application:
header: header:
sign_out: Sign Out sign_out: Sign Out
broadcasts:
edit:
heading: Edit Broadcast
update:
notice: The broadcast has been updated
task_requests: task_requests:
index: index:
empty: Task requests will appear here empty: Task requests will appear here
@@ -126,7 +140,10 @@ en:
actions: actions:
manage: Manage manage: Manage
review: Review review: Review
sign_amendment: Sign Additional Clause
messages: messages:
amendment_not_signed_tooltip: Secondary Clause Not Yet Signed
amendment_signed_tooltip: Secondary Clause Signed
approved_tooltip: Approved by %{user} on %{timestamp} approved_tooltip: Approved by %{user} on %{timestamp}
no_photos: Needs Photo no_photos: Needs Photo
create: create:
@@ -159,6 +176,7 @@ en:
empty: Appearance Releases will appear here empty: Appearance Releases will appear here
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release
table_headers: table_headers:
amendment_signed: Additional Clause
approved: Approved approved: Approved
contact_info: Contact info contact_info: Contact info
name: Name name: Name
@@ -209,6 +227,8 @@ en:
broadcast: broadcast:
actions: actions:
manage: Manage manage: Manage
broadcast_recordings:
confirm_hide: Are you sure you want to hide this recording from everyone?
create: create:
notice: A live stream has been created notice: A live stream has been created
destroy: destroy:
@@ -333,7 +353,7 @@ en:
amendment_clause: Amendment Clause amendment_clause: Amendment Clause
amendment_signature: Amendment Signature amendment_signature: Amendment Signature
amendment_signer_name: Amendment Signer Name amendment_signer_name: Amendment Signer Name
heading: Amendment heading: Secondary Clause
for_office_use_only: for_office_use_only:
description_labels: description_labels:
date_issued: Date Issued date_issued: Date Issued
@@ -436,6 +456,27 @@ en:
label: label:
acquired_media_release: acquired_media_release:
description: Description of property 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 name: Name of property
person_address: Address person_address: Address
person_address_city: City person_address_city: City
@@ -481,6 +522,8 @@ en:
person_last_name: Last name person_last_name: Last name
person_name: Name person_name: Name
person_phone: Phone number person_phone: Phone number
contract_template:
amendment_clause: Secondary Clause
location_release: location_release:
address_city: City address_city: City
address_country: Country address_country: Country
@@ -501,6 +544,27 @@ en:
person_last_name: Owner last name person_last_name: Owner last name
material_release: material_release:
description: Description of licensed material 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 name: Name of licensed material
person_address: Address person_address: Address
person_address_city: City person_address_city: City
@@ -721,6 +785,8 @@ en:
acquired_media_release: acquired_media_release:
create: Import Release create: Import Release
update: Save Changes update: Save Changes
acquired_media_releases:
create: Import Release
appearance_release: appearance_release:
create: Import Release create: Import Release
update: Save Changes update: Save Changes
@@ -788,10 +854,11 @@ en:
search: Search search: Search
empty: Location Releases will appear here empty: Location Releases will appear here
table_headers: table_headers:
address: Address amendment_signed: Amendment
approved: Approved approved: Approved
name: Location Name location_info: Location Info
notes: Notes notes: Notes
owner_info: Owner Info
signed_at: Date Signed signed_at: Date Signed
tags: Tags tags: Tags
location_release: location_release:
@@ -818,10 +885,18 @@ en:
form: form:
contract_and_rights: contract_and_rights:
heading: 3 of 4 Contract & Exploitable 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: material_details:
heading: 1 of 3 Material Details heading: 1 of 3 Material Details
photos: photos:
dropzone_label: Tap to take a photo of Licensed Material (optional) 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 heading: 4 of 4 Photos
signer_details: signer_details:
heading: 2 of 4 Licensor/Owner Details heading: 2 of 4 Licensor/Owner Details
@@ -1042,10 +1117,28 @@ en:
cancel: Cancel cancel: Cancel
files: files:
heading: File Information 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: legal:
heading: Legal heading: Legal
personal_info: personal_info:
heading: Licensor/Owner Contact Information 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: signature:
heading: Signature heading: Signature
amendments: amendments:
@@ -1058,6 +1151,7 @@ en:
copy_url: Copy sign amendment URL copy_url: Copy sign amendment URL
signature: signature:
heading: Signature heading: Signature
signed_contract_preview: Signed Contract Preview
appearance_releases: appearance_releases:
create: create:
notice: Your release has been signed. Thank you! notice: Your release has been signed. Thank you!
@@ -1131,10 +1225,27 @@ en:
cancel: Cancel cancel: Cancel
contact_info: contact_info:
heading: Licensor/Owner Contact Information 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: legal:
heading: Legal heading: Legal
photo: photo:
heading: Photos 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: release_info:
heading: Release Information heading: Release Information
signature: signature:

View File

@@ -2,6 +2,18 @@ es:
acquired_media_releases: acquired_media_releases:
acquired_media_release: acquired_media_release:
no_media: No Media (ES) 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: index:
table_headers: table_headers:
file_infos_count: No. Files (ES) file_infos_count: No. Files (ES)
@@ -33,6 +45,13 @@ es:
models: models:
appearance_release: Autorización de Aparacimiento appearance_release: Autorización de Aparacimiento
appearance_releases: appearance_releases:
appearance_release:
actions:
sign_amendment: Sign Additional Clause (ES)
manage: Manage (ES)
messages:
amendment_not_signed_tooltip: Amendment not yet signed (ES)
amendment_signed_tooltip: Amendment signed (ES)
create: create:
failed_import: Failed to create appearance release for files listed below (ES) failed_import: Failed to create appearance release for files listed below (ES)
matching_started: Matching started (ES) matching_started: Matching started (ES)
@@ -52,6 +71,7 @@ es:
index: index:
imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release (ES) imported_appearance_release_missing_attachment: Person photo or contract missing for imported appearance release (ES)
table_headers: table_headers:
amendment_signed: Additional Clause (ES)
contact_info: "" contact_info: ""
name: "" name: ""
notes: "" notes: ""
@@ -157,7 +177,7 @@ es:
amendment_clause: Amendment Clause (ES) amendment_clause: Amendment Clause (ES)
amendment_signature: Amendment Signature (ES) amendment_signature: Amendment Signature (ES)
amendment_signer_name: Amendment Signer Name (ES) amendment_signer_name: Amendment Signer Name (ES)
heading: Amendment (ES) heading: Secondary Clause (ES)
for_office_use_only: for_office_use_only:
description_labels: description_labels:
date_issued: Date Issued (ES) date_issued: Date Issued (ES)
@@ -222,6 +242,29 @@ es:
guardian_clause: Leave blank if not required for this contract (ES) guardian_clause: Leave blank if not required for this contract (ES)
signature_legal_text: Leave blank if not required for this contract (ES) signature_legal_text: Leave blank if not required for this contract (ES)
label: 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: appearance_release:
guardian_2_address_city: Guardian 2 city (ES) guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES) guardian_2_address_country: Guardian 2 country (ES)
@@ -250,6 +293,29 @@ es:
person_email: Dirección de correo electrónico person_email: Dirección de correo electrónico
person_name: Nómbre person_name: Nómbre
person_phone: Número de teléfono person_phone: Número de teléfono
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: medical_release:
guardian_2_address_city: Guardian 2 city (ES) guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES) guardian_2_address_country: Guardian 2 country (ES)
@@ -328,6 +394,8 @@ es:
person_name: Jane Doe person_name: Jane Doe
person_phone: 555-555-5555 person_phone: 555-555-5555
submit: submit:
acquired_media_releases:
create: Import Release (ES)
appearance_release: appearance_release:
create: Crear Autorización create: Crear Autorización
broadcast: broadcast:
@@ -336,6 +404,8 @@ es:
contract_template: contract_template:
update: Save changes (ES) update: Save changes (ES)
create: 'Crear %{model}' create: 'Crear %{model}'
material_release:
create: Import Release (ES)
medical_release: medical_release:
update: Approve (ES) update: Approve (ES)
update: 'Actualizar %{model}' update: 'Actualizar %{model}'
@@ -346,6 +416,7 @@ es:
index: index:
table_headers: table_headers:
address: Address (ES) address: Address (ES)
amendment_signed: Amendment (ES)
notes: Notes (ES) notes: Notes (ES)
signed_at: Date Signed (ES) signed_at: Date Signed (ES)
tags: Tags (ES) tags: Tags (ES)
@@ -356,9 +427,19 @@ es:
amendment_not_signed_tooltip: Amendment not yet signed (ES) amendment_not_signed_tooltip: Amendment not yet signed (ES)
amendment_signed_tooltip: Amendment Signed (ES) amendment_signed_tooltip: Amendment Signed (ES)
material_releases: material_releases:
create:
notice: The acquired media release has been created (ES)
form: form:
guardian_2_info:
heading: Guardian Information (if company requires) [ES]
guardian_info:
heading: Guardian Information (ES)
photos: photos:
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES) 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: index:
table_headers: table_headers:
name: Name (ES) name: Name (ES)
@@ -401,6 +482,26 @@ es:
signed_at: Date Signed (ES) signed_at: Date Signed (ES)
tags: Tags (ES) tags: Tags (ES)
public: 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: amendments:
create: create:
amendment_already_signed_message: Release amendment is already signed! (ES) amendment_already_signed_message: Release amendment is already signed! (ES)
@@ -411,6 +512,7 @@ es:
copy_url: Copy sign amendment URL (ES) copy_url: Copy sign amendment URL (ES)
signature: signature:
heading: Signature (ES) heading: Signature (ES)
signed_contract_preview: Signed Contract Preview (ES)
appearance_releases: appearance_releases:
create: create:
notice: La autorización está firmada. ¡Gracias! notice: La autorización está firmada. ¡Gracias!
@@ -450,8 +552,25 @@ es:
heading: Photos (ES) heading: Photos (ES)
material_releases: material_releases:
new: 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: photo:
heading: Photos (ES) 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: medical_releases:
new: new:
guardian_2_info: guardian_2_info:

View File

@@ -35,6 +35,7 @@ Rails.application.routes.draw do
resource :masquerade, only: :create resource :masquerade, only: :create
end end
resources :task_requests, only: [:index, :edit, :update, :show] resources :task_requests, only: [:index, :edit, :update, :show]
resources :broadcasts, only: [:edit, :update]
root to: "accounts#index", as: :signed_in_root root to: "accounts#index", as: :signed_in_root
end end
@@ -100,6 +101,7 @@ Rails.application.routes.draw do
delete :destroy_file delete :destroy_file
end end
resource :zoom_meeting, only: [:show] resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: :destroy
end end
resources :directories, except: [:index] do resources :directories, except: [:index] do
member do member do
@@ -129,7 +131,9 @@ Rails.application.routes.draw do
resources :projects, only: [] do resources :projects, only: [] do
resources :contract_templates, only: [:index] do resources :contract_templates, only: [:index] do
resources :talent_releases, only: [:new, :create] resources :talent_releases, only: [:new, :create]
resources :appearance_releases, only: [:new, :create] resources :appearance_releases, only: [:new, :create] do
resources :amendments, only: [:new, :create]
end
resources :acquired_media_releases, only: [:new, :create] resources :acquired_media_releases, only: [:new, :create]
resources :location_releases, only: [:new, :create] do resources :location_releases, only: [:new, :create] do
resources :amendments, only: [:new, :create] resources :amendments, only: [:new, :create]

View File

@@ -0,0 +1,5 @@
class AddHiddenFieldToBroadcastRecordings < ActiveRecord::Migration[6.0]
def change
add_column :broadcast_recordings, :hidden, :boolean, default: false
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

@@ -0,0 +1,7 @@
class AddStreamAndKeyOverrideToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :stream_url_override, :string
add_column :broadcasts, :stream_key_override, :string
add_column :broadcasts, :youtube_uid, :string
end
end

View File

@@ -0,0 +1,5 @@
class RemoveYoutubeUidFromBroadcasts < ActiveRecord::Migration[6.0]
def change
remove_column :broadcasts, :youtube_uid, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddDirectorModeVideoEmbedToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :director_mode_video_embed, :text
end
end

View File

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

View File

@@ -161,7 +161,28 @@ CREATE TABLE public.acquired_media_releases (
signed_at timestamp without time zone, signed_at timestamp without time zone,
approved_by_user_name text, approved_by_user_name text,
approved_by_user_email 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
); );
@@ -344,7 +365,8 @@ CREATE TABLE public.appearance_releases (
guardian_2_address_country character varying, guardian_2_address_country character varying,
approved_by_user_name text, approved_by_user_name text,
approved_by_user_email text, approved_by_user_email text,
approved_at timestamp without time zone approved_at timestamp without time zone,
amendment_signer_name character varying
); );
@@ -501,7 +523,8 @@ CREATE TABLE public.broadcast_recordings (
file_name character varying NOT NULL, file_name character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL, created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL,
duration double precision duration double precision,
hidden boolean DEFAULT false
); );
@@ -541,7 +564,10 @@ CREATE TABLE public.broadcasts (
token character varying, token character varying,
streamer_status integer DEFAULT 0, 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 full_live_stream_playback_uid character varying,
stream_url_override character varying,
stream_key_override character varying,
director_mode_video_embed text
); );
@@ -981,7 +1007,28 @@ CREATE TABLE public.material_releases (
person_last_name character varying, person_last_name character varying,
approved_by_user_name text, approved_by_user_name text,
approved_by_user_email 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
); );
@@ -3944,6 +3991,13 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200716105723'), ('20200716105723'),
('20200720051634'), ('20200720051634'),
('20200720131309'), ('20200720131309'),
('20200721140821'); ('20200721140821'),
('20200724084722'),
('20200725231419'),
('20200727143209'),
('20200730050903'),
('20200803145912'),
('20200803150138'),
('20200804093409');

View File

@@ -35,7 +35,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
describe '#stream_recording_ready' do describe '#stream_recording_ready' do
it 'broadcasts to the channel with the right data' do it 'broadcasts to the channel with the right data' do
create_list(:broadcast_recording, 1, broadcast: broadcast) create_list(:broadcast_recording, 1, broadcast: broadcast)
recordings = broadcast.broadcast_recordings.paginate(page: 1) recordings = broadcast.broadcast_recordings.visible.paginate(page: 1)
flash_message = OpenStruct.new(notice: 'Hello world', alert: nil) flash_message = OpenStruct.new(notice: 'Hello world', alert: nil)
flash_content = ApplicationController.render partial: 'application/flash', locals: { flash: flash_message } flash_content = ApplicationController.render partial: 'application/flash', locals: { flash: flash_message }
recordings_content = ApplicationController.render partial: 'broadcasts/broadcast_recordings', locals: { recordings: recordings, broadcast: broadcast } recordings_content = ApplicationController.render partial: 'broadcasts/broadcast_recordings', locals: { recordings: recordings, broadcast: broadcast }

View File

@@ -116,6 +116,16 @@ RSpec.describe Admin::AccountsController, type: :controller do
expect(response.body).to have_link("2", href: admin_account_path(current_user.primary_account, page: 2)) expect(response.body).to have_link("2", href: admin_account_path(current_user.primary_account, page: 2))
end end
it "paginates the broadcast list" do
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
project = create(:project, account: current_user.primary_account)
create_list(:broadcast, 20, project: project )
get :show, params: { id: current_user.primary_account }
expect(response.body).to have_link("2", href: admin_account_path(current_user.primary_account, page: 2))
end
it "filters the videos by a query param" do it "filters the videos by a query param" do
project = create(:project, account: current_user.primary_account) project = create(:project, account: current_user.primary_account)
create(:video, project: project, name: "First video") create(:video, project: project, name: "First video")

View File

@@ -0,0 +1,77 @@
require "rails_helper"
RSpec.describe Admin::BroadcastsController, type: :controller do
render_views
let!(:current_user) { create(:user, :admin) }
before do
sign_in(current_user)
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
end
describe "#edit" do
let(:broadcast) { create(:broadcast) }
it "returns a successful response" do
get :edit, params: { id: broadcast }
expect(response).to be_successful
end
it "assigns broadcast" do
get :edit, params: { id: broadcast }
expect(assigns(:broadcast)).to eq broadcast
end
end
describe "#update" do
let(:broadcast) { create(:broadcast) }
it "redirects to broadcasts page" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(response).to be_redirect
expect(response).to redirect_to [:admin, broadcast.project.account]
end
it "sets a flash notice" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(flash.notice).to eq "The broadcast has been updated"
end
it "updates the broadcast record" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(assigns(:broadcast)).to have_attributes(
stream_url_override: "https://example.com/streams/abcd",
stream_key_override: "abcdef",
)
end
context "when record cannot be saved" do
before do
allow_any_instance_of(Broadcast).to receive(:update).and_return(false)
end
it "re-displays the form" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(response).to be_successful
expect(flash.notice).to be_nil
end
end
end
private
def broadcast_update_params
{
stream_url_override: "https://example.com/streams/abcd",
stream_key_override: "abcdef",
director_mode_video_embed: "<iframe>Video player</iframe>",
}
end
end

View File

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

View File

@@ -0,0 +1,30 @@
require 'rails_helper'
RSpec.describe BroadcastRecordingsController, type: :controller do
render_views
let(:user) { create(:user) }
let(:account) { user.primary_account }
let(:project) { create(:project, account: user.primary_account) }
before do
sign_in user
end
describe "#destroy" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
before do
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
end
it "hides the broadcast recording" do
expect(recording.hidden).to be false
post :destroy, params: { project_id: project, broadcast_id: broadcast, id: recording }, xhr: true
expect(recording.reload.hidden).to be true
end
end
end

View File

@@ -184,6 +184,35 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: recording.download_file_name) expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: recording.download_file_name)
end end
end end
context "when virtual director video embed is available" do
let(:broadcast) { create(:broadcast, project: project, name: "Another Broadcast",
director_mode_video_embed: "<iframe>video player</iframe>") }
it "renders the view dropdown with a director mode enable option" do
get :show, params: { project_id: project, id: broadcast }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Enable Director Mode")
end
context "when director mode is enabled" do
it "shows the video embed" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_selector("iframe", text: "video player")
end
it "renders the view dropdown with a director mode disable option" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Disable Director Mode")
end
end
end
end end
describe "#update" do describe "#update" do

View File

@@ -4,96 +4,108 @@ RSpec.describe Public::AmendmentsController, type: :controller do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:account) { user.primary_account } let(:account) { user.primary_account }
let(:project) { create(:project, account: 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 render_views
describe "#new" do shared_examples "amendments signing controller" do
it "shows amendment signing form for non-signed amendment of a release" do describe "#new" do
expect(location_release.amendment_signed?).to be_falsey it "shows amendment signing form for non-signed amendment of a release" do
expect(subject.amendment_signed?).to be_falsey
get :new, params: { get :new, params: {
account_id: account, account_id: account,
project_id: project, project_id: project,
contract_template_id: location_release.contract_template, contract_template_id: subject.contract_template,
location_release_id: location_release "#{subject.model_name.param_key}_id": subject
} }
expect(response).to be_successful expect(response).to be_successful
body = CGI.unescape_html(response.body) body = CGI.unescape_html(response.body)
expect(body).not_to match already_signed_message expect(body).not_to match already_signed_message
end
it "shows already signed message for signed amendment of a release" do
expect(signed_release.amendment_signed?).to be_truthy
get :new, params: {
account_id: account,
project_id: project,
contract_template_id: signed_release.contract_template,
"#{signed_release.model_name.param_key}_id": signed_release
}
expect(response).to be_successful
body = CGI.unescape_html(response.body)
expect(body).to match already_signed_message
end
end end
it "shows already signed message for signed amendment of a release" do describe "#create" do
signed_release = create(:location_release, :amendment_signed, contract_template: contract_template, project: project) it "signs amendment" do
expect(subject.amendment_signed?).to be_falsey
expect(signed_release.amendment_signed?).to be_truthy post :create, params: {
account_id: account,
project_id: project,
contract_template_id: subject.contract_template,
"#{subject.model_name.param_key}_id": subject,
"#{subject.model_name.param_key}": {
amendment_signer_name: "Signer Name",
amendment_signature_base64: signature_base64
}
}
get :new, params: { expect(response).to be_successful
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).not_to match already_signed_message
expect(body).to match signed_successfully_message
body = CGI.unescape_html(response.body) expect(subject.class.last.amendment_signed?).to be_truthy
expect(body).to match already_signed_message expect(subject.class.last.amendment_signer_name).to eq "Signer Name"
end
it "shows already signed message for signed amendment of a release" do
expect(signed_release.amendment_signed?).to be_truthy
post :create, params: {
account_id: account,
project_id: project,
contract_template_id: signed_release.contract_template,
"#{signed_release.model_name.param_key}_id": signed_release,
"#{signed_release.model_name.param_key}": {
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 "Amendment Signer"
end
end end
end end
describe "#create" do context "for location release" do
it "signs amendment" do let(:contract_template) { create(:location_release_contract_template, :with_amendment_clause, project: project) }
expect(location_release.amendment_signed?).to be_falsey let(:signed_release) { create(:location_release, :amendment_signed, contract_template: contract_template, project: project) }
subject { create(:location_release, contract_template: contract_template, project: project) }
post :create, params: { it_behaves_like "amendments signing controller"
account_id: account, end
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 context "for location release" do
let(:contract_template) { create(:appearance_release_contract_template, :with_amendment_clause, project: project) }
let(:signed_release) { create(:appearance_release, :amendment_signed, contract_template: contract_template, project: project) }
subject { create(:appearance_release, contract_template: contract_template, project: project) }
body = CGI.unescape_html(response.body) it_behaves_like "amendments signing controller"
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 end
private private
@@ -109,4 +121,4 @@ RSpec.describe Public::AmendmentsController, type: :controller do
def signature_base64 def signature_base64
@signature_base64 ||= Base64Image.from_image(file_fixture('signature.png')).data_uri @signature_base64 ||= Base64Image.from_image(file_fixture('signature.png')).data_uri
end end
end end

View File

@@ -18,6 +18,16 @@ FactoryBot.define do
end end
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 factory :acquired_media_release_with_contract_template do
after(:build) do |acquired_media_release, _| after(:build) do |acquired_media_release, _|
acquired_media_release.contract_template = build(:acquired_media_release_contract_template) acquired_media_release.contract_template = build(:acquired_media_release_contract_template)

View File

@@ -32,6 +32,14 @@ FactoryBot.define do
end end
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 :minor do trait :minor do
minor true minor true
guardian_first_name "Jamie" guardian_first_name "Jamie"

View File

@@ -3,6 +3,7 @@ FactoryBot.define do
association :broadcast association :broadcast
file_name "high.mp4" file_name "high.mp4"
asset_uid "asset_uid" asset_uid "asset_uid"
asset_playback_uid "asset_playback_uid" asset_playback_uid "asset_playback_uid"
hidden { false }
end end
end end

View File

@@ -16,6 +16,17 @@ FactoryBot.define do
streamer_status "idle" streamer_status "idle"
end end
trait :with_overriden_stream 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"
stream_url_override "overriden_stream_url"
stream_key_override "overriden_stream_key"
end
trait :with_files do trait :with_files do
files do files do
[ [

View File

@@ -15,6 +15,16 @@ FactoryBot.define do
end end
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 trait :with_photo do
photos do photos do
path = Rails.root.join("spec", "fixtures", "files", "material_photo.png") path = Rails.root.join("spec", "fixtures", "files", "material_photo.png")

View File

@@ -66,6 +66,18 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(ContractTemplate.last.amendment_clause.body.to_s).to match /Amendment clause text/ expect(ContractTemplate.last.amendment_clause.body.to_s).to match /Amendment clause text/
end end
scenario 'appearance release template has a amendment clause field' do
visit new_project_contract_template_path(project)
fill_in 'Name', with: 'My Release Template'
select 'Appearance 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 scenario 'medical release template has a guardian clause field' do
visit new_project_contract_template_path(project) visit new_project_contract_template_path(project)
@@ -160,7 +172,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(content_disposition).to include('inline') expect(content_disposition).to include('inline')
expect(pdf_body).to have_content('PREVIEW ONLY') expect(pdf_body).to have_content('PREVIEW ONLY')
expect(pdf_body).to have_content('Acquired Media Release') 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) visit new_project_contract_template_path(project)
select 'Location Release', from: 'Release type' select 'Location Release', from: 'Release type'
@@ -178,7 +190,7 @@ RSpec.feature 'User manages contract templates', type: :feature do
expect(content_disposition).to include('inline') expect(content_disposition).to include('inline')
expect(pdf_body).to have_content('PREVIEW ONLY') expect(pdf_body).to have_content('PREVIEW ONLY')
expect(pdf_body).to have_content('Material Release') expect(pdf_body).to have_content('Material Release')
expect(pdf_body).not_to have_content('Guardian') expect(pdf_body).to have_content('Guardian')
end end
context 'preventing creation of release template with wrong fee value' do context 'preventing creation of release template with wrong fee value' do

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(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 drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
click_button "Upload Files" click_button "Upload Files"

View File

@@ -12,7 +12,7 @@ feature "User managing acquired_media releases" do
expect(country_field_value).to eq "US" expect(country_field_value).to eq "US"
end 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) contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template) 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" draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
end 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("Video Footage")
expect(AcquiredMediaRelease.last.categories).to include("Still Photograph") 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 end
scenario "creating a release, if contract template contains signature legal language, it is shown" do 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 end
context "when signed in" do 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 scenario "creating, updating, destroying a release", js: true do
release_data = { release_data = {
name: "Test Acquired Media Release", name: "Test Acquired Media Release",
@@ -65,7 +275,7 @@ feature "User managing acquired_media releases" do
visit new_project_acquired_media_release_path(project) visit new_project_acquired_media_release_path(project)
by "attaching only a contract" do 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 click_button create_release_button
expect(page).to have_invalid_field(acquired_media_name_field) expect(page).to have_invalid_field(acquired_media_name_field)
@@ -117,7 +327,7 @@ feature "User managing acquired_media releases" do
end end
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, acquired_media_release = create(:acquired_media_release_with_contract_template,
:native, :native,
project: project, project: project,
@@ -176,6 +386,25 @@ feature "User managing acquired_media releases" do
expect(pdf_body).to have_content("Other files") expect(pdf_body).to have_content("Other files")
end 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 scenario "searching for a release", js: true do
collection1 = create(:acquired_media_release, name: "EDM Music", project: project) collection1 = create(:acquired_media_release, name: "EDM Music", project: project)
collection2 = create(:acquired_media_release, name: "Classical 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 def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued' t 'contracts.for_office_use_only.description_labels.date_issued'
end 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 end

View File

@@ -144,6 +144,49 @@ feature 'User managing appearance releases' do
expect(page).to have_content dummy_signature_legal_text expect(page).to have_content dummy_signature_legal_text
end end
scenario "signing amendment for a not-signed amendment release", js: true do
contract_template = create(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_falsey
visit new_account_project_contract_template_appearance_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content amendments_heading
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(AppearanceRelease.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(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, :amendment_signed, contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_truthy
visit new_account_project_contract_template_appearance_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(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_appearance_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
end end
context 'when signed in' do context 'when signed in' do
@@ -292,7 +335,81 @@ feature 'User managing appearance releases' do
expect(page).to have_content('New Name') expect(page).to have_content('New Name')
end end
scenario 'viewing the contract PDF' do scenario "signing amendment for a not-signed amendment release", js: true do
contract_template = create(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, person_first_name: "First", contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_falsey
visit project_appearance_releases_path(project)
expect(page).to have_content "First"
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
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(AppearanceRelease.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(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, :amendment_signed, person_first_name: "Firstn", contract_template: contract_template, project: project)
expect(release.amendment_signed?).to be_truthy
visit project_appearance_releases_path(project)
expect(page).to have_content "Firstn"
click_on manage_button
expect(page).not_to have_link sign_amendment_link
end
scenario "signed amendment release have checked box in appearance releases index table", js: true do
contract_template = create(:appearance_release_contract_template, :with_amendment_clause, project: project)
not_signed_release = create(:appearance_release, person_first_name: "Firstn", contract_template: contract_template, project: project)
expect(not_signed_release.amendment_signed?).to be_falsey
visit project_appearance_releases_path(project)
expect(page).to have_content "Firstn"
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(:appearance_release, :amendment_signed, person_first_name: "Signedn", contract_template: contract_template, project: project)
expect(signed_release.amendment_signed?).to be_truthy
visit project_appearance_releases_path(project)
expect(page).to have_content "Signedn"
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(:appearance_release_contract_template, :with_amendment_clause, project: project)
release = create(:appearance_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_appearance_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
scenario 'viewing the contract PDF when amendment is not yet signed' do
appearance_release = create(:appearance_release_with_contract_template, appearance_release = create(:appearance_release_with_contract_template,
:native, :native,
project: project, project: project,
@@ -319,6 +436,7 @@ feature 'User managing appearance releases' do
expect(content_type).to eq('application/pdf') expect(content_type).to eq('application/pdf')
expect(content_disposition).to include('inline') expect(content_disposition).to include('inline')
expect(pdf_filename).to include('doe-jane') expect(pdf_filename).to include('doe-jane')
expect(pdf_body).not_to have_content amendment_page_heading
expect(pdf_body).to have_content('Jane Doe') expect(pdf_body).to have_content('Jane Doe')
expect(pdf_body).to have_content('NOTES') expect(pdf_body).to have_content('NOTES')
expect(pdf_body).to have_content('Note 1') expect(pdf_body).to have_content('Note 1')
@@ -333,6 +451,35 @@ feature 'User managing appearance releases' do
expect(pdf_body).not_to have_content('Guardian Email') expect(pdf_body).not_to have_content('Guardian Email')
end end
scenario "viewing the contract PDF when amendment is signed" do
contract_template = create(:appearance_release_contract_template, :with_amendment_clause, project: project)
appearance_release = create(:appearance_release,
:amendment_signed,
:native,
contract_template: contract_template,
project: project,
person_first_name: "John",
person_last_name: "Doe")
sign_in(current_user)
visit project_appearance_releases_path(project)
click_link *view_release_pdf_link_for(appearance_release)
expect(content_type).to eq("application/pdf")
expect(content_disposition).to include("inline")
expect(pdf_filename).to include("doe-john")
expect(pdf_body).to have_content("John Doe")
expect(pdf_body).to have_content amendment_page_heading.upcase
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 appearance_release.amendment_signer_name
end
scenario 'viewing contract PDF for a minor without guardian photo' do scenario 'viewing contract PDF for a minor without guardian photo' do
appearance_release = create(:appearance_release_with_contract_template, :native, :minor, project: project) appearance_release = create(:appearance_release_with_contract_template, :native, :minor, project: project)
@@ -373,7 +520,7 @@ feature 'User managing appearance releases' do
visit project_appearance_releases_path(project) visit project_appearance_releases_path(project)
click_on 'Manage' click_on manage_button
accept_alert do accept_alert do
click_link *destroy_link_for(appearance_release) click_link *destroy_link_for(appearance_release)
end end
@@ -576,7 +723,7 @@ feature 'User managing appearance releases' do
create(:appearance_release_with_contract_template, :native, project: project) create(:appearance_release_with_contract_template, :native, project: project)
visit project_appearance_releases_path(project) visit project_appearance_releases_path(project)
click_on "Manage" click_on manage_button
expect(page).not_to have_link(review_action, exact: true) expect(page).not_to have_link(review_action, exact: true)
end end
@@ -594,7 +741,7 @@ feature 'User managing appearance releases' do
visit project_appearance_releases_path(project) visit project_appearance_releases_path(project)
click_on 'Manage' click_on manage_button
expect(page).not_to have_link('Download', exact: true) expect(page).not_to have_link('Download', exact: true)
end end
@@ -602,7 +749,7 @@ feature 'User managing appearance releases' do
create(:appearance_release_with_contract_template, :native, project: project) create(:appearance_release_with_contract_template, :native, project: project)
visit project_appearance_releases_path(project) visit project_appearance_releases_path(project)
click_on "Manage" click_on manage_button
expect(page).not_to have_link(review_action, exact: true) expect(page).not_to have_link(review_action, exact: true)
end end
@@ -866,4 +1013,56 @@ feature 'User managing appearance releases' do
def date_issued def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued' t 'contracts.for_office_use_only.description_labels.date_issued'
end end
def amendments_heading
t 'public.amendments.new.amendment.heading'
end
def amendment_signer_name_field
'appearance_release[amendment_signer_name]'
end
def amendment_signature_field
'appearance_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 'appearance_releases.appearance_release.actions.manage'
end
def sign_amendment_link
t 'appearance_releases.appearance_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
end end

View File

@@ -3,6 +3,7 @@
require 'rails_helper' require 'rails_helper'
feature 'User managing broadcasts' do feature 'User managing broadcasts' do
let(:current_user) { create(:user, :manager) } let(:current_user) { create(:user, :manager) }
let(:project) { create(:project, members: current_user, account: current_user.primary_account) } let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
@@ -50,7 +51,7 @@ feature 'User managing broadcasts' do
scenario 'visit show page of broadcast', js: true do scenario 'visit show page of broadcast', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project) broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast) recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
visit project_broadcast_path(project, broadcast) visit project_broadcast_path(project, broadcast)
@@ -204,6 +205,24 @@ feature 'User managing broadcasts' do
end end
end end
scenario 'project manager can hide broadcast recordings', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).to have_content('Hide')
accept_alert do
click_link "Hide"
end
expect(page).not_to have_content(recording.download_file_name)
expect(page).to have_content("Recording of the live stream will appear here")
end
context 'When the user is associate' do context 'When the user is associate' do
let(:current_user) { create(:user, :associate) } let(:current_user) { create(:user, :associate) }
@@ -221,6 +240,17 @@ feature 'User managing broadcasts' do
expect(page).to have_content delete_file_button, count: 0 expect(page).to have_content delete_file_button, count: 0
end end
scenario 'associate does not see hide button in front of recording' do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).not_to have_content('Hide')
end
end end
context 'When the user is account manager' do context 'When the user is account manager' do
@@ -247,6 +277,24 @@ feature 'User managing broadcasts' do
expect(page).to have_content delete_file_button, count: 2 expect(page).to have_content delete_file_button, count: 2
expect(Broadcast.find(broadcast.id).files.count).to eq 2 expect(Broadcast.find(broadcast.id).files.count).to eq 2
end end
scenario 'account manager can hide broadcast recordings', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).to have_content('Hide')
accept_alert do
click_link "Hide"
end
expect(page).not_to have_content(recording.download_file_name)
expect(page).to have_content("Recording of the live stream will appear here")
end
end end
end end

View File

@@ -127,6 +127,14 @@ feature "User managing location releases" do
sign_in current_user sign_in current_user
end 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 scenario "creating a release", js: true do
visit new_project_location_release_path(project) visit new_project_location_release_path(project)
@@ -243,6 +251,9 @@ feature "User managing location releases" do
new_window = window_opened_by { click_link sign_amendment_link } new_window = window_opened_by { click_link sign_amendment_link }
within_window new_window do within_window new_window do
expect(page).to have_content amendments_heading expect(page).to have_content amendments_heading
expect(page).to have_content signed_contract_preview.upcase
expect(page).to have_selector 'embed'
fill_in amendment_signer_name_field, with: 'Big Signer' fill_in amendment_signer_name_field, with: 'Big Signer'
draw_signature file_fixture("signature.png"), amendment_signature_field draw_signature file_fixture("signature.png"), amendment_signature_field
@@ -365,7 +376,7 @@ feature "User managing location releases" do
expect(pdf_body).to have_content("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_page_heading.upcase
expect(pdf_body).to have_content amendment_clause_label 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_signer_name_label
expect(pdf_body).to have_content amendment_signature_label expect(pdf_body).to have_content amendment_signature_label
@@ -682,6 +693,10 @@ feature "User managing location releases" do
t 'public.amendments.new.amendment.heading' t 'public.amendments.new.amendment.heading'
end end
def signed_contract_preview
t 'public.amendments.new.signed_contract_preview'
end
def amendment_signer_name_field def amendment_signer_name_field
'location_release[amendment_signer_name]' 'location_release[amendment_signer_name]'
end end
@@ -729,4 +744,16 @@ feature "User managing location releases" do
def amendment_signature_label def amendment_signature_label
t 'contracts.amendment_page.description_labels.amendment_signature' t 'contracts.amendment_page.description_labels.amendment_signature'
end end
def table_headers
[
t('location_releases.index.table_headers.approved'),
t('location_releases.index.table_headers.location_info'),
t('location_releases.index.table_headers.owner_info'),
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 end

View File

@@ -40,6 +40,93 @@ feature "User managing material releases" do
expect(MaterialRelease.last.photos.attached?).to eq true expect(MaterialRelease.last.photos.attached?).to eq true
end 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 scenario "creating release is possible only after filling all fields", js: true do
contract_template = create(:contract_template, project: project) contract_template = create(:contract_template, project: project)
@@ -98,7 +185,7 @@ feature "User managing material releases" do
sign_in current_user sign_in current_user
end 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) visit new_project_material_release_path(project)
by "attaching only a contract" do by "attaching only a contract" do
@@ -120,13 +207,94 @@ feature "User managing material releases" do
click_button create_release_button click_button create_release_button
expect(page).to have_content(create_release_notice) 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" click_on "Manage"
expect(page).to have_link("Download") expect(page).to have_link("Download")
end end
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 scenario "updating an existing release", js: true do
material_release = create(:material_release, :non_native, project: project) material_release = create(:material_release, :non_native, project: project)
@@ -190,7 +358,7 @@ feature "User managing material releases" do
click_on "Save Changes" click_on "Save Changes"
expect(page).to have_content("The release has been updated") 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 end
scenario "viewing the contract PDF" do scenario "viewing the contract PDF" do
@@ -419,8 +587,8 @@ feature "User managing material releases" do
"material_release[person_address_zip]" "material_release[person_address_zip]"
end end
def have_photo(filename) def have_photo(filename, visible: true)
have_selector("img[src*='#{filename}']") have_selector("img[src*='#{filename}']", visible: visible)
end end
def import_material_release_link(project) def import_material_release_link(project)
@@ -542,4 +710,107 @@ feature "User managing material releases" do
def date_issued def date_issued
t 'contracts.for_office_use_only.description_labels.date_issued' t 'contracts.for_office_use_only.description_labels.date_issued'
end 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 end

View File

@@ -49,6 +49,36 @@ RSpec.describe Broadcast, type: :model do
expect(broadcast).to have_received(:destroy_mux_live_stream) expect(broadcast).to have_received(:destroy_mux_live_stream)
end end
end end
context "#stream_server_url" do
it "returns mux stream url when overriden stream url is absent" do
ENV["MUX_BROADCAST_SERVER_URL"] = "mux_stream"
broadcast = create(:broadcast, :with_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_url).to eq("mux_stream")
end
it "returns overriden stream url when it is present" do
ENV["MUX_BROADCAST_SERVER_URL"] = "mux_stream"
broadcast = create(:broadcast, :with_overriden_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_url).to eq("overriden_stream_url")
end
end
context "#stream_server_key" do
it "returns mux stream key when overriden stream key is absent" do
broadcast = create(:broadcast, :with_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_key).to eq("mux_key")
end
it "returns overriden stream key when it is present" do
broadcast = create(:broadcast, :with_overriden_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_key).to eq("overriden_stream_key")
end
end
end end
describe "#zoom_meeting_url" do describe "#zoom_meeting_url" do