Compare commits
4 Commits
improve-do
...
update-bro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79174d8f3b | ||
|
|
aa6c851807 | ||
|
|
ab0b6f2c7d | ||
|
|
3db230de9b |
@@ -1,4 +1,7 @@
|
||||
$(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
clearPlayingHighlight();
|
||||
$(this).parent().parent().addClass('playing-highlight');
|
||||
|
||||
$("#broadcast_video").data('videoType', 'recording');
|
||||
|
||||
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");
|
||||
}
|
||||
@@ -1,4 +1,30 @@
|
||||
// Do not allow file attachments in rich text content
|
||||
addEventListener("trix-file-accept", function(event) {
|
||||
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);
|
||||
});
|
||||
@@ -461,3 +461,37 @@ a[data-behavior=seekable-timecode] {
|
||||
border-color: transparent;
|
||||
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: rgba(182, 203, 205, 1);
|
||||
}
|
||||
@@ -48,6 +48,10 @@ u {
|
||||
margin-right: -30px;
|
||||
}
|
||||
|
||||
.embed-person-photo {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.do-not-copy-warning {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ class ContractsController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.pdf { send_contract_pdf }
|
||||
|
||||
if Rails.env.development?
|
||||
if Rails.env.development? || Rails.env.test?
|
||||
format.html { render_sample_html }
|
||||
end
|
||||
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 %>);
|
||||
@@ -1,26 +1,30 @@
|
||||
<% if recordings.present? %>
|
||||
<div class="list-group">
|
||||
<ul class="list-unstyled">
|
||||
<% recordings.each do |recording| %>
|
||||
<div class="list-group-item list-group-item-action">
|
||||
<div class="d-flex align-items-start">
|
||||
<% 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-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) }) %>
|
||||
<div class="ml-auto">
|
||||
<% if 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") %>
|
||||
</div>
|
||||
<li class="media pb-1 pt-1 pr-1">
|
||||
<% 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-3", remote: true %>
|
||||
<% end %>
|
||||
|
||||
<div class="play-thumbnail">
|
||||
<%= image_tag(recording.thumbnail_url, class: 'mr-3', size: "75x64") %>
|
||||
<%= render "broadcasts/play_button", playback_url: recording.playback_url, data_id: dom_id(recording) %>
|
||||
</div>
|
||||
<div class="d-flex flex-column align-items-start justify-content-start p-4">
|
||||
<h5><%= recording.name %></h5>
|
||||
<p><%= recording.description %></p>
|
||||
|
||||
<div class="media-body">
|
||||
<h5 class="mt-0 mb-1"><%= recording.name %></h5>
|
||||
<%= recording.description %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if policy(BroadcastRecording).edit? %>
|
||||
<%= link_to fa_icon('edit'), [:edit, broadcast.project, broadcast, recording], class: "mr-3", remote: true %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to(fa_icon('download'), recording.download_url, target: "_blank") %>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</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>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<div class="list-group">
|
||||
<div class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between mb-1">
|
||||
<h5 class="mb-1"><%= broadcast.name %></h5>
|
||||
<small>Created - <%= time_ago_in_words(broadcast.created_at) + " ago" %></small>
|
||||
</div>
|
||||
<div id="live-take" class="media p-1 playing-highlight">
|
||||
<img class="mr-5 ml-1 mt-1" src="https://via.placeholder.com/64" alt="Live stream thumbnail">
|
||||
<div class="media-body">
|
||||
<h5 class="mt-0"><%= broadcast.name %></h5>
|
||||
<small>Created - <%= time_ago_in_words(broadcast.created_at) + " ago" %></small>
|
||||
<div id="broadcast_updates">
|
||||
<%= render partial: 'broadcasts/broadcast_status', locals: { broadcast: broadcast } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
5
app/views/broadcasts/_play_button.html.erb
Normal file
5
app/views/broadcasts/_play_button.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="play-btn" data-behavior="play_recording" data-playback-url="<%= playback_url %>" data-id="<%= data_id %>">
|
||||
<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>
|
||||
</div>
|
||||
@@ -4,19 +4,31 @@
|
||||
</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 %>
|
||||
|
||||
<% if releasable.respond_to?(:question_1_answer) %>
|
||||
<div class="page">
|
||||
<% if preview %>
|
||||
<h1>PREVIEW ONLY</h1>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.model_name == "AppearanceRelease" && releasable.person_photo.attached? %>
|
||||
<div class="embed-person-photo">
|
||||
<%= image_tag releasable.photos.first.variant(auto_orient: true, resize: "200x200"), id: "top-person-photo" %>
|
||||
</div>
|
||||
<hr>
|
||||
<% 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 %>
|
||||
</div>
|
||||
|
||||
<% if contract_template.present? && contract_template.has_questionnaire? %>
|
||||
<div class="page">
|
||||
<%= render "contracts/questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||
</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,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 %>);
|
||||
@@ -19,6 +19,22 @@ FactoryBot.define do
|
||||
amendment_clause "Amendment Legal Language"
|
||||
end
|
||||
|
||||
trait :with_questionnaire_legal_text do
|
||||
questionnaire_legal_text "Questionnaire Legal Text"
|
||||
end
|
||||
|
||||
trait :with_one_question do
|
||||
question_1_text "Is this a question?"
|
||||
end
|
||||
|
||||
trait :with_exhibits do
|
||||
exhibit_a_legal_text "Exhibit A legal text"
|
||||
exhibit_b_legal_text "Exhibit B legal text"
|
||||
|
||||
exhibit_a_question_text "Exhibit A question text"
|
||||
exhibit_b_question_text "Exhibit B question text"
|
||||
end
|
||||
|
||||
factory :appearance_release_contract_template do
|
||||
release_type "appearance"
|
||||
end
|
||||
|
||||
@@ -386,6 +386,13 @@ RSpec.feature 'User manages contract templates', type: :feature do
|
||||
expect(ct.signature_legal_text.id).not_to eq ContractTemplate.last.signature_legal_text.id
|
||||
end
|
||||
|
||||
scenario 'trix editor has underline button', js: true do
|
||||
visit new_project_contract_template_path(project)
|
||||
|
||||
select 'Appearance Release', from: 'Release type'
|
||||
expect(page).to have_selector("button[data-trix-attribute='underline']")
|
||||
end
|
||||
|
||||
context 'When the user is associate' do
|
||||
let(:current_user) { create(:user, :associate) }
|
||||
|
||||
|
||||
@@ -544,7 +544,7 @@ feature 'User managing appearance releases' do
|
||||
expect(pdf_body).to have_content('Guardian Email')
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF when exhibit A is signed" do
|
||||
scenario "viewing the contract PDF when exhibit A is signed and without questionnaire" do
|
||||
contract_template = create(:appearance_release_contract_template, project: project, exhibit_a_legal_text: "Exhibit A legal text", exhibit_a_question_text: "Exhibit A question text")
|
||||
appearance_release = create(:appearance_release,
|
||||
:amendment_signed,
|
||||
@@ -566,10 +566,122 @@ feature 'User managing appearance releases' do
|
||||
|
||||
expect(pdf_body).to have_content("John Doe")
|
||||
|
||||
expect(pdf_body).to have_content "Exhibit A"
|
||||
expect(pdf_body).to have_content exhibit_a_heading
|
||||
expect(pdf_body).to have_content "Exhibit A legal text"
|
||||
expect(pdf_body).to have_content "Exhibit A question text"
|
||||
expect(pdf_body).to have_content "Answer to exhibit A question"
|
||||
|
||||
expect(pdf_body).not_to have_content questionnaire_heading
|
||||
expect(pdf_body).not_to have_content exhibit_b_heading
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF when exhibit B is signed and without questionnaire" do
|
||||
contract_template = create(:appearance_release_contract_template, project: project, exhibit_b_legal_text: "Exhibit B legal text", exhibit_b_question_text: "Exhibit B question text")
|
||||
appearance_release = create(:appearance_release,
|
||||
:amendment_signed,
|
||||
:native,
|
||||
contract_template: contract_template,
|
||||
project: project,
|
||||
person_first_name: "John",
|
||||
person_last_name: "Doe",
|
||||
exhibit_b_answer: "Answer to exhibit B question"
|
||||
)
|
||||
|
||||
sign_in(current_user)
|
||||
visit project_appearance_releases_path(project)
|
||||
click_link *view_release_pdf_link_for(appearance_release)
|
||||
|
||||
expect(content_type).to eq("application/pdf")
|
||||
expect(content_disposition).to include("inline")
|
||||
expect(pdf_filename).to include("doe-john")
|
||||
|
||||
expect(pdf_body).to have_content("John Doe")
|
||||
|
||||
expect(pdf_body).to have_content exhibit_b_heading
|
||||
expect(pdf_body).to have_content "Exhibit B legal text"
|
||||
expect(pdf_body).to have_content "Exhibit B question text"
|
||||
expect(pdf_body).to have_content "Answer to exhibit B question"
|
||||
|
||||
expect(pdf_body).not_to have_content questionnaire_heading
|
||||
expect(pdf_body).not_to have_content exhibit_a_heading
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF with questionnaire and without exhibits" do
|
||||
contract_template = create(:appearance_release_contract_template, :with_questionnaire_legal_text, :with_one_question, project: project)
|
||||
appearance_release = create(:appearance_release,
|
||||
:amendment_signed,
|
||||
:native,
|
||||
contract_template: contract_template,
|
||||
project: project,
|
||||
person_first_name: "John",
|
||||
person_last_name: "Doe",
|
||||
question_1_answer: "Yes"
|
||||
)
|
||||
|
||||
sign_in(current_user)
|
||||
visit project_appearance_releases_path(project)
|
||||
click_link *view_release_pdf_link_for(appearance_release)
|
||||
|
||||
expect(content_type).to eq("application/pdf")
|
||||
expect(content_disposition).to include("inline")
|
||||
expect(pdf_filename).to include("doe-john")
|
||||
|
||||
expect(pdf_body).to have_content questionnaire_heading
|
||||
expect(pdf_body).to have_content contract_template.question_1_text
|
||||
expect(pdf_body).to have_content appearance_release.question_1_answer
|
||||
|
||||
expect(pdf_body).not_to have_content exhibit_a_heading
|
||||
expect(pdf_body).not_to have_content exhibit_b_heading
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF with questionnaire and with exhibits" do
|
||||
contract_template = create(:appearance_release_contract_template,
|
||||
:with_questionnaire_legal_text,
|
||||
:with_one_question,
|
||||
:with_exhibits,
|
||||
project: project)
|
||||
appearance_release = create(:appearance_release,
|
||||
:amendment_signed,
|
||||
:native,
|
||||
contract_template: contract_template,
|
||||
project: project,
|
||||
person_first_name: "John",
|
||||
person_last_name: "Doe",
|
||||
question_1_answer: "Yes",
|
||||
exhibit_a_answer: "Exhibit A answer",
|
||||
exhibit_b_answer: "Exhibit B answer"
|
||||
)
|
||||
|
||||
sign_in(current_user)
|
||||
visit project_appearance_releases_path(project)
|
||||
click_link *view_release_pdf_link_for(appearance_release)
|
||||
|
||||
expect(content_type).to eq("application/pdf")
|
||||
expect(content_disposition).to include("inline")
|
||||
expect(pdf_filename).to include("doe-john")
|
||||
|
||||
expect(pdf_body).to have_content questionnaire_heading
|
||||
expect(pdf_body).to have_content contract_template.question_1_text
|
||||
expect(pdf_body).to have_content appearance_release.question_1_answer
|
||||
|
||||
expect(pdf_body).to have_content exhibit_a_heading
|
||||
expect(pdf_body).to have_content contract_template.exhibit_a_legal_text.to_plain_text
|
||||
expect(pdf_body).to have_content contract_template.exhibit_a_question_text
|
||||
expect(pdf_body).to have_content appearance_release.exhibit_a_answer
|
||||
|
||||
expect(pdf_body).to have_content exhibit_b_heading
|
||||
expect(pdf_body).to have_content contract_template.exhibit_b_legal_text.to_plain_text
|
||||
expect(pdf_body).to have_content contract_template.exhibit_b_question_text
|
||||
expect(pdf_body).to have_content appearance_release.exhibit_b_answer
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF - it shows person photo on first page if person photo is attached" do
|
||||
appearance_release = create(:appearance_release_with_contract_template, :native, :minor_with_guardian_photo, project: project)
|
||||
|
||||
visit view_release_pdf_html_preview_link_for(appearance_release)
|
||||
|
||||
person_photo_url = url_for(appearance_release.person_photo.variant(auto_orient: true, resize: "200x200")).to_s
|
||||
expect(page).to have_selector("#top-person-photo[src^='#{person_photo_url}']")
|
||||
end
|
||||
|
||||
scenario 'deleting a release', js: true do
|
||||
@@ -908,6 +1020,10 @@ feature 'User managing appearance releases' do
|
||||
['Download', href: appearance_release_contracts_path(appearance_release, format: 'pdf')]
|
||||
end
|
||||
|
||||
def view_release_pdf_html_preview_link_for(appearance_release)
|
||||
appearance_release_contracts_path(appearance_release)
|
||||
end
|
||||
|
||||
def successful_submission_message
|
||||
'Your release was successfully submitted. Thank you.'
|
||||
end
|
||||
@@ -987,4 +1103,16 @@ feature 'User managing appearance releases' do
|
||||
def amendment_signature_label
|
||||
t 'contracts.amendment_page.description_labels.amendment_signature'
|
||||
end
|
||||
|
||||
def questionnaire_heading
|
||||
t 'contracts.questionnaire.heading.appearance_release'
|
||||
end
|
||||
|
||||
def exhibit_a_heading
|
||||
t 'contracts.exhibit_a_page.heading.appearance_release'
|
||||
end
|
||||
|
||||
def exhibit_b_heading
|
||||
t 'contracts.exhibit_b_page.heading.appearance_release'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -151,6 +151,41 @@ feature 'User managing broadcasts' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'broadcast recordings are shown in correct layout', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_selector("li.media")
|
||||
expect(page).to have_selector("div.play-thumbnail")
|
||||
expect(page).to have_selector("div.media-body")
|
||||
expect(page).to have_selector("div.play-btn")
|
||||
end
|
||||
|
||||
scenario 'active playing media has highlighted background (live take or recording)', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_2")
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector(".play-btn-svg", count: 2, visible: false)
|
||||
|
||||
first("[data-behavior='play_recording']").click
|
||||
|
||||
expect(page).not_to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector("li.media.playing-highlight", count: 1)
|
||||
expect(page).to have_selector("li.media", count: 2)
|
||||
|
||||
first("[data-behavior='play_stream']").click
|
||||
|
||||
expect(page).to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector("li.media", count: 2)
|
||||
expect(page).not_to have_selector("li.media.playing-highlight")
|
||||
end
|
||||
|
||||
context 'When the user is associate' do
|
||||
let(:current_user) { create(:user, :associate) }
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -244,11 +244,32 @@ feature "User managing medical releases" do
|
||||
expect(pdf_filename).to include("doe-john")
|
||||
|
||||
expect(pdf_body).to have_content("John Doe")
|
||||
expect(pdf_body).to have_content "MEDICAL QUESTIONNAIRE"
|
||||
expect(pdf_body).to have_content questionnaire_heading.upcase
|
||||
expect(pdf_body).to have_content "Question 1 text"
|
||||
expect(pdf_body).to have_content "Question 1 answer"
|
||||
expect(pdf_body).to have_content "Questionnaire legal text"
|
||||
end
|
||||
|
||||
scenario 'viewing contract PDF without medical questionnaire' do
|
||||
contract_template = create(:medical_release_contract_template, project: project)
|
||||
medical_release = create(:medical_release,
|
||||
:native,
|
||||
contract_template: contract_template,
|
||||
project: project,
|
||||
person_first_name: "John",
|
||||
person_last_name: "Doe",
|
||||
)
|
||||
|
||||
sign_in(current_user)
|
||||
visit project_medical_releases_path(project)
|
||||
click_link *view_release_pdf_link_for(medical_release)
|
||||
|
||||
expect(content_type).to eq("application/pdf")
|
||||
expect(content_disposition).to include("inline")
|
||||
expect(pdf_filename).to include("doe-john")
|
||||
|
||||
expect(pdf_body).not_to have_content questionnaire_heading.upcase
|
||||
end
|
||||
end
|
||||
|
||||
context "when the user is manager(project manager)" do
|
||||
@@ -264,7 +285,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 +329,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 +362,8 @@ feature "User managing medical releases" do
|
||||
|
||||
private
|
||||
|
||||
def download_button
|
||||
'Download'
|
||||
def download_all_button
|
||||
'Download All'
|
||||
end
|
||||
|
||||
def download_action
|
||||
@@ -499,4 +520,8 @@ feature "User managing medical releases" do
|
||||
def dummy_signature_legal_text
|
||||
'Some signature legal language'
|
||||
end
|
||||
|
||||
def questionnaire_heading
|
||||
t 'contracts.questionnaire.heading.medical_release'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
@@ -80,7 +80,7 @@ feature "User managing misc releases" do
|
||||
end
|
||||
|
||||
|
||||
scenario 'viewing the contract PDF' do
|
||||
scenario 'viewing the contract PDF with questionnaire' do
|
||||
misc_release = create(:misc_release,
|
||||
:native,
|
||||
contract_template: build(:misc_release_contract_template, question_1_text: 'Q1'),
|
||||
@@ -121,10 +121,30 @@ feature "User managing misc releases" do
|
||||
expect(pdf_body).to have_content('Woman')
|
||||
expect(pdf_body).to have_content('Brunette')
|
||||
expect(pdf_body).not_to have_content('Guardian Email')
|
||||
expect(pdf_body).to have_content('QUESTIONNAIRE')
|
||||
expect(pdf_body).to have_content questionnaire_heading.upcase
|
||||
expect(pdf_body).to have_content('Q1')
|
||||
expect(pdf_body).to have_content('A1')
|
||||
end
|
||||
|
||||
scenario 'viewing the contract PDF without questionnaire' do
|
||||
misc_release = create(:misc_release,
|
||||
:native,
|
||||
contract_template: build(:misc_release_contract_template),
|
||||
project: project,
|
||||
person_first_name: 'Jane',
|
||||
person_last_name: 'Doe'
|
||||
)
|
||||
|
||||
sign_in(current_user)
|
||||
visit project_misc_releases_path(project)
|
||||
click_link *view_release_pdf_link_for(misc_release)
|
||||
|
||||
expect(content_type).to eq('application/pdf')
|
||||
expect(content_disposition).to include('inline')
|
||||
expect(pdf_filename).to include('doe-jane')
|
||||
|
||||
expect(pdf_body).not_to have_content questionnaire_heading.upcase
|
||||
end
|
||||
end
|
||||
|
||||
context "when the user is manager(project manager)" do
|
||||
@@ -145,8 +165,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)
|
||||
@@ -215,4 +235,8 @@ feature "User managing misc releases" do
|
||||
def view_release_pdf_link_for(release)
|
||||
['Download', href: misc_release_contracts_path(release, format: 'pdf')]
|
||||
end
|
||||
|
||||
def questionnaire_heading
|
||||
t 'contracts.questionnaire.heading.misc_release'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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