From c8162f55caa5c2940f3cec7b0a0d3adf77135405 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 21 Jul 2014 00:33:20 -0400 Subject: [PATCH 1/7] VRFS-1916 minor changes --- web/app/assets/stylesheets/client/sessionList.css.scss | 4 ++-- web/app/views/clients/_findSession.html.erb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/assets/stylesheets/client/sessionList.css.scss b/web/app/assets/stylesheets/client/sessionList.css.scss index cf2779392..902a86d47 100644 --- a/web/app/assets/stylesheets/client/sessionList.css.scss +++ b/web/app/assets/stylesheets/client/sessionList.css.scss @@ -1,8 +1,8 @@ @import "client/common"; div.findsession-scroll-container { - height:200px; - overflow-y:auto; + max-height:250px; + overflow:auto; } table.findsession-table, table.local-recordings { diff --git a/web/app/views/clients/_findSession.html.erb b/web/app/views/clients/_findSession.html.erb index 6749254f1..64dc87d8e 100644 --- a/web/app/views/clients/_findSession.html.erb +++ b/web/app/views/clients/_findSession.html.erb @@ -59,6 +59,7 @@ Next +
<%= render :partial => "sessionList", :locals => {:title => "future, scheduled sessions", :category => "sessions-scheduled"} %>
From 4aa359fc13a392cfc3d036ab401fce633effb24e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 21 Jul 2014 01:05:07 -0400 Subject: [PATCH 2/7] VRFS-1921 legal policy links are now specific to environment, fixed bug with legal policy link on Session Info page --- ruby/lib/jam_ruby/models/music_session.rb | 10 +++++----- web/app/views/clients/_scheduledSession.html.erb | 8 ++++---- web/app/views/music_sessions/session_info.html.haml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session.rb b/ruby/lib/jam_ruby/models/music_session.rb index 8a9eca4c4..c5dfb2c68 100644 --- a/ruby/lib/jam_ruby/models/music_session.rb +++ b/ruby/lib/jam_ruby/models/music_session.rb @@ -419,15 +419,15 @@ module JamRuby def legal_policy_url # TODO: move to DB or config file or helper - case legal_policy + case legal_policy.downcase when "standard" - return "http://www.jamkazam.com/session-legal-policies/standard" + return "session-legal-policies/standard" when "creative" - return "http://www.jamkazam.com/session-legal-policies/creativecommons" + return "session-legal-policies/creativecommons" when "offline" - return "http://www.jamkazam.com/session-legal-policies/offline" + return "session-legal-policies/offline" when "jamtracks" - return "http://www.jamkazam.com/session-legal-policies/jamtracks" + return "session-legal-policies/jamtracks" else return "" end diff --git a/web/app/views/clients/_scheduledSession.html.erb b/web/app/views/clients/_scheduledSession.html.erb index 629f5db9f..a55d8d0cb 100644 --- a/web/app/views/clients/_scheduledSession.html.erb +++ b/web/app/views/clients/_scheduledSession.html.erb @@ -300,24 +300,24 @@ This is a good option to choose when following normal legal conventions works - i.e. session participants agree that whoever holds the copyright on the music being performed maintains all ownership rights and interests in the music. Use the following link for full legal details of this choice: - www.jamkazam.com/session-legal-policies/standard. + <%= root_url %>session-legal-policies/standard.

diff --git a/web/app/views/music_sessions/session_info.html.haml b/web/app/views/music_sessions/session_info.html.haml index 85167838d..7d82077aa 100644 --- a/web/app/views/music_sessions/session_info.html.haml +++ b/web/app/views/music_sessions/session_info.html.haml @@ -59,7 +59,7 @@ .right.w75.ib.mb10.legal_policy = @music_session.legal_policy.capitalize agreement ( - %a.gold{:href => "#{@music_session.legal_policy_url}", :target => "_blank"} View full legal details + %a.gold{:href => "#{root_url}#{@music_session.legal_policy_url}", :target => "_blank"} View full legal details ) .clearall.left.w20.ib.mb10 %strong Fan Page: From 25cff163dc70befdc3d6d0f68b62ce473e8b46d1 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Mon, 21 Jul 2014 05:12:07 +0000 Subject: [PATCH 3/7] VRFS-1874 added query constraint to filter out users with last_jam_locidispid = NULL --- ruby/lib/jam_ruby/models/email_batch_scheduled_sessions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruby/lib/jam_ruby/models/email_batch_scheduled_sessions.rb b/ruby/lib/jam_ruby/models/email_batch_scheduled_sessions.rb index 8ef39a14c..012f7d8ee 100644 --- a/ruby/lib/jam_ruby/models/email_batch_scheduled_sessions.rb +++ b/ruby/lib/jam_ruby/models/email_batch_scheduled_sessions.rb @@ -30,6 +30,7 @@ LEFT JOIN rsvp_requests_rsvp_slots AS rrrs ON rrrs.rsvp_slot_id = rs.id WHERE musician_access = 't' AND approval_required = 'f' AND + users.last_jam_locidispid IS NOT NULL AND msess.created_at > '#{time_since_last_batch(SINCE_DAYS)}' AND msess.created_at < '#{self.created_at}' AND scheduled_start >= '#{Time.now() + MIN_HOURS_START.hours}' AND @@ -50,6 +51,7 @@ FROM users INNER JOIN musicians_instruments AS mi ON mi.user_id = users.id INNER JOIN #{TMP_SESS} ON #{TMP_SESS}.instrument_id = mi.instrument_id WHERE + users.last_jam_locidispid IS NOT NULL AND users.musician = 't' AND users.subscribe_email = 't' SQL @@ -96,7 +98,7 @@ SQL end end - def fetch_recipients(per_page=500) + def fetch_recipients(per_page=BATCH_SIZE) objs = [] # load eligible sessions into tmp table From b4ab41637c94b9104ae8b7579f117abce1054832 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Mon, 21 Jul 2014 05:14:05 +0000 Subject: [PATCH 4/7] VRFS-1629 added UserAuthorization.goog_auth method to exclude auths past expiration --- ruby/lib/jam_ruby/models/user_authorization.rb | 8 ++++++++ web/app/controllers/gmail_controller.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ruby/lib/jam_ruby/models/user_authorization.rb b/ruby/lib/jam_ruby/models/user_authorization.rb index e20fbaee4..fe1a3e5f5 100644 --- a/ruby/lib/jam_ruby/models/user_authorization.rb +++ b/ruby/lib/jam_ruby/models/user_authorization.rb @@ -12,5 +12,13 @@ module JamRuby validates_uniqueness_of :uid, scope: :provider # token, secret, token_expiration can be missing + def self.goog_auth(user) + self + .where(:user_id => user.id) + .where(:provider => 'google_login') + .where(['token_expiration IS NULL OR token_expiration > ?', Time.now]) + .limit(1) + end + end end diff --git a/web/app/controllers/gmail_controller.rb b/web/app/controllers/gmail_controller.rb index 516486364..e4f1e1906 100644 --- a/web/app/controllers/gmail_controller.rb +++ b/web/app/controllers/gmail_controller.rb @@ -6,7 +6,7 @@ class GmailController < ApplicationController render :nothing => true, :status => 404 return end - authorization = current_user.user_authorizations.where(:provider => 'google_login') + authorization = UserAuthorization.goog_auth(current_user) if authorization.empty? render :nothing => true, :status => 404 return From 08d8d86fc64ad817a88ae85c934272da1d0e3619 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 21 Jul 2014 01:36:57 -0400 Subject: [PATCH 5/7] VRFS-1635 auto-select the FB checkbox after successfully signing in to Facebook --- .../assets/javascripts/dialog/shareDialog.js | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/web/app/assets/javascripts/dialog/shareDialog.js b/web/app/assets/javascripts/dialog/shareDialog.js index 0d3fbcfda..44d031682 100644 --- a/web/app/assets/javascripts/dialog/shareDialog.js +++ b/web/app/assets/javascripts/dialog/shareDialog.js @@ -108,19 +108,18 @@ name: data.title, picture: data.photo_url, link: data.url + }).done(function(response) { + checkShareCheckbox('facebook', false); + defer.resolve(); + }) + .fail(function(response) { + app.notify({ + title : "Unable to Share with Facebook", + text : "Error: " + response, + "icon_url": "/assets/content/icon_alert_big.png" + }); + defer.reject(); }) - .done(function(response) { - checkShareCheckbox('facebook', false); - defer.resolve(); - }) - .fail(function(response) { - app.notify({ - title : "Unable to Share with Facebook", - text : "Error: " + response, - "icon_url": "/assets/content/icon_alert_big.png" - }); - defer.reject(); - }) } else { // user doesn't want to auth; this is a form of success @@ -220,8 +219,6 @@ var message = $(dialogId + ' .share-message').val(); if(!message) { message = undefined; } - - if(shareWithTwitter && !message) { $(dialogId + ' .share-message-holder').addClass('error') $(dialogId + ' .share-message-holder .error-msg').text("You must specify a message for Twitter."); @@ -307,10 +304,12 @@ function handleFbStateChange(response) { if (response && response.status == "connected") { - enableFacebook(); + enableFacebook(); + checkShareCheckbox('facebook', true); } else{ disableFacebook(); + checkShareCheckbox('facebook', false); } } From 1d96f1b98195ec7a723015658ab9afd86b6c3448 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 21 Jul 2014 01:53:20 -0400 Subject: [PATCH 6/7] VRFS-1608 remove check that bypasses call to changeScreen if the user is already on the screen with the same internal name --- web/app/assets/javascripts/layout.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/app/assets/javascripts/layout.js b/web/app/assets/javascripts/layout.js index 43aaf0d7b..698688a53 100644 --- a/web/app/assets/javascripts/layout.js +++ b/web/app/assets/javascripts/layout.js @@ -488,6 +488,8 @@ return postFunction(e); } + console.log("location=%o", location); + var screen = location.page.substring(1); // remove leading slash var accepted = screenEvent(currentScreen, 'beforeLeave', {screen:screen, hash: context.location.hash}); if(accepted === false) { @@ -503,10 +505,6 @@ } function changeToScreen(screen, data) { - if (screen === currentScreen) { - return; - } - changeScreen(screen, data); } From e22f3f32df7f29b16ba8e95a2dad46ce564ef3ee Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 21 Jul 2014 01:54:06 -0400 Subject: [PATCH 7/7] remove log statement --- web/app/assets/javascripts/layout.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/app/assets/javascripts/layout.js b/web/app/assets/javascripts/layout.js index 698688a53..401b6ede8 100644 --- a/web/app/assets/javascripts/layout.js +++ b/web/app/assets/javascripts/layout.js @@ -488,8 +488,6 @@ return postFunction(e); } - console.log("location=%o", location); - var screen = location.page.substring(1); // remove leading slash var accepted = screenEvent(currentScreen, 'beforeLeave', {screen:screen, hash: context.location.hash}); if(accepted === false) {