Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Seth Call 2014-07-21 16:42:36 -05:00
commit 57728fbfe8
10 changed files with 39 additions and 33 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}
}

View File

@ -503,10 +503,6 @@
}
function changeToScreen(screen, data) {
if (screen === currentScreen) {
return;
}
changeScreen(screen, data);
}

View File

@ -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 {

View File

@ -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

View File

@ -59,6 +59,7 @@
</div>
<span class="btn-next-wrapper"><a href="/api/sessions/active?page=1" class="btn-next">Next</a></span>
</div>
<br />
<div id="sessions-scheduled" class="session-container">
<%= render :partial => "sessionList", :locals => {:title => "future, scheduled sessions", :category => "sessions-scheduled"} %>
<br />

View File

@ -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:
<a href="http://www.jamkazam.com/session-legal-policies/standard" target="_blank">www.jamkazam.com/session-legal-policies/standard</a>.
<a href="<%= root_url %>session-legal-policies/standard" target="_blank"><%= root_url %>session-legal-policies/standard</a>.
</div>
<div class="info-box hidden" policy-type="Creative Commons">
This is a good option to choose when the session participants are creating new music that is not
already copyrighted, and when the musicians can agree that everyone will share ownership of any
music created in the session. Use the following link for full legal details of this choice:
<a href="http://www.jamkazam.com/session-legal-policies/creativecommons" target="_blank">www.jamkazam.com/session-legal-policies/creativecommons</a>
<a href="<%= root_url %>session-legal-policies/creativecommons" target="_blank"><%= root_url %>session-legal-policies/creativecommons</a>
</div>
<div class="info-box hidden" policy-type="Offline">
This is a good option to choose when the session participants are already made an offline agreement
in the real world about who owns what, and when agreeing to the standard legal provisions doest not
adequately or accurately cover your legal bases. Use the following link for full legal details of this choice:
<a href="http://www.jamkazam.com/session-legal-policies/offline" target="_blank">www.jamkazam.com/session-legal-policies/offline</a>
<a href="<%= root_url %>session-legal-policies/offline" target="_blank"><%= root_url %>session-legal-policies/offline</a>
</div>
<div class="info-box hidden" policy-type="Jamtracks">
This option must be selected when the musicians in a session will be playing one or more JamTracks.
Use the following link for full legal details of this choice:
<a href="http://www.jamkazam.com/session-legal-policies/jamtracks" target="_blank">www.jamkazam.com/session-legal-policies/jamtracks</a>
<a href="<%= root_url %>session-legal-policies/jamtracks" target="_blank"><%= root_url %>session-legal-policies/jamtracks</a>
</div>
</div>
<br>

View File

@ -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: