Compare commits

..

13 Commits

Author SHA1 Message Date
Bilal
0ccae951a5 rebase 2020-09-16 11:30:02 +03:00
Bilal
142efee2ca improve specs 2020-09-16 11:28:51 +03:00
Bilal
219dfc8da0 add dailyco feature flag 2020-09-16 11:28:51 +03:00
Bilal
1aa4af074b add dailyco feature flag 2020-09-16 11:28:51 +03:00
Bilal
afd51a51f0 change ENV name 2020-09-16 11:28:01 +03:00
Bilal
6fff636f5c new specs 2020-09-16 11:28:01 +03:00
Bilal
ba4e6767f7 create live meeting when Conference button is clicked 2020-09-16 11:28:01 +03:00
Bilal
fcc856f7fc add new specs 2020-09-16 11:28:01 +03:00
Bilal
1a7bc267cd fix existing specs 2020-09-16 11:28:01 +03:00
Bilal
de0b12a0e4 add live meeting in broadcast screen 2020-09-16 11:28:01 +03:00
Senad Uka
28e0eb36b7 Upstream sync 2020-09-16 05:39:08 +02:00
Senad Uka
5cf7be6f13 Upstream sync 2020-09-13 20:09:48 +02:00
Senad Uka
3db230de9b Upstream sync 2020-09-09 05:33:57 +02:00
117 changed files with 1416 additions and 380 deletions

View File

@@ -32,3 +32,9 @@ CUSTOM_API_TOKEN=
# Required for simulcasting to Millicast for director mode # Required for simulcasting to Millicast for director mode
MILLICAST_API_SECRET= MILLICAST_API_SECRET=
MILLICAST_ACCOUNT_ID= MILLICAST_ACCOUNT_ID=
# Daily.co live chat API token
DAILYCO_API_KEY=
# Feature flag to switch between Zoom and Daily.co live meeting
DAILYCO_ENABLED= 1 (on) / 0 (off); When Off, Zoom meeting will be used if no override url is present

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,7 @@
$(document).on("turbolinks:load", function() {
bsCustomFileInput.init();
})
$(document).on("turbolinks:load", function() {
$(".toast").toast('show');
})

View File

@@ -24,7 +24,7 @@ $(document).on "turbolinks:load", ->
stream_selected = $("#broadcast_video").data('videoType') == 'stream'; stream_selected = $("#broadcast_video").data('videoType') == 'stream';
if data.streamer_status == 'recording' && data.status == 'active' && stream_selected if data.streamer_status == 'recording' && data.status == 'active' && stream_selected
$("#broadcast_video").html data.video_content $("#broadcast_video").html data.video_content
$("#live_take").html data.live_take_content $("#recording_status").html data.recording_status_content
new (Clappr.Player)( new (Clappr.Player)(
<%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %> <%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %>
@@ -37,12 +37,13 @@ $(document).on "turbolinks:load", ->
hlsMinimumDvrSize: 1) hlsMinimumDvrSize: 1)
if data.streamer_status == "idle" && data.status == "idle" if data.streamer_status == "idle" && data.status == "idle"
$("#broadcast_video").html data.video_content $("#broadcast_video").html data.video_content
$("#live_take").html data.live_take_content $("#recording_status").html data.recording_status_content
showBroadcastRecordings: (data) -> showBroadcastRecordings: (data) ->
$(".flash-message").html data.flash_content $(".flash-message").html data.flash_content
$("#broadcast_recordings").html data.recordings_content $("#broadcast_recordings").html data.recordings_content
$("#broadcast_recordings_nav").html data.recordings_nav_content $("#broadcast_recordings_nav").html data.recordings_nav_content
$(".toast").toast('show')
refreshBroadcastFilesTab: (data) -> refreshBroadcastFilesTab: (data) ->
$("#broadcast_file_list_#{data.broadcast_token}").html data.files_content $("#broadcast_file_list_#{data.broadcast_token}").html data.files_content

View File

@@ -23,3 +23,4 @@ $(document).on "turbolinks:load", ->
showDownloadStatusUpdate: (content) -> showDownloadStatusUpdate: (content) ->
$(".flash-message").html content $(".flash-message").html content
$(".toast").toast('show')

View File

@@ -1,3 +0,0 @@
$(document).on("turbolinks:load", function() {
bsCustomFileInput.init()
})

View File

@@ -1,4 +1,7 @@
$(document).on("click", "[data-behavior=play_recording]", function() { $(document).on("click", "[data-behavior=play_recording]", function() {
clearPlayingHighlight();
$(this).parent().parent().addClass('playing-highlight');
$("#broadcast_video").data('videoType', 'recording'); $("#broadcast_video").data('videoType', 'recording');
var playback_url = $(this).attr("data-playback-url") var playback_url = $(this).attr("data-playback-url")
@@ -14,4 +17,11 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
}); });
}); });
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").data('videoType', 'stream'); }); $(document).on("click", "[data-behavior=play_stream]", function() {
// clearPlayingHighlight();
$("#broadcast_video").data('videoType', 'stream');
});
function clearPlayingHighlight() {
$(".playing-highlight").removeClass("playing-highlight");
}

View File

@@ -1,4 +1,30 @@
// Do not allow file attachments in rich text content // Do not allow file attachments in rich text content
addEventListener("trix-file-accept", function(event) { addEventListener("trix-file-accept", function(event) {
event.preventDefault(); event.preventDefault();
}) });
Trix.config.textAttributes.underline = {
style: { "textDecoration": "underline" },
inheritable: true,
parser: function (element) {
var style = window.getComputedStyle(element);
return style.textDecoration === "underline";
}
}
document.addEventListener('trix-initialize', function (e) {
const trix = e.target;
const toolBar = trix.toolbarElement;
// // Creation of the button
const button = document.createElement("button");
button.setAttribute("type", "button");
button.setAttribute("class", "trix-button trix-button--icon trix-button--icon-underline");
button.setAttribute("data-trix-attribute", "underline");
button.setAttribute("title", "underline");
button.setAttribute("tabindex", "-1");
button.innerText = "U";
// Attachment of the button to the toolBar
toolBar.querySelector('.trix-button-group--text-tools').appendChild(button);
});

View File

@@ -461,3 +461,64 @@ a[data-behavior=seekable-timecode] {
border-color: transparent; border-color: transparent;
border-bottom: 3px solid #ff0000; border-bottom: 3px solid #ff0000;
} }
//Trix underline style
trix-toolbar {
.trix-button--icon-underline::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z'/%3E%3C/svg%3E");
}
}
// Play button SVG
.play-btn {
width: 60%;
height: auto;
}
.play-btn-svg{
transition: 0.3s;
stroke:#fedfc2;
opacity: 0;
}
.play-btn:hover .play-btn-svg {
fill-opacity: 0;
opacity: 1;
}
// Play button in video thumbnail preview
.play-thumbnail { position: relative; }
.play-thumbnail img { display: block; }
.play-thumbnail .play-btn { position: absolute; bottom:5px; left:10px; }
// Active recording highlight
.playing-highlight {
background-color: scale-color($primary, $lightness: 80%);
}
// Toast min width and border radius
.toast-min-w-border-radius {
min-width: 18rem;
border-radius: 0.8rem;
}
// Toast left border primary
.toast-border-left-primary {
border-left: 8px solid $primary;
}
// Toast left border danger
.toast-border-left-danger {
border-left: 8px solid $danger;
}
// Change link color to primary on toast notifications
.toast {
a {
color: $primary;
}
a.btn {
color: white;
}
}

View File

@@ -48,6 +48,10 @@ u {
margin-right: -30px; margin-right: -30px;
} }
.embed-person-photo {
text-align: right;
}
.do-not-copy-warning { .do-not-copy-warning {
padding-right: 15px; padding-right: 15px;
} }

View File

@@ -11,7 +11,7 @@ class BroadcastsChannel < ApplicationCable::Channel
def self.broadcast_stream_updates(broadcast) def self.broadcast_stream_updates(broadcast)
status_content = ApplicationController.render partial: "broadcasts/broadcast_status", locals: { broadcast: broadcast } status_content = ApplicationController.render partial: "broadcasts/broadcast_status", locals: { broadcast: broadcast }
video_content = ApplicationController.render partial: "broadcasts/video", locals: { broadcast: broadcast } video_content = ApplicationController.render partial: "broadcasts/video", locals: { broadcast: broadcast }
live_take = ApplicationController.render partial: "broadcasts/live_take", locals: { broadcast: broadcast } recording_status_content = ApplicationController.render partial: "broadcasts/recording_status", locals: { broadcast: broadcast }
broadcast_to broadcast, { broadcast_to broadcast, {
event: :broadcast_stream_update, event: :broadcast_stream_update,
@@ -19,7 +19,7 @@ class BroadcastsChannel < ApplicationCable::Channel
playback_url: broadcast.stream_playback_url, playback_url: broadcast.stream_playback_url,
full_live_stream_playback_url: broadcast.full_live_stream_playback_url, full_live_stream_playback_url: broadcast.full_live_stream_playback_url,
video_content: video_content, video_content: video_content,
live_take_content: live_take, recording_status_content: recording_status_content,
status_content: status_content, status_content: status_content,
streamer_status: broadcast.streamer_status streamer_status: broadcast.streamer_status
} }

View File

@@ -1,4 +1,5 @@
class AccountSessionsController < ApplicationController class AccountSessionsController < ApplicationController
skip_before_action :redirect_locked_accounts
def update def update
authorize :account_session, :update? authorize :account_session, :update?
session[:active_account] = account_session_params[:account_id] session[:active_account] = account_session_params[:account_id]

View File

@@ -0,0 +1,31 @@
class Admin::AccountLocksController < Admin::ApplicationController
before_action :set_account
def create
authorize :account_lock, :create?
@account.update(locked: true)
redirect_to admin_accounts_path, notice: 'Account locked'
end
def destroy
authorize :account_lock, :destroy?
@account.update(locked: false)
redirect_to admin_accounts_path, notice: 'Account unlocked'
end
private
def set_account
if params[:account_id].present?
@account = Account.find_by(slug: params[:account_id])
else
failure_redirect
end
rescue ActiveRecord::RecordNotFound
failure_redirect
end
def failure_redirect
redirect_to admin_accounts_path, alert: 'Failed to find the account'
end
end

View File

@@ -13,6 +13,7 @@ class ApplicationController < ActionController::Base
include SetCurrentRequestDetails include SetCurrentRequestDetails
before_action :redirect_accountless before_action :redirect_accountless
before_action :redirect_locked_accounts
private private
@@ -29,6 +30,12 @@ class ApplicationController < ActionController::Base
end end
end end
def redirect_locked_accounts
if Current.user && !Current.user.admin? && Current.account.present? && Current.account.locked?
redirect_to locked_account_path
end
end
def signed_in_as_admin? def signed_in_as_admin?
signed_in? && current_user.admin? signed_in? && current_user.admin?
end end

View File

@@ -1,34 +0,0 @@
class BroadcastRecordingStarringsController < ApplicationController
layout "project"
before_action :set_project
before_action :set_broadcast
before_action :set_recording
def create
@recording.toggle_star
set_recordings
end
private
def broadcast_recording_params
params.require(:broadcast_recording).permit(:name, :description)
end
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[:broadcast_recording_id])
end
def set_recordings
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
end
end

