Upstream sync
This commit is contained in:
7
app/assets/javascripts/bs_component_init.js
Normal file
7
app/assets/javascripts/bs_component_init.js
Normal file
@@ -0,0 +1,7 @@
|
||||
$(document).on("turbolinks:load", function() {
|
||||
bsCustomFileInput.init();
|
||||
})
|
||||
|
||||
$(document).on("turbolinks:load", function() {
|
||||
$(".toast").toast('show');
|
||||
})
|
||||
@@ -43,6 +43,7 @@ $(document).on "turbolinks:load", ->
|
||||
$(".flash-message").html data.flash_content
|
||||
$("#broadcast_recordings").html data.recordings_content
|
||||
$("#broadcast_recordings_nav").html data.recordings_nav_content
|
||||
$(".toast").toast('show')
|
||||
|
||||
refreshBroadcastFilesTab: (data) ->
|
||||
$("#broadcast_file_list_#{data.broadcast_token}").html data.files_content
|
||||
|
||||
@@ -23,3 +23,4 @@ $(document).on "turbolinks:load", ->
|
||||
|
||||
showDownloadStatusUpdate: (content) ->
|
||||
$(".flash-message").html content
|
||||
$(".toast").toast('show')
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
$(document).on("turbolinks:load", function() {
|
||||
bsCustomFileInput.init()
|
||||
})
|
||||
@@ -24,4 +24,4 @@ $(document).on("click", "[data-behavior=play_stream]", function() {
|
||||
|
||||
function clearPlayingHighlight() {
|
||||
$(".playing-highlight").removeClass("playing-highlight");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,3 +495,30 @@ trix-toolbar {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -5,14 +5,6 @@ class BroadcastRecordingsController < ApplicationController
|
||||
before_action :set_broadcast
|
||||
before_action :set_recording
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
@recording.update(broadcast_recording_params)
|
||||
set_recordings
|
||||
end
|
||||
|
||||
def destroy
|
||||
@recording.update(hidden: true)
|
||||
set_recordings
|
||||
@@ -20,10 +12,6 @@ class BroadcastRecordingsController < ApplicationController
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
31
app/controllers/public/broadcast_recordings_controller.rb
Normal file
31
app/controllers/public/broadcast_recordings_controller.rb
Normal 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
|
||||
@@ -2,7 +2,7 @@ class VideoAnalyses::AcquiredMediaReleasesController < ApplicationController
|
||||
before_action :set_video
|
||||
|
||||
def index
|
||||
@acquired_media_file_infos = filtered_file_infos
|
||||
@acquired_media_files = filtered_files
|
||||
end
|
||||
|
||||
private
|
||||
@@ -15,12 +15,12 @@ class VideoAnalyses::AcquiredMediaReleasesController < ApplicationController
|
||||
params[:query]
|
||||
end
|
||||
|
||||
def filtered_file_infos
|
||||
def filtered_files
|
||||
releasables = policy_scope(@video.acquired_media_releases)
|
||||
results = FileInfo.where(releasable: releasables)
|
||||
results = ActiveStorage::Attachment.where(record: releasables, name: "files")
|
||||
|
||||
if query_param.present?
|
||||
results = results.search_filename(query_param)
|
||||
results = results.joins(:blob).where("active_storage_blobs.filename ILIKE ?", "%#{query_param}%")
|
||||
end
|
||||
|
||||
results
|
||||
|
||||
@@ -74,6 +74,7 @@ class VideoReleaseConfirmationsController < ApplicationController
|
||||
params.require(:video_release_confirmation).permit(
|
||||
:time_elapsed,
|
||||
:file_info_id,
|
||||
:file_id,
|
||||
:channel,
|
||||
:timecode_in,
|
||||
:timecode_out,
|
||||
|
||||
@@ -18,7 +18,7 @@ class ContractTemplate < ApplicationRecord
|
||||
has_many :medical_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 :guardian_clause
|
||||
has_rich_text :signature_legal_text
|
||||
@@ -29,7 +29,7 @@ class ContractTemplate < ApplicationRecord
|
||||
|
||||
validates :name, presence: true
|
||||
validates :release_type, presence: true
|
||||
validates :fee_cents, numericality: {
|
||||
validates :fee_old_cents, numericality: {
|
||||
greater_than_or_equal_to: 0,
|
||||
less_than_or_equal_to: 99_999_999_99
|
||||
}
|
||||
@@ -50,7 +50,11 @@ class ContractTemplate < ApplicationRecord
|
||||
enum accessibility: [:public_template, :private_template]
|
||||
|
||||
def fee?
|
||||
!fee.zero?
|
||||
fee.present?
|
||||
end
|
||||
|
||||
def fee_old?
|
||||
!fee_old.zero?
|
||||
end
|
||||
|
||||
def releases
|
||||
|
||||
@@ -9,6 +9,10 @@ class VideoReleaseConfirmation < ApplicationRecord
|
||||
Timecode.from_seconds(time_elapsed.to_f).to_s
|
||||
end
|
||||
|
||||
def file
|
||||
ActiveStorage::Attachment.find(file_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
class ReleaseRankOrder
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
<% if flash.alert.present? %>
|
||||
<div class="alert alert-danger text-center text-md-left"><%= flash.alert.html_safe %></div>
|
||||
<% elsif flash.notice.present? %>
|
||||
<div class="alert alert-primary text-center text-md-left"><%= flash.notice.html_safe %></div>
|
||||
<% end %>
|
||||
<!-- Wrapping element flash message-->
|
||||
<div class="position-relative" style="z-index: 9999;">
|
||||
<!-- Position toasts -->
|
||||
<div class="position-absolute" style="top: 0.5rem; right: 0.5rem;">
|
||||
<% 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">×</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">×</button>
|
||||
<p><%= flash.notice.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<%= render("broadcast_recordings/refresh_recordings_list") %>
|
||||
@@ -2,7 +2,7 @@
|
||||
<% recordings.each do |recording| %>
|
||||
<li class="media p-3">
|
||||
<% if policy(BroadcastRecording).update? %>
|
||||
<%= link_to fa_icon("#{recording.starred ? 'star' : 'star-o'} fw"), [broadcast.project, broadcast, recording, :broadcast_recording_starrings], method: :post, class: "text-warning mr-2", remote: true %>
|
||||
<%= 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 %>
|
||||
<% end %>
|
||||
|
||||
<div class="play-thumbnail">
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
|
||||
<% if policy(BroadcastRecording).edit? %>
|
||||
<%= link_to fa_icon('edit'), [:edit, broadcast.project, broadcast, recording], class: "mr-3", remote: true %>
|
||||
<%= 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") %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% if broadcast.director_mode_video_embed.present? && params[:director_mode].present? %>
|
||||
<div class="embed-responsive-item" data-video-type="stream">
|
||||
<% if broadcast.director_mode_video_embed.present? && params[:non_director_mode].nil? %>
|
||||
<div id="director_broadcast_video" class="embed-responsive-item" data-video-type="stream">
|
||||
<%= raw broadcast.director_mode_video_embed %>
|
||||
</div>
|
||||
<% elsif broadcast.streamer_recording? && broadcast.active? %>
|
||||
|
||||
@@ -41,17 +41,17 @@
|
||||
<%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", data: { behavior: "play_stream"}, class: "dropdown-item active" %>
|
||||
<% @multi_view_broadcasts.each do |broadcast| %>
|
||||
<% if broadcast.id != @broadcast.id %>
|
||||
<% if params[:director_mode] %>
|
||||
<% if params[:non_director_mode] %>
|
||||
<% 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 %>
|
||||
<%= 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 %>
|
||||
<% else %>
|
||||
<% 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 %>
|
||||
<%= 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 %>
|
||||
@@ -59,18 +59,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<% if @broadcast.director_mode_video_embed.present? %>
|
||||
<% if params[:director_mode] %>
|
||||
<% if params[:non_director_mode] %>
|
||||
<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>
|
||||
</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 %>
|
||||
<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>
|
||||
</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 %>
|
||||
</div>
|
||||
@@ -133,6 +133,21 @@
|
||||
<div id="live_take">
|
||||
<%= render partial: 'broadcasts/live_take', locals: { broadcast: @broadcast } %>
|
||||
</div>
|
||||
<% if params[:non_director_mode] %>
|
||||
<% if controller.class.module_parent.to_s == "Public" %>
|
||||
<%= 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 %>
|
||||
<%= 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 %>
|
||||
<hr/>
|
||||
<% else %>
|
||||
<% if controller.class.module_parent.to_s == "Public" %>
|
||||
<%= 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 %>
|
||||
<%= 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 %>
|
||||
<hr/>
|
||||
<% end %>
|
||||
<div id="broadcast_recordings">
|
||||
<%= render partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast } %>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<% if contract_template.fee? %>
|
||||
<%= number_to_currency(contract_template.fee) %>
|
||||
<%= contract_template.fee %>
|
||||
<% else %>
|
||||
<%= t(".no_fee") %>
|
||||
<% end %>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= form.radio_button :accessibility, :private_template, label: "Private" %>
|
||||
</div>
|
||||
<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>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<%= description_list_pair "Filming Hours:", releasable&.filming_hours %>
|
||||
<% end %>
|
||||
<% if contract_template.fee? %>
|
||||
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
|
||||
<%= description_list_pair "Fee:", contract_template.fee %>
|
||||
<% end %>
|
||||
<% if releasable.model_name == "MaterialRelease" %>
|
||||
<%= description_list_pair "Description:", releasable.description %>
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="flash-message">
|
||||
<%= render "flash" %>
|
||||
</div>
|
||||
<%= content_for?(:header) ? yield(:header) : render("header") %>
|
||||
<%= render "masquerade" if masquerading? %>
|
||||
<main class="container-fluid py-3">
|
||||
<div class="flash-message"></div>
|
||||
<%= render "flash" %>
|
||||
</div>
|
||||
<%= content_for?(:content) ? yield(:content) : yield %>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -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 }) %>");
|
||||
@@ -7,7 +7,7 @@
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</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 id="broadcast_recording_fields">
|
||||
<%= form.text_field :name %>
|
||||
@@ -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");
|
||||
@@ -2,5 +2,5 @@
|
||||
$("#edit_broadcast_recording_modal").remove();
|
||||
|
||||
<% # 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");
|
||||
1
app/views/public/broadcast_recordings/update.js.erb
Normal file
1
app/views/public/broadcast_recordings/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render("public/broadcast_recordings/refresh_recordings_list") %>
|
||||
@@ -6,7 +6,7 @@
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<%= @contract_template.body %>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -24,7 +24,7 @@
|
||||
<% end %>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% 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 %>
|
||||
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -139,4 +139,4 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if acquired_media_file_infos.any? %>
|
||||
<% acquired_media_file_infos.each do |file_info| %>
|
||||
<li class="acquired-media-releasable list-inline-item" data-ujs-target="<%= dom_id(file_info.releasable, dom_id(file_info)) %>" data-hidden="false">
|
||||
<%= render "video_analyses/file_info_releasable", releasable: file_info.releasable, video: video, file_info: file_info %>
|
||||
<% if acquired_media_files.any? %>
|
||||
<% acquired_media_files.each do |file| %>
|
||||
<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_releasable", releasable: file.record, video: video, file: file %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if acquired_media_release.file_infos.any? %>
|
||||
<% acquired_media_release.file_infos.each do |file_info| %>
|
||||
<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">
|
||||
<%= render "video_analyses/file_info_releasable", releasable: acquired_media_release, video: video, file_info: file_info %>
|
||||
<% if acquired_media_release.files.any? %>
|
||||
<% acquired_media_release.files.each do |file| %>
|
||||
<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_releasable", releasable: acquired_media_release, video: video, file: file %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
@@ -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 %>
|
||||
12
app/views/video_analyses/_file_releasable.html.erb
Normal file
12
app/views/video_analyses/_file_releasable.html.erb
Normal 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 %>
|
||||
@@ -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) %>">
|
||||
<%= render "video_analyses/releasable", releasable: material_release, video: video %>
|
||||
</li>
|
||||
<% if material_release.files.any? %>
|
||||
<% material_release.files.each do |file| %>
|
||||
<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 %>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<td><a data-behavior="seekable-timecode"><%= confirmation.appears_at %></a></td>
|
||||
<td><%= confirmation.releasable.name %></td>
|
||||
<td>
|
||||
<% if confirmation.file_info.present? %>
|
||||
<%= confirmation.file_info.filename %></div>
|
||||
<% if confirmation.file_id.present? %>
|
||||
<%= confirmation.file.filename %></div>
|
||||
<% elsif confirmation.releasable.respond_to?(:photo) && confirmation.releasable.photo.attached? %>
|
||||
<%= image_tag thumbnail_variant(confirmation.releasable.photo), class: "img-fluid figure-img" %>
|
||||
<% else %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
$("#acquired_media_releases [data-toggle=tooltip]").tooltip("dispose");
|
||||
|
||||
// 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
|
||||
$("#acquired_media_releases_section form input[name='query']").val("<%= params[:query] %>");
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<div id="video_release_confirmation_fields">
|
||||
<%= 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.text_field :channel %>
|
||||
<%= form.text_field :timecode_in %>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var hideConfirmed = $("input[name=hide_confirmed]:checked").length > 0;
|
||||
|
||||
// Mark the release as confirmed
|
||||
if (<%= @releasable.respond_to?(:file_infos) %>) {
|
||||
$("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.file_info_id}") %>]").attr("data-confirmed", true).data("confirmed", true)
|
||||
if (<%= @releasable.respond_to?(:files) %>) {
|
||||
$("[data-ujs-target=<%= dom_id(@releasable, "attachment_#{@video_release_confirmation.file_id}") %>]").attr("data-confirmed", true).data("confirmed", true)
|
||||
} else {
|
||||
$("#<%= dom_id(@releasable) %>").attr("data-confirmed", true).data("confirmed", true)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Mark the release as no longer confirmed and show
|
||||
if (<%= @releasable.respond_to?(:file_infos) && @video_release_confirmation.respond_to?(:file_info_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 } %>) {
|
||||
$("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.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_id) && video_release_confirmation.file_id == @video_release_confirmation.file_id } %>) {
|
||||
$("[data-ujs-target=<%= dom_id(@releasable, "attachment_#{@video_release_confirmation.file_id}") %>]")
|
||||
.attr("data-confirmed", false).data("confirmed", false)
|
||||
.attr("data-hidden", false).data("hidden", false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user