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 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/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/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); } } diff --git a/web/app/assets/javascripts/layout.js b/web/app/assets/javascripts/layout.js index 43aaf0d7b..401b6ede8 100644 --- a/web/app/assets/javascripts/layout.js +++ b/web/app/assets/javascripts/layout.js @@ -503,10 +503,6 @@ } function changeToScreen(screen, data) { - if (screen === currentScreen) { - return; - } - changeScreen(screen, data); } 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/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 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"} %>
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: