* fix for recording landing page not working, and fix for sort order enforced for jamfest

This commit is contained in:
Seth Call 2014-03-11 15:50:08 +00:00
parent 164a4fdbe1
commit a5a083a4e8
7 changed files with 35 additions and 3 deletions

View File

@ -133,4 +133,5 @@ plays_refactor.sql
fix_max_mind_isp_and_geo.sql
update_get_work_for_client_type.sql
events.sql
cascading_delete_constraints_for_release.sql

View File

@ -0,0 +1,15 @@
-- allow a user to be readily deleted by adding cascades
ALTER TABLE music_sessions_user_history DROP CONSTRAINT music_sessions_user_history_user_id_fkey;
ALTER TABLE ONLY music_sessions_user_history ADD CONSTRAINT music_sessions_user_history_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE crash_dumps DROP CONSTRAINT crash_dumps_user_id_fkey;
ALTER TABLE ONLY crash_dumps ADD CONSTRAINT crash_dumps_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE music_sessions_history DROP CONSTRAINT music_sessions_history_user_id_fkey;
ALTER TABLE music_sessions_history ADD CONSTRAINT music_sessions_history_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE music_sessions_user_history DROP CONSTRAINT "music_sessions_user_history_music_session_id_fkey";
ALTER TABLE music_sessions_user_history ADD CONSTRAINT "music_sessions_user_history_music_session_id_fkey" FOREIGN KEY (music_session_id) REFERENCES music_sessions_history(music_session_id) ON DELETE CASCADE;
ALTER TABLE "recordings" DROP CONSTRAINT "recordings_creator_id_fkey";
ALTER TABLE "recordings" ADD CONSTRAINT "recordings_creator_id_fkey" FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;

View File

@ -153,7 +153,7 @@
context.JK.bindHoverEvents = function ($parent) {
if($parent) {
if(!$parent) {
$parent = $('body');
}

View File

@ -1,5 +1,5 @@
%hr{ class:'w60' }
.landing-band.event
.landing-band.event{'data-event-session' => event_session.id}
= event_session_img(event_session)
%br
%br

View File

@ -8,7 +8,7 @@
%h2 ARTIST LINEUP
%br
= render :partial => "event_session", :collection => @event.event_sessions
= render :partial => "event_session", :collection => @event.event_sessions.order('starts_at')
%br{clear:'all'}

View File

@ -115,6 +115,7 @@
$(function () {
var showRecording = new JK.ShowRecording(JK.app);
showRecording.initialize("<%= @claimed_recording.id %>", "<%= @claimed_recording.recording_id %>");
});
</script>
<% end %>

View File

@ -110,5 +110,20 @@ describe "Events", :js => true, :type => :feature, :capybara_feature => true, :s
find('.sessions-page .landing-band', text: band.name) # indication of session landing page
find(".recording-controls[data-music-session=\"#{music_session_history.id}\"]")
# test that it sorts correctly by putting this earlier event first
@event_session2 = FactoryGirl.create(:event_session, event: @event)
@event_session2.starts_at = 4.hours.ago
@event_session2.save!
visit "/events/so_latency"
expect(page).to have_css(".landing-band.event[data-event-session=\"#{@event_session2.id}\"]")
# test that it sorts correctly by putting this later event second
@event_session2.starts_at = 4.hours.from_now
@event_session2.save!
visit "/events/so_latency"
expect(page).to have_css(".landing-band.event[data-event-session=\"#{@event_session.id}\"]")
end
end