View File

@@ -5,14 +5,6 @@ class BroadcastRecordingsController < ApplicationController
before_action :set_broadcast before_action :set_broadcast
before_action :set_recording before_action :set_recording
def edit
end
def update
@recording.update(broadcast_recording_params)
set_recordings
end
def destroy def destroy
@recording.update(hidden: true) @recording.update(hidden: true)
set_recordings set_recordings
@@ -20,10 +12,6 @@ class BroadcastRecordingsController < ApplicationController
private private
def broadcast_recording_params
params.require(:broadcast_recording).permit(:name, :description)
end
def set_project def set_project
@project = policy_scope(Project).find(params[:project_id]) @project = policy_scope(Project).find(params[:project_id])
end end

View File

@@ -114,7 +114,12 @@ class BroadcastsController < ApplicationController
end end
def conference_url_for(broadcast) def conference_url_for(broadcast)
broadcast.video_conference_url_override.presence || url_for([broadcast.project, broadcast, :zoom_meeting]) if broadcast.video_conference_url_override.present?
broadcast.video_conference_url_override
else
conference_type = ENV['DAILYCO_ENABLED'] == '1' ? :live_meeting : :zoom_meeting
url_for([broadcast.project, broadcast, conference_type])
end
end end
def log_create_analytics def log_create_analytics

View File

@@ -3,7 +3,7 @@ class ContractsController < ApplicationController
respond_to do |format| respond_to do |format|
format.pdf { send_contract_pdf } format.pdf { send_contract_pdf }
if Rails.env.development? if Rails.env.development? || Rails.env.test?
format.html { render_sample_html } format.html { render_sample_html }
end end
end end

View File

@@ -0,0 +1,11 @@
class LiveMeetingsController < ApplicationController
def show
authorize broadcast = Broadcast.find(params[:broadcast_id])
if broadcast.project.live_meeting_url.blank?
room = Daily.create_room
room_url = room['url']
broadcast.project.update live_meeting_url: room_url
end
@live_meeting_url = broadcast.project.live_meeting_url
end
end

View File

@@ -0,0 +1,10 @@
class LockedAccountsController < ApplicationController
skip_before_action :redirect_locked_accounts
skip_after_action :verify_policy_scoped
def index
unless Current.account.locked?
redirect_to projects_path
end
end
end

View File

@@ -0,0 +1,24 @@
class Public::BroadcastRecordingStarringsController < Public::BaseController
skip_after_action :verify_authorized
before_action :set_broadcast
before_action :set_recording
def create
@recording.toggle_star
set_recordings
end
private
def set_broadcast
@broadcast = Broadcast.find_by_token(params[:broadcast_token])
end
def set_recording
@recording = @broadcast.broadcast_recordings.find(params[:broadcast_recording_id])
end
def set_recordings
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
end
end

View File

@@ -0,0 +1,31 @@
class Public::BroadcastRecordingsController < Public::BaseController
skip_after_action :verify_authorized
before_action :set_broadcast, only: [:edit, :update]
before_action :set_recording, only: [:edit, :update]
def edit
end
def update
@recording.update(broadcast_recording_params)
set_recordings
end
private
def broadcast_recording_params
params.require(:broadcast_recording).permit(:name, :description)
end
def set_broadcast
@broadcast = Broadcast.find_by_token(params[:broadcast_token])
end
def set_recording
@recording = @broadcast.broadcast_recordings.find(params[:id])
end
def set_recordings
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
end
end

View File

@@ -44,7 +44,11 @@ class Public::BroadcastsController < Public::BaseController
end end
def conference_url_for(broadcast) def conference_url_for(broadcast)
broadcast.video_conference_url_override.presence || broadcast_zoom_meeting_url(broadcast.token) if broadcast.video_conference_url_override.present?
broadcast.video_conference_url_override
else
ENV['DAILYCO_ENABLED'] == '1' ? broadcast_live_meeting_url(broadcast.token) : broadcast_zoom_meeting_url(broadcast.token)
end
end end
class MultiViewBroadcast class MultiViewBroadcast

View File

@@ -0,0 +1,9 @@
class Public::LiveMeetingsController < Public::BaseController
skip_after_action :verify_authorized
def show
broadcast = Broadcast.find_by_token!(params[:broadcast_token])
@live_meeting_url = broadcast.project.live_meeting_url
render 'public/live_meetings/show'
end
end

View File

@@ -2,7 +2,7 @@ class VideoAnalyses::AcquiredMediaReleasesController < ApplicationController
before_action :set_video before_action :set_video
def index def index
@acquired_media_file_infos = filtered_file_infos @acquired_media_files = filtered_files
end end
private private
@@ -15,12 +15,12 @@ class VideoAnalyses::AcquiredMediaReleasesController < ApplicationController
params[:query] params[:query]
end end
def filtered_file_infos def filtered_files
releasables = policy_scope(@video.acquired_media_releases) releasables = policy_scope(@video.acquired_media_releases)
results = FileInfo.where(releasable: releasables) results = ActiveStorage::Attachment.where(record: releasables, name: "files")
if query_param.present? if query_param.present?
results = results.search_filename(query_param) results = results.joins(:blob).where("active_storage_blobs.filename ILIKE ?", "%#{query_param}%")
end end
results results

View File

