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

This commit is contained in:
Seth Call 2014-07-03 16:27:00 -05:00
commit 2ceb50f7c2
6 changed files with 34 additions and 12 deletions

View File

@ -266,6 +266,7 @@ module JamRuby
ms.recurring_mode = options[:recurring_mode] if options[:recurring_mode]
ms.timezone = options[:timezone] if options[:timezone]
ms.legal_terms = true
ms.open_rsvps = options[:open_rsvps] if options[:open_rsvps]
ms.creator = user
ms.save
@ -478,7 +479,7 @@ module JamRuby
# retrieve users that have approved RSVPs
def approved_rsvps
users = User.find_by_sql(%Q{select u.id, u.photo_url, u.first_name, u.last_name, rs.instrument_id, ii.description, rs.proficiency_level
users = User.find_by_sql(%Q{select u.id, u.photo_url, u.first_name, u.last_name, rs.instrument_id, ii.description, rs.proficiency_level, rr.id as rsvp_request_id
from rsvp_slots rs
inner join rsvp_requests_rsvp_slots rrrs on rrrs.rsvp_slot_id = rs.id
inner join rsvp_requests rr on rrrs.rsvp_request_id = rr.id

View File

@ -19,7 +19,8 @@
recurring_mode: {},
language: {},
musician_access: {},
fans_access: {}
fans_access: {},
open_rsvps: false
};
var friendInput = null;
@ -225,20 +226,32 @@
$('#session-notations-disp').html('');
}
$('#session-language-disp').html(createSessionSettings.language.label);
var plusMusicians = $('#session-plus-musicians')[0].checked;
var sessionInvited = [];
var invitedFriends = inviteMusiciansUtil.getInvitedFriendNames();
$.each(invitedFriends, function(index, friend) {
sessionInvited.push(friend);
});
var sessionInvitedString = sessionInvited.join(', ');
if (createSessionSettings.musician_access.value == 'musicians-approval') {
if (invitedFriends.length == 0)
sessionInvitedString = "Any interested JamKazam musicians that I approve";
else
sessionInvitedString += ", plus any interested JamKazam musicians that I approve";
if (plusMusicians) {
if (invitedFriends.length == 0)
sessionInvitedString = "Any interested JamKazam musicians that I approve";
else
sessionInvitedString += ", plus any interested JamKazam musicians that I approve";
}
else {
if (invitedFriends.length == 0) {
sessionInvitedString = "No open RSVPs";
}
else {
sessionInvitedString += " (No open RSVPs)";
}
}
}
else if (createSessionSettings.musician_access.value == 'musicians') {
if (invitedFriends.length == 0)
@ -326,6 +339,7 @@
createSessionSettings.musician_access.label = session.musician_access_description;
createSessionSettings.fans_access.label = session.fan_access_description;
createSessionSettings.recurring_mode.value = session.recurring_mode;
createSessionSettings.open_rsvps = session.open_rsvps;
step = STEP_SELECT_CONFIRM;
moveToStep();
@ -374,6 +388,8 @@
createSessionSettings.timezone.label = $timezoneList.get(0).options[$timezoneList.get(0).selectedIndex].text;
createSessionSettings.recurring_mode.label = $recurringModeList.get(0).options[$recurringModeList.get(0).selectedIndex].text;
createSessionSettings.recurring_mode.value = $recurringModeList.val();
createSessionSettings.open_rsvps = $('#session-plus-musicians')[0].checked;
console.log("createSessionSettings.open_rsvps=%o", createSessionSettings.open_rsvps);
}
return true;
@ -461,6 +477,9 @@
function beforeMoveStep3() {
createSessionSettings.language.value = $languageList.val();
createSessionSettings.language.label = $languageList.get(0).options[$languageList.get(0).selectedIndex].text;
createSessionSettings.open_rsvps = $('#session-plus-musicians')[0].checked;
console.log("createSessionSettings.open_rsvps=%o", createSessionSettings.open_rsvps);
return true;
}
@ -566,6 +585,7 @@
data.recurring_mode = createSessionSettings.recurring_mode.value;
data.music_notations = createSessionSettings.music_notations;
data.timezone = createSessionSettings.timezone.value;
data.open_rsvps = createSessionSettings.open_rsvps;
data.rsvp_slots = [];
$.each(getCreatorInstruments(), function(index, instrument) {

View File

@ -194,8 +194,9 @@
var row = context.JK.fillTemplate($inactiveSessionTemplate.html(), sessionVals);
$(tbGroup).append(row);
var $parentRow = $('tr[id=' + session.id + ']', tbGroup);
if (showRsvpLink) {
$('.rsvp-msg', $parentRow).hide();
var $parentRow = $('tr[id=' + session.id + ']', tbGroup);
$('.rsvp-link', $parentRow).click(function(evt) {
ui.launchRsvpSubmitDialog(session.id);

View File

@ -209,6 +209,7 @@ class ApiMusicSessionsController < ApiController
@music_session.scheduled_duration = params[:duration] + ' minutes' if params[:duration]
@music_session.timezone = params[:timezone] unless params[:timezone].nil?
@music_session.recurring_mode = params[:reoccurrence] unless params[:reoccurrence].nil?
@music_session.open_rsvps = params[:open_rsvps] ? true : false
@music_session.band = band unless band.nil?
@music_session.save

View File

@ -201,7 +201,7 @@
</table>
</td>
<td class="noborder" style="text-align:center; vertical-align:middle;">
<span class="rsvp-msg" style="display:none;">You have already RSVPed to this session</span>
<span class="rsvp-msg" style="display:none;">You cannot RSVP to this session.</span>
<a class="rsvp-link" style="display:{rsvp_link_display_style};">
<%= image_tag "content/icon_join.png", :size => "19x22" %>
</a>

View File

@ -224,7 +224,7 @@
<div class="plus-any-interested-section">
<div class="icheckbuttons plus-checkbox">
<input type="checkbox" name="plus-musicians" id="session-plus-musicians" checked="checked"/>
<label for="session-plus-musicians" class="radio-text">
<label for="session-plus-musicians" class="radio-text">
Plus any interested JamKazam musicians that I approve
</label>
<div class="clearall"></div>
@ -253,8 +253,7 @@
<div class="session-instrumentlist f12" id="instrument-select-rsvp-list"></div>
<div class="instruments-rsvp-help-text">
To let other musicians know which parts you'll need in the session, check the instrumental and
vocal parts that you need, the number of each, and the desired skill level of the musicians you're
comfortable playing with.
vocal parts that you need, the number of each, and the desired skill level of the musicians you're comfortable playing with.
</div>
</div>
<div class="clearall"></div>