Compare commits
3 Commits
improve-do
...
improve-do
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bda6c3480 | ||
|
|
98afad4174 | ||
|
|
3471e21429 |
@@ -1,4 +1,8 @@
|
||||
$(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
if ($(this).hasClass('active')){
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#broadcast_video").data('videoType', 'recording');
|
||||
|
||||
var playback_url = $(this).attr("data-playback-url")
|
||||
@@ -12,6 +16,13 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
height: '100%',
|
||||
autoPlay: true
|
||||
});
|
||||
|
||||
$(".dropdown-menu").children().removeClass('active');
|
||||
$(".dropdown-menu").children().children('i').remove();
|
||||
$(this).siblings().removeClass('active');
|
||||
$(this).siblings().children("i").remove();
|
||||
$(this).addClass('active');
|
||||
$(this).prepend('<i class="fa fa-check"> </i>');
|
||||
});
|
||||
|
||||
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").data('videoType', 'stream'); });
|
||||
@@ -45,14 +45,13 @@ class Api::ReleasesController < Api::ApiController
|
||||
if model_name == "acquired_media_release"
|
||||
mapping = {
|
||||
"#{model_name.camelize}": SerializableAcquiredMediaRelease,
|
||||
FileInfo: SerializableFileInfo,
|
||||
"ActiveStorage::Attachment".to_sym => ActiveStorage::SerializableAttachment,
|
||||
FileInfo: SerializableFileInfo
|
||||
}
|
||||
|
||||
render jsonapi: release,
|
||||
status: status,
|
||||
class: mapping,
|
||||
include: [:files, :file_infos]
|
||||
include: [:file_infos]
|
||||
else
|
||||
mapping = {
|
||||
"#{model_name.camelize}": show_serializable,
|
||||
|
||||
@@ -4,16 +4,4 @@ class PagesController < ApplicationController
|
||||
skip_after_action :verify_authorized
|
||||
skip_after_action :verify_policy_scoped
|
||||
skip_before_action :require_login
|
||||
|
||||
layout :layout_for_page
|
||||
|
||||
private
|
||||
|
||||
def layout_for_page
|
||||
case params[:id]
|
||||
when 'nanocosmos_player'
|
||||
false
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,10 +12,10 @@ class BroadcastRecordingPolicy < ApplicationPolicy
|
||||
end
|
||||
|
||||
def edit?
|
||||
true
|
||||
destroy?
|
||||
end
|
||||
|
||||
def update?
|
||||
true
|
||||
edit?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ class SerializableAcquiredMediaRelease < JSONAPI::Serializable::Resource
|
||||
:person_title, :person_company, :created_at, :updated_at, :collection_uid, :territory_old, :term_old,
|
||||
:applicable_medium_id, :applicable_medium_text, :territory_id, :territory_text, :term_id, :term_text,
|
||||
:restriction_id, :restriction_text, :categories, :description, :tag_list
|
||||
|
||||
|
||||
has_many :file_infos do
|
||||
data do
|
||||
@object.file_infos
|
||||
@@ -17,14 +17,4 @@ class SerializableAcquiredMediaRelease < JSONAPI::Serializable::Resource
|
||||
{ count: @object.file_infos.size }
|
||||
end
|
||||
end
|
||||
|
||||
has_many :files do
|
||||
data do
|
||||
@object.files
|
||||
end
|
||||
|
||||
meta do
|
||||
{ count: @object.files.size }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
class SerializableUser < JSONAPI::Serializable::Resource
|
||||
type "user"
|
||||
|
||||
attributes :email, :full_name
|
||||
|
||||
attribute :company_name do
|
||||
@object.primary_account.name
|
||||
end
|
||||
attributes :email
|
||||
end
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @acquired_media_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(AcquiredMediaRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :acquired_media_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
</div>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :acquired_media_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @acquired_media_releases.any? && policy(AcquiredMediaRelease).tag_multiple? %>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if @acquired_media_releases.any? && policy(AcquiredMediaRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @acquired_media_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @acquired_media_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#acquired_media_releases").html("<%= j render(@acquired_media_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#acquired_media_releases_pagination").html("<%= j will_paginate(@acquired_media_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @acquired_media_releases.total_entries %>);
|
||||
@@ -3,12 +3,12 @@
|
||||
<% recordings.each do |recording| %>
|
||||
<div class="list-group-item list-group-item-action">
|
||||
<div class="d-flex align-items-start">
|
||||
<% if policy(BroadcastRecording).update? %>
|
||||
<% if (controller.class.module_parent.to_s != "Public" && 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-3", remote: true %>
|
||||
<% end %>
|
||||
<%= 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: 'img-thumbnail img-fluid max-w-75') %>
|
||||
<div class="ml-auto">
|
||||
<% if policy(BroadcastRecording).edit? %>
|
||||
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).edit?) %>
|
||||
<%= link_to fa_icon('edit'), [:edit, broadcast.project, broadcast, recording], remote: true %>
|
||||
<% end %>
|
||||
<%= link_to(fa_icon('download'), recording.download_url, target: "_blank") %>
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
@@ -22,16 +22,11 @@
|
||||
<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') %>
|
||||
<div class="ml-4 dropdown">
|
||||
<% if @multi_view_broadcasts.present? %>
|
||||
<%= link_to "#", class: "btn btn-light dropdown-toggle text-white bg-black border-0 override-dropdown-show-state", role: "button", id: "dropdownMenuLink", data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } do %>
|
||||
<i class="fa fa-video-camera text-primary" aria-hidden="true"></i><span class="ml-2" id="selected_stream"><%= @broadcast.name %></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "javascript:void(0);", class: "btn btn-light text-white bg-black border-0 override-dropdown-show-state", role: "button", id: "dropdownMenuLink", aria: { haspopup: "true", expanded: "false" } do %>
|
||||
<i class="fa fa-video-camera text-primary" aria-hidden="true"></i><span class="ml-2" id="selected_stream"><%= @broadcast.name %></span>
|
||||
<% end %>
|
||||
<%= link_to "#", class: "btn btn-light dropdown-toggle text-white bg-black border-0 override-dropdown-show-state", role: "button", id: "dropdownMenuLink", data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } do %>
|
||||
<i class="fa fa-video-camera text-primary" aria-hidden="true"></i><span class="ml-2" id="selected_stream"><%= @broadcast.name %></span>
|
||||
<% end %>
|
||||
<div class="dropdown-menu bg-black" aria-labelledby="dropdownMenuLink">
|
||||
<h5 class="dropdown-header">Live Streams</h5>
|
||||
<%= 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 %>
|
||||
@@ -125,21 +120,6 @@
|
||||
<div id="live_take">
|
||||
<%= render partial: 'broadcasts/live_take', locals: { broadcast: @broadcast } %>
|
||||
</div>
|
||||
<% if params[:director_mode] %>
|
||||
<% 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" %>
|
||||
<% 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" %>
|
||||
<% 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(: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(: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>
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @location_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(LocationRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :location_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
</div>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :location_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @location_releases.any? && policy(LocationRelease).tag_multiple? %>
|
||||
@@ -13,7 +10,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @location_releases.any? && policy(LocationRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @location_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @location_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#location_releases").html("<%= j render(@location_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#location_releases_pagination").html("<%= j will_paginate(@location_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @location_releases.total_entries %>);
|
||||
@@ -1,11 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @material_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(MaterialRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :material_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
</div>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :material_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @material_releases.any? && policy(MaterialRelease).tag_multiple? %>
|
||||
@@ -13,7 +10,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @material_releases.any? && policy(MaterialRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @material_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @material_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#material_releases").html("<%= j render(@material_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#material_releases_pagination").html("<%= j will_paginate(@material_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @material_releases.total_entries %>);
|
||||
@@ -1,15 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @medical_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if @medical_releases.any? && policy(MedicalRelease).tag_multiple? %>
|
||||
<div class="ml-auto">
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
</div>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @medical_releases.any? && policy(MedicalRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @medical_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @medical_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#medical_releases").html("<%= j render(@medical_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#medical_releases_pagination").html("<%= j will_paginate(@medical_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @medical_releases.total_entries %>);
|
||||
@@ -1,15 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @misc_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if @misc_releases.any? && policy(MiscRelease).tag_multiple? %>
|
||||
<div class="ml-auto">
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
</div>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @misc_releases.any? && policy(MiscRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @misc_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @misc_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#misc_releases").html("<%= j render(@misc_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#misc_releases_pagination").html("<%= j will_paginate(@misc_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @misc_releases.total_entries %>);
|
||||
@@ -1,11 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @music_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(MusicRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :music_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
</div>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :music_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @music_releases.any? && policy(MusicRelease).tag_multiple? %>
|
||||
@@ -13,7 +10,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @music_releases.any? && policy(MusicRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @music_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2" %>
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @music_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<%= bootstrap_form_with url: [@project, :music_releases], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#music_releases").html("<%= j render(@music_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#music_releases_pagination").html("<%= j will_paginate(@music_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @music_releases.total_entries %>);
|
||||
@@ -1,45 +0,0 @@
|
||||
<div>
|
||||
<div id="playerDiv"></div>
|
||||
<script type="text/javascript" src="https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.4.min.js"></script>
|
||||
<%= javascript_tag nonce: true do %>
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
var streamName = urlParams.get('stream_name');
|
||||
console.log("streamName", streamName);
|
||||
var player;
|
||||
var config = {
|
||||
"source": {
|
||||
"entries": [
|
||||
{
|
||||
"h5live": {
|
||||
// your rtmp stream
|
||||
"rtmp": {
|
||||
"url": "rtmp://bintu-play.nanocosmos.de/play",
|
||||
"streamname": streamName,
|
||||
},
|
||||
"server": {
|
||||
"websocket": "wss://bintu-h5live.nanocosmos.de:443/h5live/stream.mp4",
|
||||
"hls": "https://bintu-h5live.nanocosmos.de:443/h5live/http/playlist.m3u8",
|
||||
"progressive": "https://bintu-h5live.nanocosmos.de:443/h5live/http/stream.mp4"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"width": "auto",
|
||||
}
|
||||
};
|
||||
function initPlayer() {
|
||||
player = new NanoPlayer('playerDiv');
|
||||
player.setup(config).then(function (config) {
|
||||
console.log('setup ok with config: ' + JSON.stringify(config));
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
// load player from playerDiv
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
initPlayer();
|
||||
});
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,11 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input id="total_entries" type=hidden value=<%= @talent_releases.total_entries %> />
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(TalentRelease).new? %>
|
||||
<div class="mr-auto">
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :talent_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
</div>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :talent_release], class: "btn btn-primary mr-2 mb-2" %>
|
||||
<% end %>
|
||||
|
||||
<% if @talent_releases.any? && policy(TalentRelease).tag_multiple? %>
|
||||
@@ -13,7 +10,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @talent_releases.any? && policy(TalentRelease).download_multiple? %>
|
||||
<%= button_to "Download", [@project, :contract_downloads, release_type: @talent_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border mr-2 mb-2", data: {
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @talent_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
$("#talent_releases").html("<%= j render(@talent_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#talent_releases_pagination").html("<%= j will_paginate(@talent_releases) %>");
|
||||
$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([]));
|
||||
$("#total_entries").val(<%= @talent_releases.total_entries %>);
|
||||
@@ -9,12 +9,12 @@ Rails.application.config.content_security_policy do |policy|
|
||||
policy.font_src :self, :https, :data
|
||||
policy.img_src :self, :https, :data
|
||||
policy.object_src :self
|
||||
policy.script_src :self, :https, AppHost.new.domain_with_port, "https://stream.mux.com", "https://demo.nanocosmos.de", :blob, :unsafe_eval
|
||||
policy.script_src :self, :https, AppHost.new.domain_with_port, "https://stream.mux.com", :blob, :unsafe_eval
|
||||
policy.media_src :self, :https, AppHost.new.domain_with_port, "https://stream.mux.com", :data, :blob
|
||||
# policy.style_src :self, :https, :unsafe_inline
|
||||
# If you are using webpack-dev-server then specify webpack-dev-server host
|
||||
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
|
||||
policy.connect_src :self, :https, "ws://#{AppHost.new.domain_with_port}", "wss://#{AppHost.new.domain_with_port}", "wss://bintu-h5live.nanocosmos.de"
|
||||
policy.connect_src :self, :https, "ws://#{AppHost.new.domain_with_port}", "wss://#{AppHost.new.domain_with_port}"
|
||||
|
||||
# Specify URI for violation reports
|
||||
# policy.report_uri "/csp-violation-report-endpoint"
|
||||
|
||||
@@ -200,7 +200,6 @@ Rails.application.routes.draw do
|
||||
|
||||
get "cookies_disabled" => 'pages#show', id: "cookies_disabled", as: :cookies_disabled
|
||||
get "accountless_user" => 'pages#show', id: "accountless_user", as: :accountless_user
|
||||
get "nanocosmos_player" => 'pages#show', id: "nanocosmos_player", as: :nanocosmos_player
|
||||
|
||||
resource :session, only: [:new, :create]
|
||||
resources :password_resets, only: [:new, :create, :edit, :update]
|
||||
|
||||
@@ -542,9 +542,9 @@ CREATE TABLE public.broadcast_recordings (
|
||||
updated_at timestamp(6) without time zone NOT NULL,
|
||||
duration double precision,
|
||||
hidden boolean DEFAULT false,
|
||||
starred boolean DEFAULT false,
|
||||
name character varying,
|
||||
description text
|
||||
description text,
|
||||
starred boolean DEFAULT false
|
||||
);
|
||||
|
||||
|
||||
@@ -1492,6 +1492,7 @@ CREATE TABLE public.settings (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.settings_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
@@ -1527,6 +1528,7 @@ CREATE TABLE public.taggings (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.taggings_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
@@ -1557,6 +1559,7 @@ CREATE TABLE public.tags (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.tags_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
|
||||
@@ -30,16 +30,6 @@ RSpec.describe Api::AcquiredMediaReleasesController, type: :controller do
|
||||
|
||||
expect(response).to be_successful
|
||||
end
|
||||
|
||||
it 'contains files attachment data' do
|
||||
tested_release = create(:acquired_media_release, name: 'ct1', project_id: project.id)
|
||||
|
||||
sign_in_to_api(current_user)
|
||||
get :show, params: { id: tested_release.id }
|
||||
|
||||
expect(response.body).to match /file_infos/
|
||||
expect(response.body).to match /files/
|
||||
end
|
||||
end
|
||||
|
||||
describe '#create' do
|
||||
|
||||
@@ -14,8 +14,6 @@ RSpec.describe Api::ProfilesController, type: :controller do
|
||||
expect(response).to be_successful
|
||||
expect(response_body_data).to include('id' => current_user.to_param, 'type' => 'user')
|
||||
expect(response_body_data_attributes).to include('email' => current_user.email)
|
||||
expect(response_body_data_attributes).to include('full_name' => current_user.full_name)
|
||||
expect(response_body_data_attributes).to include('company_name' => current_user.primary_account.name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -197,13 +197,13 @@ feature "User managing medical releases" do
|
||||
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1)
|
||||
end
|
||||
|
||||
scenario "Download button is visible" do
|
||||
scenario "Download All is visible" do
|
||||
create(:medical_release_with_contract_template, :native, project: project)
|
||||
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).to have_content download_button
|
||||
expect(page).to have_content download_all_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is visible" do
|
||||
@@ -264,7 +264,7 @@ feature "User managing medical releases" do
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).not_to have_content download_button
|
||||
expect(page).not_to have_content download_all_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is not visible" do
|
||||
@@ -308,7 +308,7 @@ feature "User managing medical releases" do
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).not_to have_content download_button
|
||||
expect(page).not_to have_content download_all_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is not visible" do
|
||||
@@ -341,8 +341,8 @@ feature "User managing medical releases" do
|
||||
|
||||
private
|
||||
|
||||
def download_button
|
||||
'Download'
|
||||
def download_all_button
|
||||
'Download All'
|
||||
end
|
||||
|
||||
def download_action
|
||||
|
||||
@@ -62,12 +62,12 @@ feature "User managing misc releases" do
|
||||
sign_in current_user
|
||||
end
|
||||
|
||||
scenario "Download is visible" do
|
||||
scenario "Download All is visible" do
|
||||
create(:misc_release_with_contract_template, :native, project: project)
|
||||
|
||||
visit project_misc_releases_path(project)
|
||||
|
||||
expect(page).to have_content download_button
|
||||
expect(page).to have_content download_all_button
|
||||
end
|
||||
|
||||
scenario "Downloading PDF of native misc release is possible" do
|
||||
@@ -145,8 +145,8 @@ feature "User managing misc releases" do
|
||||
|
||||
private
|
||||
|
||||
def download_button
|
||||
'Download'
|
||||
def download_all_button
|
||||
'Download All'
|
||||
end
|
||||
|
||||
def view_release_pdf_link_for(release)
|
||||
|
||||
@@ -86,36 +86,34 @@ describe GenerateContractsZipJob do
|
||||
end
|
||||
|
||||
it "generates ZIP containing CSV file with all filtered releases data for filtered releases" do
|
||||
if subject.respond_to?(:complete) && subject.respond_to?(:incomplete)
|
||||
lowercase_plural = subject.constantize.model_name.plural
|
||||
GenerateContractsZipJob.perform_now(project, download, subject, [], '', 'complete')
|
||||
lowercase_plural = subject.constantize.model_name.plural
|
||||
GenerateContractsZipJob.perform_now(project, download, subject, [], '', 'complete')
|
||||
|
||||
complete_releases = project.public_send(lowercase_plural).complete
|
||||
incomplete_releases = project.public_send(lowercase_plural).incomplete
|
||||
complete_releases = project.public_send(lowercase_plural).complete
|
||||
incomplete_releases = project.public_send(lowercase_plural).incomplete
|
||||
|
||||
generated_zip = download.file.blob.download
|
||||
csv_file_name = "#{project.name.parameterize}_#{lowercase_plural.gsub('_', '-')}.csv"
|
||||
Zip::InputStream.open(StringIO.new(generated_zip)) do |io|
|
||||
while entry = io.get_next_entry
|
||||
next unless entry.name == csv_file_name
|
||||
generated_zip = download.file.blob.download
|
||||
csv_file_name = "#{project.name.parameterize}_#{lowercase_plural.gsub('_', '-')}.csv"
|
||||
Zip::InputStream.open(StringIO.new(generated_zip)) do |io|
|
||||
while entry = io.get_next_entry
|
||||
next unless entry.name == csv_file_name
|
||||
|
||||
csv_file = entry.get_input_stream.read
|
||||
csv_file = entry.get_input_stream.read
|
||||
|
||||
release_class = Object.const_get subject
|
||||
release_headers = release_class.csv_headers
|
||||
release_class = Object.const_get subject
|
||||
release_headers = release_class.csv_headers
|
||||
|
||||
release_headers.each do |header|
|
||||
expect(csv_file).to match header
|
||||
expect(csv_file).not_to match translation_missing
|
||||
end
|
||||
release_headers.each do |header|
|
||||
expect(csv_file).to match header
|
||||
expect(csv_file).not_to match translation_missing
|
||||
end
|
||||
|
||||
complete_releases.each do |release|
|
||||
expect(csv_file).to match release.person_first_name
|
||||
end
|
||||
complete_releases.each do |release|
|
||||
expect(csv_file).to match release.person_first_name
|
||||
end
|
||||
|
||||
incomplete_releases.each do |release|
|
||||
expect(csv_file).not_to match release.person_first_name
|
||||
end
|
||||
incomplete_releases.each do |release|
|
||||
expect(csv_file).not_to match release.person_first_name
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -166,19 +164,16 @@ describe GenerateContractsZipJob do
|
||||
end
|
||||
|
||||
context "generates ZIP for acquired media releases" do
|
||||
let(:release) { create(:acquired_media_release_with_contract_template, :native, project: project, name: "John Doe") }
|
||||
let(:release2) { create(:acquired_media_release_with_contract_template, :native, project: project, name: "Jane Doe") }
|
||||
let(:release3) { create(:acquired_media_release_with_contract_template, :native, project: project, name: "Brad Doe") }
|
||||
let(:release) { create(:acquired_media_release_with_contract_template, :native, project: project) }
|
||||
subject { 'AcquiredMediaRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for appearance releases" do
|
||||
let(:release) { create(:appearance_release_with_contract_template, :native, project: project, person_name: "John") }
|
||||
let(:incomplete_release) { create(:appearance_release_with_contract_template, project: project, person_name: "Jane") }
|
||||
let(:complete_release) { create(:appearance_release_with_contract_template, :non_native, project: project, person_name: "Brad") }
|
||||
let(:release) { create(:appearance_release_with_contract_template, :native, project: project, person_name: "John Doe") }
|
||||
let(:incomplete_release) { create(:appearance_release_with_contract_template, project: project, person_name: "Jane Doe") }
|
||||
let(:complete_release) { create(:appearance_release_with_contract_template, :non_native, project: project, person_name: "Brad Doe") }
|
||||
subject { 'AppearanceRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
@@ -186,63 +181,45 @@ describe GenerateContractsZipJob do
|
||||
end
|
||||
|
||||
context "generates ZIP for location releases" do
|
||||
let(:release) { create(:location_release_with_contract_template, :native, project: project, name: "John") }
|
||||
let(:release2) { create(:location_release_with_contract_template, :native, project: project, name: "Jane") }
|
||||
let(:release3) { create(:location_release_with_contract_template, :native, project: project, name: "Brad") }
|
||||
let(:release) { create(:location_release_with_contract_template, :native, project: project) }
|
||||
subject { 'LocationRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for material releases" do
|
||||
let(:release) { create(:material_release_with_contract_template, :native, project: project, name: "John") }
|
||||
let(:release2) { create(:material_release_with_contract_template, :native, project: project, name: "Jane") }
|
||||
let(:release3) { create(:material_release_with_contract_template, :native, project: project, name: "Brad") }
|
||||
let(:release) { create(:material_release_with_contract_template, :native, project: project) }
|
||||
subject { 'MaterialRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for medical releases" do
|
||||
let(:release) { create(:medical_release_with_contract_template, :native, project: project, person_name: "John Doe") }
|
||||
let(:release2) { create(:medical_release_with_contract_template, :native, project: project, person_name: "Jane Doe") }
|
||||
let(:release3) { create(:medical_release_with_contract_template, :native, project: project, person_name: "Brad Doe") }
|
||||
let(:release) { create(:medical_release_with_contract_template, :native, project: project) }
|
||||
subject { 'MedicalRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for misc releases" do
|
||||
let(:release) { create(:misc_release_with_contract_template, :native, project: project, person_name: "John Doe") }
|
||||
let(:release2) { create(:misc_release_with_contract_template, :native, project: project, person_name: "Jane Doe") }
|
||||
let(:release3) { create(:misc_release_with_contract_template, :native, project: project, person_name: "Brad Doe") }
|
||||
let(:release) { create(:misc_release_with_contract_template, :native, project: project) }
|
||||
subject { 'MiscRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for music releases" do
|
||||
let(:release) { create(:music_release_with_contract_template, project: project, name: "John") }
|
||||
let(:release2) { create(:music_release_with_contract_template, project: project, name: "Jane") }
|
||||
let(:release3) { create(:music_release_with_contract_template, project: project, name: "Brad") }
|
||||
let(:release) { create(:music_release_with_contract_template, project: project) }
|
||||
subject { 'MusicRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "generates ZIP for talent releases" do
|
||||
let(:release) { create(:talent_release_with_contract_template, :native, project: project, person_name: "John Doe") }
|
||||
let(:release2) { create(:talent_release_with_contract_template, :native, project: project, person_name: "Jane Doe") }
|
||||
let(:release3) { create(:talent_release_with_contract_template, :native, project: project, person_name: "Brad Doe") }
|
||||
let(:release) { create(:talent_release_with_contract_template, :native, project: project) }
|
||||
subject { 'TalentRelease' }
|
||||
|
||||
it_behaves_like "generates ZIP containig CSV file with all releases data"
|
||||
it_behaves_like "generates ZIP containig CSV file with specific releases data"
|
||||
end
|
||||
|
||||
context "When there are errors" do
|
||||
|
||||
Reference in New Issue
Block a user