@@ -74,6 +74,7 @@ class VideoReleaseConfirmationsController < ApplicationController
params.require(:video_release_confirmation).permit( params.require(:video_release_confirmation).permit(
:time_elapsed, :time_elapsed,
:file_info_id, :file_info_id,
:file_id,
:channel, :channel,
:timecode_in, :timecode_in,
:timecode_out, :timecode_out,

View File

@@ -40,4 +40,13 @@ module DropzoneHelper
{ name: file_info.filename, size: file_info.byte_size, type: file_info.content_type } { name: file_info.filename, size: file_info.byte_size, type: file_info.content_type }
end.to_json end.to_json
end end
def dropzone_file_size_limit_for(releasable)
case releasable.model_name.param_key
when "material_release", "acquired_media_release"
1000000
else
256
end
end
end end

View File

@@ -12,6 +12,7 @@ class ActiveStorageDropzone {
var acceptedFiles = $(element).data("accepted-files") || "image/*"; var acceptedFiles = $(element).data("accepted-files") || "image/*";
var dictDefaultMessage = $(element).data("placeholder") || "Drop files here"; var dictDefaultMessage = $(element).data("placeholder") || "Drop files here";
var submitButton = $($(element).data("submit-button")); var submitButton = $($(element).data("submit-button"));
var maxFileSize = $(element).data("max-file-size");
var that = this; var that = this;
this.myDropzone = new this.DropzoneClass(element, { this.myDropzone = new this.DropzoneClass(element, {
@@ -20,6 +21,7 @@ class ActiveStorageDropzone {
acceptedFiles: acceptedFiles, acceptedFiles: acceptedFiles,
parallelUploads: 30, parallelUploads: 30,
dictDefaultMessage: dictDefaultMessage, dictDefaultMessage: dictDefaultMessage,
maxFilesize: maxFileSize,
init: function () { init: function () {
this.on("sending", (file, xhr, formData) => { this.on("sending", (file, xhr, formData) => {

View File

@@ -15,6 +15,7 @@ class MatchAppearanceReleasesJob < ApplicationJob
matches = response.matches || [] matches = response.matches || []
key_signed_id_hash = Hash[filtered_attachments_object[:keys].zip(filtered_attachments_object[:signed_ids])] key_signed_id_hash = Hash[filtered_attachments_object[:keys].zip(filtered_attachments_object[:signed_ids])]
handle_matches matches, project, key_signed_id_hash handle_matches matches, project, key_signed_id_hash
handle_unmatches matches, project, key_signed_id_hash
matching_request.destroy matching_request.destroy
end end
@@ -40,6 +41,21 @@ class MatchAppearanceReleasesJob < ApplicationJob
end end
end end
def handle_unmatches(matches, project, key_signed_id_hash)
matched_keys = matches.flat_map { |match| match.contracts + match.headshots }
unmatches = key_signed_id_hash.find_all { |key, _| !key.in?(matched_keys) }
unmatches.each do |key, signed_id|
blob = ActiveStorage::Blob.find_signed signed_id
if blob.image?
create_release(project, nil, signed_id, nil)
else
create_release(project, signed_id, nil, nil)
end
end
end
def create_release(project, contract, headshot, identifier) def create_release(project, contract, headshot, identifier)
random_contract_no = AppearanceRelease.random_contract_number.to_s random_contract_no = AppearanceRelease.random_contract_number.to_s
is_incomplete = contract.nil? || headshot.nil? is_incomplete = contract.nil? || headshot.nil?

View File

@@ -18,7 +18,7 @@ class ContractTemplate < ApplicationRecord
has_many :medical_releases, dependent: :restrict_with_error has_many :medical_releases, dependent: :restrict_with_error
has_many :misc_releases, dependent: :restrict_with_error has_many :misc_releases, dependent: :restrict_with_error
monetize :fee_cents monetize :fee_old_cents
has_rich_text :body has_rich_text :body
has_rich_text :guardian_clause has_rich_text :guardian_clause
has_rich_text :signature_legal_text has_rich_text :signature_legal_text
@@ -29,7 +29,7 @@ class ContractTemplate < ApplicationRecord
validates :name, presence: true validates :name, presence: true
validates :release_type, presence: true validates :release_type, presence: true
validates :fee_cents, numericality: { validates :fee_old_cents, numericality: {
greater_than_or_equal_to: 0, greater_than_or_equal_to: 0,
less_than_or_equal_to: 99_999_999_99 less_than_or_equal_to: 99_999_999_99
} }
@@ -50,7 +50,11 @@ class ContractTemplate < ApplicationRecord
enum accessibility: [:public_template, :private_template] enum accessibility: [:public_template, :private_template]
def fee? def fee?
!fee.zero? fee.present?
end
def fee_old?
!fee_old.zero?
end end
def releases def releases

View File

@@ -9,6 +9,10 @@ class VideoReleaseConfirmation < ApplicationRecord
Timecode.from_seconds(time_elapsed.to_f).to_s Timecode.from_seconds(time_elapsed.to_f).to_s
end end
def file
ActiveStorage::Attachment.find(file_id)
end
private private
class ReleaseRankOrder class ReleaseRankOrder

View File

@@ -0,0 +1,9 @@
class AccountLockPolicy < ApplicationPolicy
def create?
user.admin?
end
def destroy?
user.admin?
end
end

View File

@@ -6,7 +6,7 @@
<%= form.email_field :email, class: "form-group" %> <%= form.email_field :email, class: "form-group" %>
<%= form.password_field :password %> <%= form.password_field :password %>
<%= form.text_field :account_name, label: 'Account Name' %> <%= form.text_field :account_name, label: 'Account Name' %>
<%= form.select :interested_product_name, options_for_select(["I'm interested in all products", "DirectME", "ReleaseME", "CastME", "EditME", "DeliverME", "ExpenseME"]), { label: "What product are you most interested in?" }, { class: "form-control custom-select" } %> <%= form.select :interested_product_name, options_for_select(["I'm interested in all products", "ME Suite PRO", "DirectME", "ReleaseME", "CastME", "EditME", "DeliverME", "ExpenseME"]), { label: "What product are you most interested in?" }, { class: "form-control custom-select" } %>
<div class="pt-3"> <div class="pt-3">
<%= form.submit "Start Free Trial", class: "btn btn-block btn-danger font-weight-bold" %> <%= form.submit "Start Free Trial", class: "btn btn-block btn-danger font-weight-bold" %>
</div> </div>

View File

@@ -4,6 +4,9 @@
<h3>Welcome To <%= suite_wordmark("d-inline-block") %></h3> <h3>Welcome To <%= suite_wordmark("d-inline-block") %></h3>
<div class="mt-4"> <div class="mt-4">
<p>Sign up for a <strong>14 Day Free Trial</strong> which includes full access to the following products. No credit card required!</p> <p>Sign up for a <strong>14 Day Free Trial</strong> which includes full access to the following products. No credit card required!</p>
<div class="d-flex justify-content-between pb-2">
<div><%= image_tag "ME_PRO_black.png", width: "96.66%" %></div>
</div>
<div class="d-flex justify-content-between pb-2"> <div class="d-flex justify-content-between pb-2">
<div><%= image_tag "logo_directme.png", width: "90%" %></div> <div><%= image_tag "logo_directme.png", width: "90%" %></div>
<div><%= image_tag "logo_releaseme.png", width: "90%" %></div> <div><%= image_tag "logo_releaseme.png", width: "90%" %></div>

View File

@@ -30,6 +30,11 @@
<%= link_to fa_icon("arrow-right", text: "Overview"), admin_account_path(account), class: "dropdown-item" %> <%= link_to fa_icon("arrow-right", text: "Overview"), admin_account_path(account), class: "dropdown-item" %>
<%= link_to fa_icon("pencil", text: "Edit"), edit_admin_account_path(account), class: "dropdown-item" %> <%= link_to fa_icon("pencil", text: "Edit"), edit_admin_account_path(account), class: "dropdown-item" %>
<%= link_to fa_icon("arrow-right", text: "Account Managers"), account_auths_path({ account_id: account.id}), class: "dropdown-item" %> <%= link_to fa_icon("arrow-right", text: "Account Managers"), account_auths_path({ account_id: account.id}), class: "dropdown-item" %>
<% if account.locked? %>
<%= link_to fa_icon("unlock", text: "Unlock Account"), [:admin, account, :lock], method: :delete, class: "dropdown-item" %>
<% else %>
<%= link_to fa_icon("lock", text: "Lock Account"), [:admin, account, :lock], method: :post, class: "dropdown-item" %>
<% end %>
</div> </div>
</div> </div>
</td> </td>

View File

@@ -1,5 +1,22 @@
<% if flash.alert.present? %> <!-- Wrapping element flash message-->
<div class="alert alert-danger text-center text-md-left"><%= flash.alert.html_safe %></div> <div class="position-relative" style="z-index: 9999;">
<% elsif flash.notice.present? %> <!-- Position toasts -->
<div class="alert alert-primary text-center text-md-left"><%= flash.notice.html_safe %></div> <div class="position-absolute" style="top: 0.5rem; right: 0.5rem;">
<% end %> <% if flash.alert.present? %>
<div class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
<div class="toast-body toast-border-left-danger">
<button type="button" class="close text-white ml-2" data-dismiss="toast">&times;</button>
<p><%= flash.alert.html_safe %></p>
</div>
</div>
<% elsif flash.notice.present? %>
<div class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
<div class="toast-body toast-border-left-primary">
<button type="button" class="close text-white ml-2" data-dismiss="toast">&times;</button>
<p><%= flash.notice.html_safe %></p>
</div>
</div>
<% end %>
</div>
</div>

View File

@@ -1 +0,0 @@
<%= render("broadcast_recordings/refresh_recordings_list") %>

View File

@@ -1,29 +1,31 @@
<% if recordings.present? %> <ul class="list-unstyled">
<div class="list-group"> <% recordings.each do |recording| %>
<% recordings.each do |recording| %> <li class="media p-3">
<div class="list-group-item list-group-item-action"> <% if policy(BroadcastRecording).update? %>
<div class="d-flex align-items-start"> <%= link_to fa_icon("#{recording.starred ? 'star' : 'star-o'} fw"), broadcast_broadcast_recording_broadcast_recording_starrings_path(broadcast.token, recording), method: :post, class: "text-warning mr-3", remote: true %>
<% if policy(BroadcastRecording).update? %> <% end %>
<%= link_to fa_icon("#{recording.starred ? 'star' : 'star-o'} fw"), [broadcast.project, broadcast, recording, :broadcast_recording_starrings], method: :post, class: "text-warning mr-3", remote: true %>
<% end %> <div class="play-thumbnail">
<%= image_tag(recording.thumbnail_url, class: 'img-thumbnail img-fluid max-w-75', data: { behavior: "play_recording", playback_url: recording.playback_url, id: dom_id(recording) }) %> <%= image_tag(recording.thumbnail_url, class: 'mr-2', size: "64x64") %>
<div class="ml-auto"> <%= content_tag :div, class: "play-btn", data: { behavior: "play_recording", playback_url: recording.playback_url, id: dom_id(recording) } do %>
<% if policy(BroadcastRecording).edit? %> <%= render "broadcasts/play_button_svg" %>
<%= link_to fa_icon('edit'), [:edit, broadcast.project, broadcast, recording], remote: true %> <% end %>
<% end %>
<%= link_to(fa_icon('download'), recording.download_url, target: "_blank") %>
</div>
</div>
<div class="d-flex flex-column align-items-start justify-content-start p-4">
<h5><%= recording.name %></h5>
<p><%= recording.description %></p>
</div>
</div> </div>
<% end %>
</div> <div class="media-body">
<div id="recordings_pagination" class="row mt-5 justify-content-center"> <h5 class="mt-0 mb-1"><%= recording.name %></h5>
<%= will_paginate(recordings, params: {controller: "broadcasts", action: "show", project_id: broadcast.project_id, id: broadcast.id, page: params[:page], active_tab: 'recordings'}) %> <small class="text-muted"><%= recording.description %></small>
</div> </div>
<% else %>
<p class="mt-4">Recording of the live stream will appear here.</p> <% if policy(BroadcastRecording).edit? %>
<% end %> <%= link_to fa_icon('edit'), edit_broadcast_broadcast_recording_path(broadcast.token, recording), remote: true %>
<% end %>
<%= link_to(fa_icon('download'), recording.download_url, target: "_blank") %>
</li>
<% end %>
</ul>
<div id="recordings_pagination" class="row mt-5 justify-content-center">
<%= will_paginate(recordings, params: {controller: "broadcasts", action: "show", project_id: broadcast.project_id, id: broadcast.id, page: params[:page], active_tab: 'recordings'}) %>
</div>

View File

@@ -1,13 +1,9 @@
<% if broadcast.streamer_connected? || (broadcast.streamer_recording? && !broadcast.active?) %> <% if broadcast.streamer_connected? || (broadcast.streamer_recording? && !broadcast.active?) %>
<p class="mb-1">Live stream has connected successfully and will be available soon.</p> <p class="mb-1">Live stream has connected successfully and will be available soon.</p>
<div class="badge badge-pill badge-success mb-2 text-uppercase">Connected</div>
<% elsif broadcast.streamer_recording? && broadcast.active? %> <% elsif broadcast.streamer_recording? && broadcast.active? %>
<p class="mb-1">Live stream has begun, click play to watch it.</p> <p class="mb-1">Live stream has begun, click play to watch it.</p>
<div class="badge badge-pill badge-danger mb-2 text-uppercase">Live</div>
<% elsif broadcast.streamer_disconnected? %> <% elsif broadcast.streamer_disconnected? %>
<p class="mb-1">Live stream got disconnected.</p> <p class="mb-1">Live stream got disconnected.</p>
<div class="badge badge-pill badge-warning mb-2 text-uppercase">Disconnected</div>
<% elsif (broadcast.idle? && broadcast.streamer_idle?) || (broadcast.created? && broadcast.streamer_idle?) %> <% elsif (broadcast.idle? && broadcast.streamer_idle?) || (broadcast.created? && broadcast.streamer_idle?) %>
<p class="mb-1">Live stream is waiting to begin.</p> <p class="mb-1">Live stream is waiting to begin.</p>
<div class="badge badge-pill badge-primary mb-2 text-uppercase">Idle</div>
<% end %> <% end %>

View File

@@ -1,4 +1,4 @@
<div class="text-center pb-2" id="broadcast_file_form_<%= broadcast.token %>"> <div class="text-center p-3" id="broadcast_file_form_<%= broadcast.token %>">
<% if controller.class.module_parent.to_s == "Public" %> <% if controller.class.module_parent.to_s == "Public" %>
<%= render partial: "public/broadcasts/file_form", locals: { model: [broadcast], token: broadcast.token } %> <%= render partial: "public/broadcasts/file_form", locals: { model: [broadcast], token: broadcast.token } %>
<% else %> <% else %>

View File

@@ -1,12 +1,35 @@
<div class="list-group"> <% # TODO: Refactor this %>
<div class="list-group-item list-group-item-action flex-column align-items-start"> <% if params[:director_mode] %>
<div class="d-flex w-100 justify-content-between mb-1"> <% if controller.class.module_parent.to_s == "Public" %>
<h5 class="mb-1"><%= broadcast.name %></h5> <% live_take_url = url_for(params.permit!.merge(director_mode: true, token: broadcast.token)) %>
<small>Created - <%= time_ago_in_words(broadcast.created_at) + " ago" %></small> <% else %>
</div> <% live_take_url = url_for(params.permit!.merge(director_mode: true, id: broadcast.id)) %>
<div id="broadcast_updates"> <% end %>
<hr/>
<% else %>
<% if controller.class.module_parent.to_s == "Public" %>
<% live_take_url = url_for(params.permit!.merge(token: broadcast.token).except(:director_mode)) %>
<% else %>
<% live_take_url = url_for(params.permit!.merge(id: broadcast.id).except(:director_mode)) %>
<% end %>
<% end %>
<div id="live-take" class="media p-3 playing-highlight">
<div id="recording_status">
<%= render 'broadcasts/recording_status', broadcast: broadcast %>
</div>
<div class="play-thumbnail">
<%= image_tag "live_icon.png", class: "mr-2", width: 64, alt: "Live stream thumbnail" %>
<%= link_to live_take_url, class: "play-btn", data: { behavior: "play_stream" } do %>
<%= render "broadcasts/play_button_svg" %>
<% end %>
</div>
<div class="media-body">
<h5 class="mt-0"><%= broadcast.name %></h5>
<small id="broadcast_updates" class="text-muted">
<%= render partial: 'broadcasts/broadcast_status', locals: { broadcast: broadcast } %> <%= render partial: 'broadcasts/broadcast_status', locals: { broadcast: broadcast } %>
</div> </small>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26">
<polygon class="play-btn-svg" points="9.33 6.69 9.33 19.39 19.3 13.04 9.33 6.69"/>
</svg>

After

Width:  |  Height:  |  Size: 153 B

View File

@@ -0,0 +1 @@
<%= fa_icon "circle fw", class: class_string('mr-2', 'text-danger' => broadcast.streamer_recording? && broadcast.active?) %>

View File

@@ -1,5 +1,5 @@
<% if broadcast.director_mode_video_embed.present? && params[:director_mode].present? %> <% if broadcast.director_mode_video_embed.present? && params[:non_director_mode].nil? %>
<div class="embed-responsive-item" data-video-type="stream"> <div id="director_broadcast_video" class="embed-responsive-item" data-video-type="stream">
<%= raw broadcast.director_mode_video_embed %> <%= raw broadcast.director_mode_video_embed %>
</div> </div>
<% elsif broadcast.streamer_recording? && broadcast.active? %> <% elsif broadcast.streamer_recording? && broadcast.active? %>

View File

@@ -13,12 +13,18 @@
<% end %> <% end %>
<% end %> <% end %>
<style>
body {
overflow-x: hidden;
}
</style>
<% content_for :header do %> <% content_for :header do %>
<header></header> <header></header>
<% end %> <% end %>
<div class="row no-gutters m-n3"> <div class="row no-gutters m-n3">
<div class="col-lg-8 col-md-12 bg-black"> <div class="col-lg-9 col-md-12 bg-black vh-100">
<div class="d-flex justify-content-start align-items-center flex-row p-3 mb-5 bg-dark"> <div class="d-flex justify-content-start align-items-center flex-row p-3 mb-5 bg-dark">
<%= product_wordmark(:direct_me, class: 'navbar-brand text-white') %> <%= product_wordmark(:direct_me, class: 'navbar-brand text-white') %>
<div class="ml-4 dropdown"> <div class="ml-4 dropdown">
@@ -35,17 +41,17 @@
<%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", data: { behavior: "play_stream"}, class: "dropdown-item active" %> <%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", data: { behavior: "play_stream"}, class: "dropdown-item active" %>
<% @multi_view_broadcasts.each do |broadcast| %> <% @multi_view_broadcasts.each do |broadcast| %>
<% if broadcast.id != @broadcast.id %> <% if broadcast.id != @broadcast.id %>
<% if params[:director_mode] %> <% if params[:non_director_mode] %>
<% if controller.class.module_parent.to_s == "Public" %> <% if controller.class.module_parent.to_s == "Public" %>
<%= link_to broadcast.name.titleize, url_for(params.permit!.merge(director_mode: true, token: broadcast.token)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %> <%= link_to broadcast.name.titleize, url_for(params.permit!.merge(non_director_mode: true, token: broadcast.token)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% else %> <% else %>
<%= link_to broadcast.name.titleize, url_for(params.permit!.merge(director_mode: true, id: broadcast.id)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %> <%= link_to broadcast.name.titleize, url_for(params.permit!.merge(non_director_mode: true, id: broadcast.id)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% end %> <% end %>
<% else %> <% else %>
<% if controller.class.module_parent.to_s == "Public" %> <% if controller.class.module_parent.to_s == "Public" %>
<%= link_to broadcast.name.titleize, url_for(params.permit!.merge(token: broadcast.token).except(:director_mode)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %> <%= link_to broadcast.name.titleize, url_for(params.permit!.merge(token: broadcast.token).except(:non_director_mode)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% else %> <% else %>
<%= link_to broadcast.name.titleize, url_for(params.permit!.merge(id: broadcast.id).except(:director_mode)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %> <%= link_to broadcast.name.titleize, url_for(params.permit!.merge(id: broadcast.id).except(:non_director_mode)), data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
@@ -53,18 +59,18 @@
</div> </div>
</div> </div>
<% if @broadcast.director_mode_video_embed.present? %> <% if @broadcast.director_mode_video_embed.present? %>
<% if params[:director_mode] %> <% if params[:non_director_mode] %>
<div class="custom-control custom-switch ml-auto"> <div class="custom-control custom-switch ml-auto">
<input type="checkbox" name="director_mode" value="true" class="custom-control-input" id="director_mode_switch" checked="checked" /> <input type="checkbox" name="non_director_mode" value="true" class="custom-control-input" id="director_mode_switch" />
<label class="custom-control-label text-white override-custom-control-label" for="director_mode_switch">Director Mode</label> <label class="custom-control-label text-white override-custom-control-label" for="director_mode_switch">Director Mode</label>
</div> </div>
<%= link_to "Disable Director Mode", url_for(params.permit!.except(:director_mode)), class: "d-none", id: "director_mode_link" %> <%= link_to "Enable Director Mode", url_for(params.permit!.except(:non_director_mode)), class: "d-none", id: "director_mode_link" %>
<% else %> <% else %>
<div class="custom-control custom-switch ml-auto"> <div class="custom-control custom-switch ml-auto">
<input type="checkbox" name="director_mode" value="true" class="custom-control-input" id="director_mode_switch" /> <input type="checkbox" name="non_director_mode" value="true" class="custom-control-input" id="director_mode_switch" checked="checked" />
<label class="custom-control-label text-white override-custom-control-label" for="director_mode_switch">Director Mode</label> <label class="custom-control-label text-white override-custom-control-label" for="director_mode_switch">Director Mode</label>
</div> </div>
<%= link_to "Enable Director Mode", url_for(params.permit!.merge(director_mode: true)), class: "d-none", id: "director_mode_link" %> <%= link_to "Disable Director Mode", url_for(params.permit!.merge(non_director_mode: true)), class: "d-none", id: "director_mode_link" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
@@ -85,32 +91,34 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-12 bg-white p-3 min-vh-100 overflow-auto"> <div class="col-lg-3 col-md-12 bg-white vh-100 overflow-auto">
<% unless controller.class.module_parent.to_s == "Public" %> <div class="px-3 pt-3">
<% if @multi_view_broadcasts.present? %> <% unless controller.class.module_parent.to_s == "Public" %>
<% tokens = @multi_view_broadcasts.map(&:token) %> <% if @multi_view_broadcasts.present? %>
<div class="btn-group"> <% tokens = @multi_view_broadcasts.map(&:token) %>
<button type="button" class="btn btn-primary" id="broadcast_share_url" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token, multi_view_tokens: tokens) %>">Share URL</button> <div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-primary" id="broadcast_share_url" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token, multi_view_tokens: tokens) %>">Share URL</button>
<span class="sr-only">Toggle Dropdown</span> <button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
</button> <span class="sr-only">Toggle Dropdown</span>
<div class="dropdown-menu"> </button>
<%= link_to t('.actions.reset_url'), [@project, @broadcast], method: :patch, class: "dropdown-item" %> <div class="dropdown-menu">
<%= link_to t('.actions.reset_url'), [@project, @broadcast], method: :patch, class: "dropdown-item" %>
</div>
</div> </div>
</div> <% else %>
<% else %> <div class="btn-group">
<div class="btn-group"> <button type="button" class="btn btn-primary" id="broadcast_share_url" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token) %>">Share URL</button>
<button type="button" class="btn btn-primary" id="broadcast_share_url" data-behavior="clipboard" href="<%= broadcast_url(@broadcast.token) %>">Share URL</button> <button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="sr-only">Toggle Dropdown</span>
<span class="sr-only">Toggle Dropdown</span> </button>
</button> <div class="dropdown-menu">
<div class="dropdown-menu"> <%= link_to t('.actions.reset_url'), [@project, @broadcast], method: :patch, class: "dropdown-item" %>
<%= link_to t('.actions.reset_url'), [@project, @broadcast], method: :patch, class: "dropdown-item" %> </div>
</div> </div>
</div> <% end %>
<% end %> <% end %>
<% end %> <%= link_to 'Video Conference', @conference_url, class: 'btn btn-primary', target: '_blank' %>
<%= link_to 'Video Conference', @conference_url, class: 'btn btn-primary', target: '_blank' %> </div>
<hr/> <hr/>
<ul class="nav nav-tabs override-nav-tabs mb-3"> <ul class="nav nav-tabs override-nav-tabs mb-3">
<li class="nav-item"> <li class="nav-item">
@@ -125,18 +133,18 @@
<div id="live_take"> <div id="live_take">
<%= render partial: 'broadcasts/live_take', locals: { broadcast: @broadcast } %> <%= render partial: 'broadcasts/live_take', locals: { broadcast: @broadcast } %>
</div> </div>
<% if params[:director_mode] %> <% if params[:non_director_mode] %>
<% if controller.class.module_parent.to_s == "Public" %> <% if controller.class.module_parent.to_s == "Public" %>
<%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(director_mode: true, token: @broadcast.token)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %> <%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(non_director_mode: true, token: @broadcast.token)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %>
<% else %> <% else %>
<%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(director_mode: true, id: @broadcast.id)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %> <%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(non_director_mode: true, id: @broadcast.id)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %>
<% end %> <% end %>
<hr/> <hr/>
<% else %> <% else %>
<% if controller.class.module_parent.to_s == "Public" %> <% if controller.class.module_parent.to_s == "Public" %>
<%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(token: @broadcast.token).except(:director_mode)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %> <%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(token: @broadcast.token).except(:non_director_mode)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %>
<% else %> <% else %>
<%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(id: @broadcast.id).except(:director_mode)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %> <%= link_to "Play #{@broadcast.name.titleize}", url_for(params.permit!.merge(id: @broadcast.id).except(:non_director_mode)), data: { behavior: "play_stream"}, class: "mt-2 btn btn-primary" %>
<% end %> <% end %>
<hr/> <hr/>
<% end %> <% end %>
@@ -153,12 +161,12 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<div class="tab-content pt-4"> <div class="tab-content">
<% @multi_view_broadcasts.each_with_index do |mvb, index| %> <% @multi_view_broadcasts.each_with_index do |mvb, index| %>
<div class="<%= class_string("tab-pane fade show", "active" => (params[:active_files_tab] == mvb.token || (params[:active_files_tab].nil? && index == 0))) %>" id="files_broadcast_<%= mvb.token %>"> <div class="<%= class_string("tab-pane fade show", "active" => (params[:active_files_tab] == mvb.token || (params[:active_files_tab].nil? && index == 0))) %>" id="files_broadcast_<%= mvb.token %>">
<%= render partial: 'broadcasts/files_section', locals: { broadcast: mvb, files: mvb.files } %> <%= render partial: 'broadcasts/files_section', locals: { broadcast: mvb, files: mvb.files } %>
</div> </div>
<% end %> <% end %>
</div> </div>
<% else %> <% else %>
<%= render partial: 'broadcasts/files_section', locals: { broadcast: @broadcast, files: @files } %> <%= render partial: 'broadcasts/files_section', locals: { broadcast: @broadcast, files: @files } %>

View File

@@ -5,7 +5,7 @@
</td> </td>
<td> <td>
<% if contract_template.fee? %> <% if contract_template.fee? %>
<%= number_to_currency(contract_template.fee) %> <%= contract_template.fee %>
<% else %> <% else %>
<%= t(".no_fee") %> <%= t(".no_fee") %>
<% end %> <% end %>

View File

@@ -9,7 +9,7 @@
<%= form.radio_button :accessibility, :private_template, label: "Private" %> <%= form.radio_button :accessibility, :private_template, label: "Private" %>
</div> </div>
<div class="form-row" id="fee_field"> <div class="form-row" id="fee_field">
<%= form.number_field :fee, min:"0", max:"99999999", step: "0.01", prepend: "$", wrapper_class: "col-sm-6" %> <%= form.text_field :fee, wrapper_class: "col-sm-6" %>
</div> </div>
<% end %> <% end %>

View File

@@ -0,0 +1,37 @@
<% has_logo = local_assigns[:logo] %>
<% has_user_photo = releasable.model_name == "AppearanceRelease" && releasable.person_photo.attached? %>
<% if has_logo || has_user_photo %>
<table class="heading-table">
<tr>
<td>
<% if has_logo %>
<div class="logo">
<%= render "blank_contracts/logo", logo: logo %>
</div>
<% end %>
</td>
<td class="embed-person-photo">
<% if has_user_photo %>
<%= image_tag releasable.photos.first.variant(auto_orient: true, resize: "200x200"), id: "top-person-photo" %>
<% end %>
</td>
</tr>
</table>
<hr>
<% end %>
<% if preview %>
<h1>PREVIEW ONLY</h1>
<% end %>
<% if contract_template.body.present? %>
<%= contract_template.body %>
<br/>
<% end %>
<% if releasable.minor? && contract_template.guardian_clause.present? %>
<p class="text-left"><strong>Guardian Clause</strong></p>
<%= contract_template.guardian_clause %>
<% end %>

View File

@@ -36,7 +36,7 @@
<%= description_list_pair "Filming Hours:", releasable&.filming_hours %> <%= description_list_pair "Filming Hours:", releasable&.filming_hours %>
<% end %> <% end %>
<% if contract_template.fee? %> <% if contract_template.fee? %>
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %> <%= description_list_pair "Fee:", contract_template.fee %>
<% end %> <% end %>
<% if releasable.model_name == "MaterialRelease" %> <% if releasable.model_name == "MaterialRelease" %>
<%= description_list_pair "Description:", releasable.description %> <%= description_list_pair "Description:", releasable.description %>

View File

@@ -1,22 +1,13 @@
<% if local_assigns[:logo] %> <% logo = local_assigns[:logo] ? local_assigns[:logo] : nil %>
<div class="logo">
<%= render "contracts/logo", logo: logo %> <% if logo || (releasable.model_name == 'AppearanceRelease' && releasable.person_photo.attached?) ||
contract_template.body.present? || (releasable.minor? && contract_template.guardian_clause.present?) %>
<div class="page">
<%= render "contracts/logo_page", logo: logo, preview: preview, releasable: releasable, contract_template: contract_template %>
</div> </div>
<hr>
<% end %>
<% if preview %>
<h1>PREVIEW ONLY</h1>
<% end %>
<% if contract_template.body.present? %>
<%= contract_template.body %>
<br/>
<% end %>
<% if releasable.minor? && contract_template.guardian_clause.present? %>
<p class="text-left"><strong>Guardian Clause</strong></p>
<%= contract_template.guardian_clause %>
<% end %> <% end %>
<% if releasable.respond_to?(:question_1_answer) %> <% if contract_template.present? && contract_template.has_questionnaire? %>
<div class="page"> <div class="page">
<%= render "contracts/questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %> <%= render "contracts/questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %>
</div> </div>

View File

@@ -17,12 +17,12 @@
</head> </head>
<body> <body>
<div class="flash-message">
<%= render "flash" %>
</div>
<%= content_for?(:header) ? yield(:header) : render("header") %> <%= content_for?(:header) ? yield(:header) : render("header") %>
<%= render "masquerade" if masquerading? %> <%= render "masquerade" if masquerading? %>
<main class="container-fluid py-3"> <main class="container-fluid py-3">
<div class="flash-message"></div>
<%= render "flash" %>
</div>
<%= content_for?(:content) ? yield(:content) : yield %> <%= content_for?(:content) ? yield(:content) : yield %>
</main> </main>
</body> </body>

View File

@@ -0,0 +1,13 @@
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
<%= javascript_tag nonce: true do %>
callFrame = window.DailyIframe.createFrame({
showLeaveButton: true,
iframeStyle: {
position: 'fixed',
width: '100%',
height: '90%'
}
});
callFrame.join({ url: '<%= @live_meeting_url %>' });
<% end %>

View File

@@ -0,0 +1 @@
<p><%= t '.account_locked_message' %></p>

View File

@@ -42,7 +42,7 @@
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, material_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %> <%= link_to fa_icon("tags fw", text: "Tags"), [:new, material_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
<% end %> <% end %>
<% if policy(material_release).edit_files? %> <% if policy(material_release).edit_files? %>
<%= link_to fa_icon("file-o fw", text: "Add Media"), [:edit, material_release, :files], class: "dropdown-item" %> <%= link_to fa_icon("file-o fw", text: "Media"), [:edit, material_release, :files], class: "dropdown-item" %>
<% end %> <% end %>
<% if policy(Contract).show? && (material_release.contract.attached? || material_release.contract_template.present?) %> <% if policy(Contract).show? && (material_release.contract.attached? || material_release.contract_template.present?) %>
<%= link_to fa_icon("download fw", text: "Download"), [material_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %> <%= link_to fa_icon("download fw", text: "Download"), [material_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>

View File

@@ -6,7 +6,7 @@
<p><%= @contract_template.body %></p> <p><%= @contract_template.body %></p>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -7,7 +7,7 @@
<p><%= @contract_template.body %></p> <p><%= @contract_template.body %></p>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -1 +1 @@
$("#broadcast_recordings").html("<%= j render(partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast }) %>"); $("#broadcast_recordings").html("<%= j render(partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast }) %>");

View File

@@ -7,7 +7,7 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<%= bootstrap_form_with model: [broadcast.project, broadcast, recording], layout: :horizontal, label_col: "col-3", control_col: "col-9" do |form| %> <%= bootstrap_form_with model: [broadcast, recording], url: broadcast_broadcast_recording_path(broadcast.token, recording), layout: :horizontal, label_col: "col-3", control_col: "col-9" do |form| %>
<div class="modal-body"> <div class="modal-body">
<div id="broadcast_recording_fields"> <div id="broadcast_recording_fields">
<%= form.text_field :name %> <%= form.text_field :name %>

View File

@@ -0,0 +1,11 @@
$('[data-id="<%= dom_id(@recording) %>"]').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 }) %>");
// Close and remove the modal
$("#edit_broadcast_recording_modal").on("hidden.bs.modal", function (e) {
$("#edit_broadcast_recording_modal").remove();
});
$("#edit_broadcast_recording_modal").modal("hide");

View File

@@ -2,5 +2,5 @@
$("#edit_broadcast_recording_modal").remove(); $("#edit_broadcast_recording_modal").remove();
<% # Create and show the modal %> <% # Create and show the modal %>
$("body").append("<%= j render(partial: 'edit_broadcast_recording_modal', locals: { project: @project, broadcast: @broadcast, recording: @recording }) %>"); $("body").append("<%= j render(partial: 'edit_broadcast_recording_modal', locals: { broadcast: @broadcast, recording: @recording }) %>");
$("#edit_broadcast_recording_modal").modal("toggle"); $("#edit_broadcast_recording_modal").modal("toggle");

View File

@@ -0,0 +1 @@
<%= render("public/broadcast_recordings/refresh_recordings_list") %>

View File

@@ -0,0 +1,17 @@
<% if @live_meeting_url.present? %>
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
<%= javascript_tag nonce: true do %>
callFrame = window.DailyIframe.createFrame({
showLeaveButton: true,
iframeStyle: {
position: 'fixed',
width: '100%',
height: '90%'
}
});
callFrame.join({ url: '<%= @live_meeting_url %>' });
<% end %>
<% else %>
<p><%= t '.meeting_not_ready_message' %></p>
<% end %>

View File

@@ -6,7 +6,7 @@
<p><%= @contract_template.body %></p> <p><%= @contract_template.body %></p>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -6,7 +6,7 @@
<p><%= @contract_template.body %></p> <p><%= @contract_template.body %></p>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -7,7 +7,7 @@
<%= @contract_template.body %> <%= @contract_template.body %>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
@@ -24,7 +24,7 @@
<% end %> <% end %>
<hr> <hr>
<% end %> <% end %>
<% if (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).map {|n| @contract_template.public_send("question_#{n}_text").presence }.compact.any? %> <% if (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).map {|n| @contract_template.public_send("question_#{n}_text").presence }.compact.any? %>
<%= card_field_set_tag t(".questionnaire.heading") do %> <%= card_field_set_tag t(".questionnaire.heading") do %>
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %> <% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>

View File

@@ -7,7 +7,7 @@
<p><%= @contract_template.body %></p> <p><%= @contract_template.body %></p>
<% if @contract_template.fee? %> <% if @contract_template.fee? %>
<p> <p>
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span> Fee <span class="font-weight-bold text-success"><%= @contract_template.fee %></span>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
@@ -139,4 +139,4 @@
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>

View File

@@ -14,4 +14,5 @@
data-file-input-id="releasable_files" data-file-input-id="releasable_files"
data-existing-files="<%= mock_photos_json(releasable.files) %>" data-existing-files="<%= mock_photos_json(releasable.files) %>"
data-placeholder="<%= dropzone_placeholder_message_for(releasable) %>" data-placeholder="<%= dropzone_placeholder_message_for(releasable) %>"
data-submit-button="#submit_folder"></div> data-submit-button="#submit_folder"
data-max-file-size="<%= dropzone_file_size_limit_for(releasable) %>"></div>

View File

@@ -1,7 +1,7 @@
<% if acquired_media_file_infos.any? %> <% if acquired_media_files.any? %>
<% acquired_media_file_infos.each do |file_info| %> <% acquired_media_files.each do |file| %>
<li class="acquired-media-releasable list-inline-item" data-ujs-target="<%= dom_id(file_info.releasable, dom_id(file_info)) %>" data-hidden="false"> <li class="acquired-media-releasable list-inline-item" data-ujs-target="<%= dom_id(file.record, dom_id(file)) %>" data-hidden="false">
<%= render "video_analyses/file_info_releasable", releasable: file_info.releasable, video: video, file_info: file_info %> <%= render "video_analyses/file_releasable", releasable: file.record, video: video, file: file %>
</li> </li>
<% end %> <% end %>
<% else %> <% else %>

View File

@@ -1,7 +1,7 @@
<% if acquired_media_release.file_infos.any? %> <% if acquired_media_release.files.any? %>
<% acquired_media_release.file_infos.each do |file_info| %> <% acquired_media_release.files.each do |file| %>
<li class="acquired-media-releasable list-inline-item" data-ujs-target="<%= dom_id(acquired_media_release, "file_info_#{file_info.id}") %>" data-confirmed="<%= video.has_confirmed_release?(acquired_media_release) && video.video_release_confirmations.any? { |video_release_confirmation| video_release_confirmation.file_info_id == file_info.id } %>" data-hidden="false"> <li class="acquired-media-releasable list-inline-item" data-ujs-target="<%= dom_id(acquired_media_release, "attachment_#{file.id}") %>" data-confirmed="<%= video.has_confirmed_release?(acquired_media_release) && video.video_release_confirmations.any? { |video_release_confirmation| video_release_confirmation.file_id == file.id } %>" data-hidden="false">
<%= render "video_analyses/file_info_releasable", releasable: acquired_media_release, video: video, file_info: file_info %> <%= render "video_analyses/file_releasable", releasable: acquired_media_release, video: video, file: file %>
</li> </li>
<% end %> <% end %>
<% else %> <% else %>

View File

@@ -1,8 +0,0 @@
<%= button_to_video_release_confirmation video, releasable, additional_video_release_params: { file_info_id: file_info.id } do %>
<figure class="figure mb-0">
<div class="figure-img border text-muted d-flex justify-content-center align-items-center text-wrap text-break" style="width:200px;height:200px;">
<%= file_info.filename %>
</div>
<figcaption class="figure-caption text-center"><%= truncate releasable.name, length: 25 %></figcaption>
</figure>
<% end %>

View File

@@ -0,0 +1,12 @@
<%= button_to_video_release_confirmation video, releasable, additional_video_release_params: { file_id: file.id } do %>
<figure class="figure mb-0">
<% if file.content_type.include? "image" %>
<%= image_tag large_variant(file), class: "figure-img border", style: "width:200px;height:200px;" %>
<% else %>
<div class="figure-img border text-muted d-flex justify-content-center align-items-center text-wrap text-break" style="width:200px;height:200px;">
<%= file.filename %>
</div>
<% end %>
<figcaption class="figure-caption text-center"><%= truncate releasable.name, length: 25 %></figcaption>
</figure>
<% end %>

View File

@@ -1,3 +1,18 @@
<li class="releasable list-inline-item hidden-when-confirmed" id="<%= dom_id(material_release) %>" data-confirmed="<%= video.confirmed_material_releases.include?(material_release) %>" data-hidden="<%= video.confirmed_material_releases.include?(material_release) %>"> <% if material_release.files.any? %>
<%= render "video_analyses/releasable", releasable: material_release, video: video %> <% material_release.files.each do |file| %>
</li> <li class="releasable list-inline-item hidden-when-confirmed" id="<%= dom_id(material_release) %>" data-ujs-target="<%= dom_id(material_release, "attachment_#{file.id}") %>" data-confirmed="<%= video.confirmed_material_releases.include?(material_release) %>" data-hidden="<%= video.confirmed_material_releases.include?(material_release) %>">
<%= render "video_analyses/file_releasable", releasable: material_release, video: video, file: file %>
</li>
<% end %>
<% else %>
<li class="releasable list-inline-item" data-confirmed="false" data-hidden="false">
<figure class="figure mb-0">
<div class="figure-img border text-muted d-flex justify-content-center align-items-center" style="width:200px;height:200px;">
<small>No File Uploaded</small>
</div>
<figcaption class="figure-caption text-center"><%= truncate material_release.name, length: 25 %></figcaption>
</figure>
</li>
<% end %>

View File

@@ -22,8 +22,8 @@
<td><a data-behavior="seekable-timecode"><%= confirmation.appears_at %></a></td> <td><a data-behavior="seekable-timecode"><%= confirmation.appears_at %></a></td>
<td><%= confirmation.releasable.name %></td> <td><%= confirmation.releasable.name %></td>
<td> <td>
<% if confirmation.file_info.present? %> <% if confirmation.file_id.present? %>
<%= confirmation.file_info.filename %></div> <%= confirmation.file.filename %></div>
<% elsif confirmation.releasable.respond_to?(:photo) && confirmation.releasable.photo.attached? %> <% elsif confirmation.releasable.respond_to?(:photo) && confirmation.releasable.photo.attached? %>
<%= image_tag thumbnail_variant(confirmation.releasable.photo), class: "img-fluid figure-img" %> <%= image_tag thumbnail_variant(confirmation.releasable.photo), class: "img-fluid figure-img" %>
<% else %> <% else %>

View File

@@ -2,7 +2,7 @@
$("#acquired_media_releases [data-toggle=tooltip]").tooltip("dispose"); $("#acquired_media_releases [data-toggle=tooltip]").tooltip("dispose");
// Update the release list // Update the release list
$("#acquired_media_releases").html("<%= j render("video_analyses/acquired_media_file_infos", acquired_media_file_infos: @acquired_media_file_infos, video: @video) %>"); $("#acquired_media_releases").html("<%= j render("video_analyses/acquired_media_files", acquired_media_files: @acquired_media_files, video: @video) %>");
// # Reset the search form // # Reset the search form
$("#acquired_media_releases_section form input[name='query']").val("<%= params[:query] %>"); $("#acquired_media_releases_section form input[name='query']").val("<%= params[:query] %>");

View File

@@ -14,7 +14,7 @@
<div id="video_release_confirmation_fields"> <div id="video_release_confirmation_fields">
<%= form.hidden_field :time_elapsed, value: video_release_confirmation.time_elapsed %> <%= form.hidden_field :time_elapsed, value: video_release_confirmation.time_elapsed %>
<%= form.hidden_field :file_info_id, value: video_release_confirmation.file_info_id %> <%= form.hidden_field :file_id, value: video_release_confirmation.file_id %>
<%= form.static_control nil, name: nil, label: "Video Timecode", value: video_release_confirmation.appears_at %> <%= form.static_control nil, name: nil, label: "Video Timecode", value: video_release_confirmation.appears_at %>
<%= form.text_field :channel %> <%= form.text_field :channel %>
<%= form.text_field :timecode_in %> <%= form.text_field :timecode_in %>

View File

@@ -1,8 +1,8 @@
var hideConfirmed = $("input[name=hide_confirmed]:checked").length > 0; var hideConfirmed = $("input[name=hide_confirmed]:checked").length > 0;
// Mark the release as confirmed // Mark the release as confirmed
if (<%= @releasable.respond_to?(:file_infos) %>) { if (<%= @releasable.respond_to?(:files) %>) {
$("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.file_info_id}") %>]").attr("data-confirmed", true).data("confirmed", true) $("[data-ujs-target=<%= dom_id(@releasable, "attachment_#{@video_release_confirmation.file_id}") %>]").attr("data-confirmed", true).data("confirmed", true)
} else { } else {
$("#<%= dom_id(@releasable) %>").attr("data-confirmed", true).data("confirmed", true) $("#<%= dom_id(@releasable) %>").attr("data-confirmed", true).data("confirmed", true)
} }

View File

@@ -1,7 +1,7 @@
// Mark the release as no longer confirmed and show // Mark the release as no longer confirmed and show
if (<%= @releasable.respond_to?(:file_infos) && @video_release_confirmation.respond_to?(:file_info_id) %>) { if (<%= @releasable.respond_to?(:files) && @video_release_confirmation.respond_to?(:file_id) %>) {
if (<%= @video_release_confirmations.none? { |video_release_confirmation| video_release_confirmation.respond_to?(:file_info_id) && video_release_confirmation.file_info_id == @video_release_confirmation.file_info_id } %>) { if (<%= @video_release_confirmations.none? { |video_release_confirmation| video_release_confirmation.respond_to?(:file_id) && video_release_confirmation.file_id == @video_release_confirmation.file_id } %>) {
$("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.file_info_id}") %>]") $("[data-ujs-target=<%= dom_id(@releasable, "attachment_#{@video_release_confirmation.file_id}") %>]")
.attr("data-confirmed", false).data("confirmed", false) .attr("data-confirmed", false).data("confirmed", false)
.attr("data-hidden", false).data("hidden", false); .attr("data-hidden", false).data("hidden", false);
} }

View File

@@ -0,0 +1 @@
require 'daily'

View File

@@ -457,7 +457,7 @@ en:
help: help:
contract_template: contract_template:
amendment_clause: Leave blank if not required for this contract amendment_clause: Leave blank if not required for this contract
fee: Leave at $0.00 for no-fee fee: Please enter all necessary details about fees. Leave it blank for no-fee
guardian_clause: Leave blank if not required for this contract guardian_clause: Leave blank if not required for this contract
questionnaire_legal_text: Leave blank if not required for this contract questionnaire_legal_text: Leave blank if not required for this contract
signature_legal_text: Leave blank if not required for this contract signature_legal_text: Leave blank if not required for this contract
@@ -1390,6 +1390,9 @@ en:
heading: Photos heading: Photos
signature: signature:
heading: Signature heading: Signature
live_meetings:
show:
meeting_not_ready_message: Live meeting is not yet ready. Please contact project manager.
release_template_imports: release_template_imports:
create: create:
error: There was a problem with importing selected templates error: There was a problem with importing selected templates
@@ -1651,3 +1654,6 @@ en:
edit: Edit edit: Edit
report: Report report: Report
generating: Generating... generating: Generating...
locked_accounts:
index:
account_locked_message: This account is locked. Please contact a BIG admin.

View File

@@ -632,6 +632,9 @@ es:
show: show:
choose_project: ¿Qué proyecto de la lista de abajo asistirá? choose_project: ¿Qué proyecto de la lista de abajo asistirá?
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong> welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
live_meetings:
show:
meeting_not_ready_message: Live meeting is not yet ready. Please contact project manager. (ES)
shared: shared:
print: Print (ES) print: Print (ES)
talent_releases: talent_releases:
@@ -705,3 +708,6 @@ es:
production_elements_logs: Production Elements Logs, and more (ES) production_elements_logs: Production Elements Logs, and more (ES)
reduces_labor_cost: Reduces labor costs (ES) reduces_labor_cost: Reduces labor costs (ES)
simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets (ES) simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets (ES)
locked_accounts:
index:
account_locked_message: This account is locked. Please contact a BIG admin. (ES)

View File

@@ -30,7 +30,9 @@ Rails.application.routes.draw do
namespace :admin do namespace :admin do
mount Sidekiq::Web => '/background_queue', as: :background_queue mount Sidekiq::Web => '/background_queue', as: :background_queue
resources :accounts, only: [:index, :new, :create, :edit, :update, :show] resources :accounts, only: [:index, :new, :create, :edit, :update, :show] do
resource :account_lock, path: :lock, as: :lock, only: [:create, :destroy]
end
resources :users, only: [:index, :new, :create, :edit, :update, :destroy] do resources :users, only: [:index, :new, :create, :edit, :update, :destroy] do
resource :masquerade, only: :create resource :masquerade, only: :create
end end
@@ -48,7 +50,9 @@ Rails.application.routes.draw do
scope "(:locale)", locale: AVAILABLE_LOCALES_REGEX do scope "(:locale)", locale: AVAILABLE_LOCALES_REGEX do
resource :account_session, only: [:update] resource :account_session, only: [:update]
resource :session, only: [:destroy] resource :session, only: [:destroy]
resource :account, only: [:new, :create, :update] resource :account, only: [:new, :create, :update] do
get 'locked' => 'locked_accounts#index'
end
resources :account_auths, only: [:index, :create, :update, :destroy] resources :account_auths, only: [:index, :create, :update, :destroy]
resources :projects, shallow: true do resources :projects, shallow: true do
resources :acquired_media_releases, except: [:show], concerns: [:contractable, :notable, :file_uploadable] resources :acquired_media_releases, except: [:show], concerns: [:contractable, :notable, :file_uploadable]
@@ -100,10 +104,9 @@ Rails.application.routes.draw do
member do member do
delete :destroy_file delete :destroy_file
end end
resource :live_meeting, only: [:show]
resource :zoom_meeting, only: [:show] resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: [:destroy, :edit, :update] do resources :broadcast_recordings, only: [:destroy]
resources :broadcast_recording_starrings, only: :create
end
end end
resources :directories, except: [:index] do resources :directories, except: [:index] do
member do member do
@@ -147,7 +150,11 @@ Rails.application.routes.draw do
end end
end end
resources :broadcasts, param: :token, only: [:show, :update] do resources :broadcasts, param: :token, only: [:show, :update] do
resource :live_meeting, only: [:show]
resource :zoom_meeting, only: [:show] resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: [:edit, :update] do
resources :broadcast_recording_starrings, only: :create
end
end end
end end

View File

@@ -0,0 +1,14 @@
class SetFeeFromFeeCentsAndCurrency < ActiveRecord::DataMigration
def up
ContractTemplate.find_each do |contract_template|
if contract_template.fee_old?
fee = contract_template.fee_old.format
contract_template.update_column(:fee, fee)
end
end
end
def down
ContractTemplate.update_all(fee: nil)
end
end

View File

@@ -0,0 +1,9 @@
class AddFileIdToVideoReleaseConfirmations < ActiveRecord::Migration[6.0]
def up
add_column :video_release_confirmations, :file_id, :bigint, index: true
end
def down
remove_column :video_release_confirmations, :file_id
end
end

View File

@@ -0,0 +1,5 @@
class AddLockedToAccounts < ActiveRecord::Migration[6.0]
def change
add_column :accounts, :locked, :boolean, default: false
end
end

View File

@@ -0,0 +1,5 @@
class AddLiveMeetingUrlToProjects < ActiveRecord::Migration[6.0]
def change
add_column :projects, :live_meeting_url, :text
end
end

View File

@@ -0,0 +1,7 @@
class ConvertFeeToStringType < ActiveRecord::Migration[6.0]
def change
rename_column :contract_templates, :fee_cents, :fee_old_cents
rename_column :contract_templates, :fee_currency, :fee_old_currency
add_column :contract_templates, :fee, :string
end
end

View File

@@ -95,7 +95,8 @@ CREATE TABLE public.accounts (
slug character varying, slug character varying,
plan_uid character varying, plan_uid character varying,
created_at timestamp without time zone NOT NULL, created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL updated_at timestamp without time zone NOT NULL,
locked boolean DEFAULT false
); );
@@ -542,9 +543,9 @@ CREATE TABLE public.broadcast_recordings (
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, hidden boolean DEFAULT false,
starred boolean DEFAULT false,
name character varying, name character varying,
description text description text,
starred boolean DEFAULT false
); );
@@ -657,8 +658,8 @@ CREATE TABLE public.contract_templates (
name character varying, name character varying,
body text, body text,
guardian_clause text, guardian_clause text,
fee_cents bigint DEFAULT 0 NOT NULL, fee_old_cents bigint DEFAULT 0 NOT NULL,
fee_currency character varying DEFAULT 'USD'::character varying NOT NULL, fee_old_currency character varying DEFAULT 'USD'::character varying NOT NULL,
created_at timestamp without time zone NOT NULL, created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL,
release_type character varying, release_type character varying,
@@ -691,7 +692,8 @@ CREATE TABLE public.contract_templates (
exhibit_a_legal_text text, exhibit_a_legal_text text,
exhibit_a_question_text text, exhibit_a_question_text text,
exhibit_b_legal_text text, exhibit_b_legal_text text,
exhibit_b_question_text text exhibit_b_question_text text,
fee character varying
); );
@@ -1377,7 +1379,8 @@ CREATE TABLE public.projects (
updated_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL,
sample boolean DEFAULT false, sample boolean DEFAULT false,
headshot_collection_uid character varying, headshot_collection_uid character varying,
account_id bigint account_id bigint,
live_meeting_url text
); );
@@ -1492,6 +1495,7 @@ CREATE TABLE public.settings (
-- --
CREATE SEQUENCE public.settings_id_seq CREATE SEQUENCE public.settings_id_seq
AS integer
START WITH 1 START WITH 1
INCREMENT BY 1 INCREMENT BY 1
NO MINVALUE NO MINVALUE
@@ -1527,6 +1531,7 @@ CREATE TABLE public.taggings (
-- --
CREATE SEQUENCE public.taggings_id_seq CREATE SEQUENCE public.taggings_id_seq
AS integer
START WITH 1 START WITH 1
INCREMENT BY 1 INCREMENT BY 1
NO MINVALUE NO MINVALUE
@@ -1557,6 +1562,7 @@ CREATE TABLE public.tags (
-- --
CREATE SEQUENCE public.tags_id_seq CREATE SEQUENCE public.tags_id_seq
AS integer
START WITH 1 START WITH 1
INCREMENT BY 1 INCREMENT BY 1
NO MINVALUE NO MINVALUE
@@ -1846,7 +1852,8 @@ CREATE TABLE public.video_release_confirmations (
source_file_name character varying, source_file_name character varying,
clip_name character varying, clip_name character varying,
description character varying, description character varying,
channel character varying channel character varying,
file_id bigint
); );
@@ -4023,10 +4030,14 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200803150138'), ('20200803150138'),
('20200804093409'), ('20200804093409'),
('20200807190607'), ('20200807190607'),
('20200810185526'),
('20200811102720'), ('20200811102720'),
('20200812060406'), ('20200812060406'),
('20200819070738'), ('20200819070738'),
('20200820082501'), ('20200820082501'),
('20200824171649'); ('20200824171649'),
('20200908085319'),
('20200914113410'),
('20200914163203');

26
lib/daily.rb Normal file
View File

@@ -0,0 +1,26 @@
# frozen_string_literal: true
class Daily
include HTTParty
base_uri 'api.daily.co/v1'
class << self
def create_room
response = post "#{base_uri}/rooms", headers: headers
if response.code != 200
throw StandardError.new('Failed to create a room')
end
response.parsed_response
end
private
def headers
{
'Authorization': "Bearer #{ENV['DAILYCO_API_KEY']}"
}
end
end
end

View File

@@ -17,7 +17,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
it "broadcasts to the channel" do it "broadcasts to the channel" do
status_content = ApplicationController.render partial: "broadcasts/broadcast_status", locals: { broadcast: broadcast } status_content = ApplicationController.render partial: "broadcasts/broadcast_status", locals: { broadcast: broadcast }
video_content = ApplicationController.render partial: "broadcasts/video", locals: { broadcast: broadcast } video_content = ApplicationController.render partial: "broadcasts/video", locals: { broadcast: broadcast }
live_take = ApplicationController.render partial: "broadcasts/live_take", locals: { broadcast: broadcast } recording_status_content = ApplicationController.render partial: "broadcasts/recording_status", locals: { broadcast: broadcast }
expect { expect {
BroadcastsChannel.broadcast_stream_updates(broadcast) BroadcastsChannel.broadcast_stream_updates(broadcast)
@@ -28,7 +28,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
full_live_stream_playback_url: broadcast.full_live_stream_playback_url, full_live_stream_playback_url: broadcast.full_live_stream_playback_url,
status_content: status_content, status_content: status_content,
video_content: video_content, video_content: video_content,
live_take_content: live_take, recording_status_content: recording_status_content,
streamer_status: broadcast.streamer_status streamer_status: broadcast.streamer_status
}) })
end end
@@ -36,7 +36,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.visible.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 }
@@ -47,7 +47,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
BroadcastsChannel.stream_recording_ready(broadcast, recordings, 'Hello world') BroadcastsChannel.stream_recording_ready(broadcast, recordings, 'Hello world')
}.to have_broadcasted_to(broadcast).with({ }.to have_broadcasted_to(broadcast).with({
event: 'stream_recording_ready', event: 'stream_recording_ready',
flash_content: flash_content, flash_content: flash_content,
recordings_content: recordings_content, recordings_content: recordings_content,
recordings_nav_content: recordings_nav_content recordings_nav_content: recordings_nav_content
}) })

View File

@@ -12,59 +12,6 @@ RSpec.describe BroadcastRecordingsController, type: :controller do
stub_mux_live_stream stub_mux_live_stream
end end
describe "#edit" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
before do
stub_mux_live_stream
end
it "assigns project, broadcast, broadcast recording" do
get :edit, params: { project_id: project, broadcast_id: broadcast, id: recording }, xhr: true
expect(assigns(:project)).to have_attributes({
id: project.id,
name: project.name,
account_id: project.account_id
})
expect(assigns(:broadcast)).to have_attributes({
id: broadcast.id,
name: broadcast.name,
project_id: project.id
})
expect(assigns(:recording)).to have_attributes({
id: recording.id,
broadcast_id: broadcast.id,
file_name: "high.mp4"
})
end
end
describe "#update" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
let(:recordings) { create_list(:broadcast_recording, 5, :with_random_asset_uid, broadcast: broadcast) }
let(:starred_recordings) { create_list(:broadcast_recording, 5, :with_random_asset_uid, broadcast: broadcast, starred: true) }
before do
stub_mux_live_stream
end
it "updates the recording's name and description" do
expect(recording.name).to eq(recording.download_file_name)
expect(recording.description).to eq("No description provided for this recording.")
patch :update, params: { project_id: project, broadcast_id: broadcast, id: recording, broadcast_recording: { name: "Just for fun", description: "I had fun while making this stream." } }, xhr: true
recording.reload
expect(recording.name).to eq("Just for fun")
expect(recording.description).to eq("I had fun while making this stream.")
end
end
describe "#destroy" do describe "#destroy" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") } let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) } let(:recording) { create(:broadcast_recording, broadcast: broadcast) }

View File

@@ -9,6 +9,7 @@ RSpec.describe BroadcastsController, type: :controller do
before do before do
sign_in user sign_in user
ENV['DAILYCO_ENABLED'] = '1'
end end
describe "#index" do describe "#index" do
@@ -150,7 +151,14 @@ RSpec.describe BroadcastsController, type: :controller do
expect(assigns(:broadcast)).to eq(broadcast) expect(assigns(:broadcast)).to eq(broadcast)
end end
it "displays zoom meeting button" do it "displays live meeting button" do
get :show, params: { project_id: project.id, id: broadcast.id }
expect(response.body).to have_link("Video Conference", href: project_broadcast_live_meeting_url(project, broadcast))
end
it "displays zoom meeting button if dailyco is disabled" do
ENV['DAILYCO_ENABLED'] = '0'
get :show, params: { project_id: project.id, id: broadcast.id } get :show, params: { project_id: project.id, id: broadcast.id }
expect(response.body).to have_link("Video Conference", href: project_broadcast_zoom_meeting_url(project, broadcast)) expect(response.body).to have_link("Video Conference", href: project_broadcast_zoom_meeting_url(project, broadcast))
@@ -159,6 +167,14 @@ RSpec.describe BroadcastsController, type: :controller do
it "assigns required variables" do it "assigns required variables" do
get :show, params: { project_id: project.id, id: broadcast.id } get :show, params: { project_id: project.id, id: broadcast.id }
expect(assigns(:conference_url)).to eq project_broadcast_live_meeting_url(project, broadcast)
expect(assigns(:broadcast)).to eq broadcast
end
it "assigns required variables when dailyco is disabled" do
ENV['DAILYCO_ENABLED'] = '0'
get :show, params: { project_id: project.id, id: broadcast.id }
expect(assigns(:conference_url)).to eq project_broadcast_zoom_meeting_url(project, broadcast) expect(assigns(:conference_url)).to eq project_broadcast_zoom_meeting_url(project, broadcast)
expect(assigns(:broadcast)).to eq broadcast expect(assigns(:broadcast)).to eq broadcast
end end
@@ -195,15 +211,15 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response.body).to have_selector(".custom-control-label", text: "Director Mode") expect(response.body).to have_selector(".custom-control-label", text: "Director Mode")
end end
context "when director mode is enabled" do context "director mode is enabled by default" do
it "shows the video embed" do it "shows the video embed" do
get :show, params: { project_id: project, id: broadcast, director_mode: true } get :show, params: { project_id: project, id: broadcast }
expect(response.body).to have_selector("iframe", text: "video player") expect(response.body).to have_selector("iframe", text: "video player")
end end
it "renders the view dropdown with a director mode disable option" do it "renders the view dropdown with a director mode disable option" do
get :show, params: { project_id: project, id: broadcast, director_mode: true } get :show, params: { project_id: project, id: broadcast }
expect(response.body).to have_content broadcast.name expect(response.body).to have_content broadcast.name
expect(response.body).to have_selector(".custom-control-label", text: "Director Mode") expect(response.body).to have_selector(".custom-control-label", text: "Director Mode")

View File

@@ -0,0 +1,34 @@
require 'rails_helper'
RSpec.describe LiveMeetingsController, type: :controller do
let(:user) { create(:user) }
let(:account) { user.primary_account }
let(:project) { create(:project, account: user.primary_account) }
let(:broadcast) { create(:broadcast, name: "Broadcast", project: project) }
before :each do
stub_mux_live_stream
end
describe "#show" do
before { sign_in user }
it "does not create new live meeting room if project already has a room" do
expect(project.live_meeting_url.present?).to eq true
expect(Daily).not_to receive(:create_room)
get :show, params: { project_id: project.id, broadcast_id: broadcast.id }
expect(response).to be_successful
end
it "creates new live meeting room if project has no room already created" do
project.update(live_meeting_url: nil)
dummy_room_response = { url: 'dummy_url' }.to_json
expect(Daily).to receive(:create_room).and_return(JSON.parse(dummy_room_response))
get :show, params: { project_id: project.id, broadcast_id: broadcast.id }
expect(response).to be_successful
end
end
end

View File

@@ -302,6 +302,6 @@ RSpec.describe ProjectsController, type: :controller do
private private
def project_params def project_params
attributes_for(:project) attributes_for(:project).except(:live_meeting_url)
end end
end end

View File

@@ -1,6 +1,6 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe BroadcastRecordingStarringsController, type: :controller do RSpec.describe Public::BroadcastRecordingStarringsController, type: :controller do
render_views render_views
let(:user) { create(:user) } let(:user) { create(:user) }
@@ -8,7 +8,6 @@ RSpec.describe BroadcastRecordingStarringsController, type: :controller do
let(:project) { create(:project, account: user.primary_account) } let(:project) { create(:project, account: user.primary_account) }
before do before do
sign_in user
stub_mux_live_stream stub_mux_live_stream
end end
@@ -22,7 +21,7 @@ RSpec.describe BroadcastRecordingStarringsController, type: :controller do
expect(recording.starred).to be_falsey expect(recording.starred).to be_falsey
end end
post :create, params: { project_id: project, broadcast_id: broadcast, broadcast_recording_id: recordings.first.id }, xhr: true post :create, params: { broadcast_token: broadcast.token, broadcast_recording_id: recordings.first.id }, xhr: true
expect(recordings.first.reload.starred).to eq true expect(recordings.first.reload.starred).to eq true
@@ -36,7 +35,7 @@ RSpec.describe BroadcastRecordingStarringsController, type: :controller do
expect(recording.starred).to be_truthy expect(recording.starred).to be_truthy
end end
post :create, params: { project_id: project, broadcast_id: broadcast, broadcast_recording_id: starred_recordings.first.id }, xhr: true post :create, params: { broadcast_token: broadcast.token, broadcast_recording_id: starred_recordings.first.id }, xhr: true
expect(starred_recordings.first.reload.starred).to eq false expect(starred_recordings.first.reload.starred).to eq false

View File

@@ -0,0 +1,59 @@
require 'rails_helper'
RSpec.describe Public::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
stub_mux_live_stream
end
describe "#edit" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
before do
stub_mux_live_stream
end
it "assigns project, broadcast, broadcast recording" do
get :edit, params: { broadcast_token: broadcast.token, id: recording }, xhr: true
expect(assigns(:broadcast)).to have_attributes({
id: broadcast.id,
name: broadcast.name,
project_id: project.id
})
expect(assigns(:recording)).to have_attributes({
id: recording.id,
broadcast_id: broadcast.id,
file_name: "high.mp4"
})
end
end
describe "#update" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
let(:recordings) { create_list(:broadcast_recording, 5, :with_random_asset_uid, broadcast: broadcast) }
before do
stub_mux_live_stream
end
it "updates the recording's name and description" do
expect(recording.name).to eq(recording.download_file_name)
expect(recording.description).to eq("No description provided for this recording.")
patch :update, params: { broadcast_token: broadcast.token, id: recording, broadcast_recording: { name: "Just for fun", description: "I had fun while making this stream." } }, xhr: true
recording.reload
expect(recording.name).to eq("Just for fun")
expect(recording.description).to eq("I had fun while making this stream.")
end
end
end

View File

@@ -8,6 +8,7 @@ RSpec.describe Public::BroadcastsController, type: :controller do
let(:project) { create(:project, account: user.primary_account) } let(:project) { create(:project, account: user.primary_account) }
before do before do
ENV['DAILYCO_ENABLED'] = '1'
stub_mux_live_stream stub_mux_live_stream
end end
@@ -21,7 +22,14 @@ RSpec.describe Public::BroadcastsController, type: :controller do
expect(assigns(:broadcast)).to eq(broadcast) expect(assigns(:broadcast)).to eq(broadcast)
end end
it "renders zoom meeting button" do it "renders live meeting button" do
get :show, params: { token: broadcast.token }
expect(response.body).to have_link("Video Conference", href: broadcast_live_meeting_url(broadcast.token))
end
it "renders zoom meeting button if dailyco is not enabled" do
ENV['DAILYCO_ENABLED'] = '0'
get :show, params: { token: broadcast.token } get :show, params: { token: broadcast.token }
expect(response.body).to have_link("Video Conference", href: broadcast_zoom_meeting_url(broadcast.token)) expect(response.body).to have_link("Video Conference", href: broadcast_zoom_meeting_url(broadcast.token))
@@ -37,6 +45,14 @@ RSpec.describe Public::BroadcastsController, type: :controller do
it "assigns required variables" do it "assigns required variables" do
get :show, params: { token: broadcast.token } get :show, params: { token: broadcast.token }
expect(assigns(:conference_url)).to eq broadcast_live_meeting_url(broadcast.token)
expect(assigns(:broadcast)).to eq broadcast
end
it "assigns required variables - when dailyco is not enabled" do
ENV['DAILYCO_ENABLED'] = '0'
get :show, params: { token: broadcast.token }
expect(assigns(:conference_url)).to eq broadcast_zoom_meeting_url(broadcast.token) expect(assigns(:conference_url)).to eq broadcast_zoom_meeting_url(broadcast.token)
expect(assigns(:broadcast)).to eq broadcast expect(assigns(:broadcast)).to eq broadcast
end end

View File

@@ -0,0 +1,39 @@
require 'rails_helper'
RSpec.describe Public::LiveMeetingsController, type: :controller do
let(:user) { create(:user) }
let(:account) { user.primary_account }
let(:project) { create(:project, account: user.primary_account) }
let(:broadcast) { create(:broadcast, name: "Broadcast", project: project) }
before :each do
stub_mux_live_stream
end
describe "#show" do
it "does not create new live meeting room if project already has a room" do
expect(project.live_meeting_url.present?).to eq true
expect(Daily).not_to receive(:create_room)
get :show, params: { broadcast_token: broadcast.token }
expect(response).to be_successful
expect(response.body).not_to match meeting_not_ready_message
end
it "creates new live meeting room if project has no room already created" do
project.update(live_meeting_url: nil)
expect(Daily).not_to receive(:create_room)
get :show, params: { broadcast_token: broadcast.token }
expect(response).to be_successful
end
end
private
def meeting_not_ready_message
t 'public.live_meetings.show.meeting_not_ready_message'
end
end

View File

@@ -18,6 +18,7 @@ RSpec.describe Public::ZoomMeetingsController, type: :controller do
describe "#show" do describe "#show" do
it "redirects to meeting start url" do it "redirects to meeting start url" do
skip 'will be deleted'
get :show, params: { broadcast_token: broadcast.token } get :show, params: { broadcast_token: broadcast.token }
expect(response).to redirect_to(meeting_start_url) expect(response).to redirect_to(meeting_start_url)
end end

View File

@@ -10,7 +10,7 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
end end
describe "acquired_media_release" do describe "acquired_media_release" do
let(:acquired_media_release) { create(:acquired_media_release) } let(:acquired_media_release) { create(:acquired_media_release, :with_files) }
describe "#new" do describe "#new" do
let(:edl_event_gateway) { instance_double(EdlEventGateway) } let(:edl_event_gateway) { instance_double(EdlEventGateway) }
@@ -21,8 +21,6 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
end end
it "assigns video_release_confirmation, video, edl_events_data" do it "assigns video_release_confirmation, video, edl_events_data" do
file_info = create(:file_info)
post :new, post :new,
params: { params: {
video_id: video, video_id: video,
@@ -35,7 +33,7 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
source_file_name: nil, source_file_name: nil,
clip_name: nil, clip_name: nil,
description: nil, description: nil,
file_info_id: file_info, file_id: acquired_media_release.files.first.id,
}, },
use_route: new_video_acquired_media_release_video_release_confirmation_path(video, acquired_media_release) use_route: new_video_acquired_media_release_video_release_confirmation_path(video, acquired_media_release)
}, },
@@ -53,7 +51,7 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
source_file_name: "source_file_name", source_file_name: "source_file_name",
clip_name: "clip_name", clip_name: "clip_name",
description: "description", description: "description",
file_info_id: file_info.id, file_id: acquired_media_release.files.first.id,
}) })
expect(assigns(:video)).to have_attributes({ expect(assigns(:video)).to have_attributes({
id: video.id, id: video.id,
@@ -82,8 +80,6 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
describe "#create" do describe "#create" do
it "assigns video_release_confirmations, video_release_confirmation" do it "assigns video_release_confirmations, video_release_confirmation" do
file_info = create(:file_info)
post :create, post :create,
params: { params: {
video_id: video, video_id: video,
@@ -97,7 +93,7 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
source_file_name: "DISCLAIMER.AVI", source_file_name: "DISCLAIMER.AVI",
clip_name: "DISCLAIMER.AVI.NEW.02", clip_name: "DISCLAIMER.AVI.NEW.02",
description: "Boat", description: "Boat",
file_info_id: file_info, file_id: acquired_media_release.files.first.id,
}, },
use_route: video_acquired_media_release_video_release_confirmations_path(video, acquired_media_release) use_route: video_acquired_media_release_video_release_confirmations_path(video, acquired_media_release)
}, },
@@ -112,7 +108,7 @@ RSpec.describe VideoReleaseConfirmationsController, type: :controller do
source_file_name: "DISCLAIMER.AVI", source_file_name: "DISCLAIMER.AVI",
clip_name: "DISCLAIMER.AVI.NEW.02", clip_name: "DISCLAIMER.AVI.NEW.02",
description: "Boat", description: "Boat",
file_info_id: file_info.id, file_id: acquired_media_release.files.first.id,
}) })
end end

Some files were not shown because too many files have changed in this diff Show More