Compare commits
1 Commits
enable-goi
...
add-second
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d1320a76d |
24
app/assets/javascripts/play_previous_recordings.js
Normal file
24
app/assets/javascripts/play_previous_recordings.js
Normal file
@@ -0,0 +1,24 @@
|
||||
$(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
if ($(this).hasClass('active')){
|
||||
return false;
|
||||
}
|
||||
|
||||
var playback_url = $(this).attr("data-playback-url")
|
||||
$("#broadcast_video").empty();
|
||||
|
||||
new Clappr.Player({
|
||||
parentId: '#broadcast_video',
|
||||
source: playback_url,
|
||||
width: '100%',
|
||||
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>');
|
||||
});
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
$(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
if ($(this).hasClass('active')){
|
||||
return false;
|
||||
}
|
||||
|
||||
console.warn('Play prev : ', playback_url);
|
||||
|
||||
var playback_url = $(this).attr("data-playback-url")
|
||||
$("#broadcast_video").empty();
|
||||
|
||||
new Clappr.Player({
|
||||
<%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %>
|
||||
parentId: '#broadcast_video',
|
||||
source: playback_url,
|
||||
width: '100%',
|
||||
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>');
|
||||
});
|
||||
@@ -33,7 +33,7 @@
|
||||
<%= link_to "Switch View", "#", class: "btn btn-light border dropdown-toggle", role: "button", id: "dropdownMenuLink", data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } %>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<h5 class="dropdown-header">Live Streams</h5>
|
||||
<%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", class: "dropdown-item active" %>
|
||||
<span class="dropdown-item active"><%= fa_icon("check", text: @broadcast.name.titleize) %></span>
|
||||
<% @multi_view_broadcasts.each do |broadcast| %>
|
||||
<% if broadcast.id != @broadcast.id %>
|
||||
<%= link_to broadcast.name.titleize, broadcast.url, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
|
||||
@@ -159,4 +159,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||
|
||||
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
|
||||
<% if contract_template.public_send("question_#{n}_text").present? %>
|
||||
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
|
||||
<p><%= releasable.public_send("question_#{n}_answer") %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -39,6 +39,15 @@
|
||||
<% end %>
|
||||
</dl>
|
||||
|
||||
<% if releasable.model_name == "MedicalRelease" %>
|
||||
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
|
||||
<% if contract_template.public_send("question_#{n}_text").present? %>
|
||||
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
|
||||
<p><%= releasable.public_send("question_#{n}_answer") %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.minor? %>
|
||||
<br/>
|
||||
<p class="text-left"><strong>Guardian Information</strong></p>
|
||||
|
||||
@@ -15,13 +15,6 @@
|
||||
<p class="text-left"><strong>Guardian Clause</strong></p>
|
||||
<%= contract_template.guardian_clause %>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.model_name == "MedicalRelease" %>
|
||||
<div class="page">
|
||||
<%= render "contracts/medical_questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="page">
|
||||
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||
</div>
|
||||
|
||||
@@ -246,8 +246,6 @@ en:
|
||||
new:
|
||||
heading: New Release Template
|
||||
contracts:
|
||||
medical_questionnaire:
|
||||
heading: Medical Questionnaire
|
||||
photos:
|
||||
guardian_2_photo_heading: Second guardian photo
|
||||
guardian_photo_heading: Guardian photo
|
||||
|
||||
@@ -54,46 +54,6 @@ feature "User managing broadcasts" do
|
||||
expect(page).to have_content(recording.download_file_name)
|
||||
end
|
||||
|
||||
scenario "user can go back and forth between live session and previous sessions", js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_content broadcast.name.titleize, count: 1
|
||||
expect(page).to have_content recording.download_file_name, count: 0
|
||||
|
||||
click_on switch_view_dropdown
|
||||
expect(page).to have_content broadcast.name.titleize, count: 2
|
||||
expect(page).to have_content recording.download_file_name, count: 1
|
||||
|
||||
live_stream_nav_item = page.find(".dropdown-item", text: broadcast.name.titleize)
|
||||
recording_nav_item = page.find(".dropdown-item", text: recording.download_file_name)
|
||||
|
||||
expect(live_stream_nav_item[:class].include?("active")).to eq true
|
||||
expect(recording_nav_item[:class].include?("active")).to eq false
|
||||
|
||||
click_on recording.download_file_name
|
||||
|
||||
expect(page).to have_content broadcast.name.titleize, count: 1
|
||||
expect(page).to have_content recording.download_file_name, count: 0
|
||||
expect(live_stream_nav_item[:class].include?("active")).to eq false
|
||||
expect(recording_nav_item[:class].include?("active")).to eq true
|
||||
|
||||
click_on switch_view_dropdown
|
||||
click_on broadcast.name.titleize
|
||||
|
||||
expect(page).to have_content broadcast.name.titleize, count: 1
|
||||
expect(page).to have_content recording.download_file_name, count: 0
|
||||
|
||||
# Page is reloaded, we need to get dropdown items again
|
||||
live_stream_nav_item = page.find(".dropdown-item", text: broadcast.name.titleize, visible: :all)
|
||||
recording_nav_item = page.find(".dropdown-item", text: recording.download_file_name, visible: :all)
|
||||
|
||||
expect(live_stream_nav_item[:class].include?("active")).to eq true
|
||||
expect(recording_nav_item[:class].include?("active")).to eq false
|
||||
end
|
||||
|
||||
scenario "form will not submit if user clicks Add files without selected files", js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
|
||||
@@ -114,9 +74,9 @@ feature "User managing broadcasts" do
|
||||
|
||||
new_window = window_opened_by { click_link "Multi-View" }
|
||||
within_window new_window do
|
||||
expect(page).to have_content switch_view_dropdown
|
||||
expect(page).to have_content("Switch View")
|
||||
|
||||
click_on switch_view_dropdown
|
||||
click_on "Switch View"
|
||||
expect(page).to have_link("Broadcast 1")
|
||||
expect(page).to have_link("Broadcast 2")
|
||||
|
||||
@@ -146,8 +106,4 @@ feature "User managing broadcasts" do
|
||||
all('input[type="checkbox"]')[0].click
|
||||
all('input[type="checkbox"]')[1].click
|
||||
end
|
||||
|
||||
def switch_view_dropdown
|
||||
"Switch View"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user