* VRFS-1803 - myriad create session styling fixes; some default behaviors added, UI behavors added; VRFS-1808; change up how upload files works

This commit is contained in:
Seth Call 2014-06-23 22:26:27 -05:00
parent 6aa51e43b9
commit 5750584769
22 changed files with 610 additions and 335 deletions

View File

@ -69,7 +69,7 @@ FactoryGirl.define do
approval_required false
musician_access true
legal_terms true
language 'english'
language 'eng'
legal_policy 'standard'
genre JamRuby::Genre.first
association :creator, :factory => :user

View File

@ -179,4 +179,5 @@ sms_index.sql
music_sessions_description_search.sql
rsvp_slots_prof_level.sql
add_file_name_music_notation.sql
change_scheduled_start_music_session.sql
change_scheduled_start_music_session.sql
music_sessions_iso_639_3.sql

View File

@ -0,0 +1 @@
ALTER TABLE music_sessions ALTER COLUMN language SET DEFAULT 'eng';

View File

@ -8,6 +8,8 @@ module JamRuby
# ensure most proficient, highest priority
default_scope order('proficiency_level DESC, priority ASC')
# proficiency is 1 = Beginner, 2 = Intermediate, 3 = Expert
belongs_to :user, :class_name => "JamRuby::User"
belongs_to :instrument, :class_name => "JamRuby::Instrument"

View File

@ -88,7 +88,7 @@ FactoryGirl.define do
approval_required false
musician_access true
legal_terms true
language 'english'
language 'eng'
timezone 'utc'
legal_policy 'standard'
recurring_mode 'once'

View File

@ -3,22 +3,16 @@
"use strict";
context.JK = context.JK || {};
context.JK.InstrumentSelectorDeferred = null;
context.JK.InstrumentSelector = (function(app) {
var logger = context.JK.logger;
var rest = new context.JK.Rest();
var _instruments = []; // will be list of structs: [ {label:xxx, value:yyy}, {...}, ... ]
var _rsvp = false;
var _parentSelector = null;
function loadInstruments() {
var url = "/api/instruments";
$.ajax({
type: "GET",
url: url,
async: false, // do this synchronously so the event handlers in events() can be wired up
success: instrumentsLoaded
});
}
var deferredInstruments = null;
var self = this;
function reset() {
$('input[type=checkbox]', _parentSelector).attr('checked', '');
@ -65,11 +59,13 @@
});
$.each(userInstrumentList, function (index, value) {
var instrumentOptionHtml = context.JK.fillTemplate(template, value);
var instrumentOptionHtml = $(context.JK.fillTemplate(template, value));
$(_parentSelector).append(instrumentOptionHtml);
context.JK.dropdown(instrumentOptionHtml.find('select'));
});
setSelectedInstruments(userInstrumentList);
// do not auto-pick anything for the user currently
//setSelectedInstruments(userInstrumentList);
$.each(_instruments, function(index, instrument) {
var isRendered = false;
@ -79,10 +75,12 @@
}
})
if (!isRendered) {
var instrumentOptionHtml = context.JK.fillTemplate(template, instrument);
var instrumentOptionHtml = $(context.JK.fillTemplate(template, instrument));
$(_parentSelector).append(instrumentOptionHtml);
context.JK.dropdown(instrumentOptionHtml.find('select'));
}
})
});
}
function getSelectedInstruments() {
@ -129,8 +127,15 @@
function initialize(rsvp) {
_rsvp = rsvp;
loadInstruments();
render();
// XXX; _instruments should be populated in a template, rather than round-trip to server
if(!context.JK.InstrumentSelectorDeferred) {
// this dance is to make sure there is only one server request instead of InstrumentSelector instances *
context.JK.InstrumentSelectorDeferred = rest.getInstruments()
}
context.JK.InstrumentSelectorDeferred
.done(function(response) {instrumentsLoaded(response)})
.fail(app.ajaxError)
return this;
}
@ -138,8 +143,10 @@
this.initialize = initialize;
this.getSelectedInstruments = getSelectedInstruments;
this.setSelectedInstruments = setSelectedInstruments;
this.render = render;
this.render = function() {
var _args = arguments;
context.JK.InstrumentSelectorDeferred.done(function(){render.apply(self, _args)})
}
});
})(window,jQuery);

View File

@ -63,7 +63,6 @@
contentType: false,
dataType: "json",
cache: false,
async: false,
url: "/api/music_notations",
data: formData
});

View File

@ -30,6 +30,16 @@
var $templateSteps = null;
var $templateButtons = null;
var $sessionButtons = null;
var $startTimeList = null;
var $endTimeList = null;
var $timezoneList = null;
var $recurringModeList = null;
var $languageList = null;
var $sessionPlusMusiciansLabel = null;
var $editScheduledSessions = null;
var $btnSelectFiles = null;
var $selectedFilenames = null;
var $uploadSpinner = null;
// Step1 layout
var $screenStep1 = null;
@ -122,9 +132,9 @@
}
if (createSessionSettings.createType == 'start-scheduled' && createSessionSettings.session_count == 0)
$('#edit_scheduled_sessions').hide();
$editScheduledSessions.hide();
else if (createSessionSettings.createType == 'start-scheduled' && createSessionSettings.session_count > 0)
$('#edit_scheduled_sessions').show();
$editScheduledSessions.show();
}
function afterLoadUserDetail(userDetail) {
@ -205,10 +215,17 @@
var sessionNotations = [];
for (var i = 0; i < createSessionSettings.notations.length; i++) {
var name = createSessionSettings.notations.filename;
console.log(createSessionSettings.notations[i])
var name = createSessionSettings.notations[i].file_name;
sessionNotations.push(name);
}
$('#session-notations-disp').html(sessionNotations.join(', '));
if(sessionNotations.length > 0) {
$('#session-notations-disp').html("Notations: " + sessionNotations.join(', '));
}
else {
$('#session-notations-disp').html('');
}
$('#session-language-disp').html(createSessionSettings.language.label);
@ -267,7 +284,7 @@
}
else {
var instruments_me = [];
$.each(instrumentSelector.getSelectedInstruments(), function(index, instrument) {
$.each(getCreatorInstruments(), function(index, instrument) {
instruments_me.push(instrument.name);
});
$('#session-instruments-me-disp').html(instruments_me.join(', '));
@ -335,7 +352,7 @@
createSessionSettings.description = "Private session set up just to test things out in the session interface by myself.";
createSessionSettings.notations = [];
createSessionSettings.language.label = 'English';
createSessionSettings.language.value = 'en';
createSessionSettings.language.value = 'eng';
createSessionSettings.session_policy = 'Standard';
createSessionSettings.musician_access.label = "Only RSVP musicians may join";
createSessionSettings.musician_access.value = "only-rsvp";
@ -346,20 +363,51 @@
}
else {
createSessionSettings.startDate = $('#session-start-date').val();
createSessionSettings.startTime = $('#start-time-list').val();
createSessionSettings.endTime = $('#end-time-list').val();
createSessionSettings.startTime = $startTimeList.val();
createSessionSettings.endTime = $endTimeList.val();
createSessionSettings.notations = [];
createSessionSettings.selectedSessionId = $scheduledSessions.find('input[name="scheduled-session-info"][checked="checked"]').attr('id');
var $timezoneList = $('#timezone-list');
createSessionSettings.timezone.value = $timezoneList.val();
createSessionSettings.timezone.label = $timezoneList.get(0).options[$timezoneList.get(0).selectedIndex].text;
var $recurringMode = $('#recurring-mode-list');
createSessionSettings.recurring_mode.label = $recurringMode.get(0).options[$recurringMode.get(0).selectedIndex].text;
createSessionSettings.recurring_mode.value = $recurringMode.val();
createSessionSettings.recurring_mode.label = $recurringModeList.get(0).options[$recurringModeList.get(0).selectedIndex].text;
createSessionSettings.recurring_mode.value = $recurringModeList.val();
}
return true;
}
function uploadNotations(notations) {
var formData = new FormData();
$.each(notations, function(i, file) {
formData.append('files[]', file);
});
formData.append('client_id', app.clientId);
$btnSelectFiles.text('UPLOADING...').data('uploading', true)
$uploadSpinner.show();
return rest.uploadMusicNotations(formData)
.done(function(response) {
var error_files = [];
$.each(response, function(i, music_notation) {
if (music_notation.errors) {
error_files.push(createSessionSettings.notations[i].name);
}
})
if (error_files.length > 0) {
app.notifyAlert("Failed to upload notations.", error_files.join(', '));
}
createSessionSettings.notations = $.merge(createSessionSettings.notations, response);
})
.fail(function(jqXHR) {
app.notifyServerError(jqXHR, "Unable to upload music notations");
})
.always(function() {
$btnSelectFiles.text('SELECT FILES...').data('uploading', null)
$uploadSpinner.hide();
})
}
function beforeMoveStep2() {
var isValid = true;
var name = $('#session-name').val();
@ -402,40 +450,12 @@
createSessionSettings.genresValues = genresValues;
createSessionSettings.name = name;
createSessionSettings.description = description;
createSessionSettings.notations = $('#session-step-2 #session-select-files').get(0).files;
if (createSessionSettings.notations.length > 0) {
var formData = new FormData();
$.each(createSessionSettings.notations, function(i, file) {
formData.append('files[]', file);
});
formData.append('client_id', app.clientId);
rest.uploadMusicNotations(formData)
.done(function(response) {
var error_files = [];
$.each(response, function(i, music_notation) {
if (music_notation.errors) {
error_files.push(createSessionSettings.notations[i].name);
}
})
if (error_files.length > 0) {
app.notifyAlert("Failed to upload files. ", error_files.join(', '));
}
createSessionSettings.notations = response;
})
.fail(function(jqXHR) {
app.notifyServerError(jqXHR, "Unable to upload music notations");
})
}
}
return isValid;
}
function beforeMoveStep3() {
var $languageList = $('#session-language-list');
createSessionSettings.language.value = $languageList.val();
createSessionSettings.language.label = $languageList.get(0).options[$languageList.get(0).selectedIndex].text;
return true;
@ -525,7 +545,7 @@
data.timezone = createSessionSettings.timezone.value;
data.rsvp_slots = [];
$.each(instrumentSelector.getSelectedInstruments(), function(index, instrument) {
$.each(getCreatorInstruments(), function(index, instrument) {
var slot = {};
slot.instrument_id = instrument.id;
slot.proficiency_level = instrument.level;
@ -731,7 +751,7 @@
event.preventDefault();
}
if ($(this).is('.button-grey')) return;
if ($(this).is('.button-grey')) return false;
if ($.inArray(createSessionSettings.createType, ['start-scheduled', 'quick-start']) > -1)
step = STEP_SELECT_TYPE;
else
@ -740,16 +760,21 @@
return false;
}
function onEditSessions(event) {
window.location = "/client#/account/sessions"
return false;
}
function next(event) {
var valid = beforeMoveStep();
if (!valid) {
return;
return false;
}
if (event) {
event.preventDefault();
}
if ($(this).is('.button-grey')) return;
if ($(this).is('.button-grey')) return false;
if ($.inArray(createSessionSettings.createType, ['start-scheduled', 'quick-start']) > -1)
step = STEP_SELECT_CONFIRM;
@ -782,7 +807,13 @@
return stepInfo.beforeMove.call(self);
}
function reset() {
$selectedFilenames.empty(); // we need to be sure and clear out old uploaded notations on every start of create session flow
}
function beforeShow(args) {
reset();
step = args.d1;
if (!step) step = 0;
step = parseInt(step);
@ -841,6 +872,9 @@
$startTimeList.val(createSessionSettings.startTime);
toggleStartTime();
context.JK.dropdown($startTimeList);
context.JK.dropdown($endTimeList);
}
function toggleStartTime() {
@ -881,6 +915,13 @@
context.JK.dropdown($('#session-musician-access'));
context.JK.dropdown($('#session-fans-access'));
context.JK.dropdown($timezoneList);
context.JK.dropdown($recurringModeList);
context.JK.dropdown($languageList);
context.JK.helpBubble($sessionPlusMusiciansLabel, 'session-plus-musicians', {}, {offsetParent: $sessionPlusMusiciansLabel.closest('.content-wrapper')});
$editScheduledSessions.on('click', onEditSessions);
}
function changeSelectedFiles() {
@ -901,19 +942,30 @@
if (error) {
app.notifyAlert("Error", "We're sorry, but we do not allow upload of that file type. Please upload only the file types listed in the Upload dialog box.");
$inputFiles.replaceWith($inputFiles.clone(true));
$('#selected-filenames').html("");
createSessionSettings.files = null;
}
else {
$('#selected-filenames').html(fileNames.join(', '));
createSessionSettings.files = files;
}
// upload as soon as user picks their files.
uploadNotations($inputFiles.get(0).files)
.done(function() {
context._.each(fileNames, function(fileName) {
var $text = $('<span>').text(fileName);
var $file = $('<li>').append($text);
$selectedFilenames.append($file);
})
})
}
function toggleSelectFiles(event) {
if($btnSelectFiles.data('uploading')) {
logger.debug("ignoring click of SELECT FILES... while uploading")
return false;
}
event.preventDefault();
$('#session-select-files').trigger('click');
return false;
}
function toggleStepStatus() {
@ -1013,10 +1065,22 @@
$('#session-fans-access-info .info-box[fans-access-type="' + $(event.target).val() + '"]').removeClass('hidden');
}
// asks the instrument selector for the creator's specified instruments, and defaults to Other/Beginner if none were selected
function getCreatorInstruments() {
var instruments = instrumentSelector.getSelectedInstruments();
if(instruments.length == 0) {
var otherId = context.JK.server_to_client_instrument_map.Other.server_id; // get server ID
var otherInstrumentInfo = context.JK.instrument_id_to_instrument[otherId]; // get display name
var beginnerLevel = 1; // default to beginner
instruments = [ {id: otherId, name: otherInstrumentInfo.display, level: beginnerLevel} ];
}
return instruments;
}
function events() {
$createTypes.on("ifChanged", toggleCreateType);
$('#start-time-list').on('change', toggleStartTime);
$('#session-step-2 .btn-select-files').on('click', toggleSelectFiles);
$btnSelectFiles.on('click', toggleSelectFiles);
$('#session-step-2 #session-select-files').on('change', changeSelectedFiles);
$policyTypes.on("ifChanged", togglePolicyTypeChanged);
$('#session-step-4 #session-musician-access').on('change', toggleMusicianAccessTypes);
@ -1040,7 +1104,7 @@
function initialize(invitationDialogInstance, inviteMusiciansUtilInstance, instrumentSelectorInstance, instrumentRSVPSelectorInstance) {
invitationDialog = invitationDialogInstance;
inviteMusiciansUtil = inviteMusiciansUtilInstance;
friendInput = inviteMusiciansUtil.inviteSessionCreate('#create-session-invite-musicians', "<div style='margin-right:140px;'>Who do you want to invite?</div>"); //'
friendInput = inviteMusiciansUtil.inviteSessionCreate('#create-session-invite-musicians', "<h3>Who do you want to invite?</h3>"); //'
instrumentSelector = instrumentSelectorInstance;
instrumentRSVP = instrumentRSVPSelectorInstance;
@ -1053,12 +1117,20 @@
$templateSteps = $('#template-session-steps');
$templateButtons = $('#template-session-buttons');
$sessionButtons = $('#create-session-buttons');
$startTimeList = $('#start-time-list');
$endTimeList = $('#end-time-list');
$timezoneList = $('#timezone-list');
$recurringModeList = $('#recurring-mode-list');
$screenStep1 = $('#session-step-1');
$createTypes = $('input[name="session-when"]');
$createTypeHelpers = $screen.find('.session-when-info div');
$scheduledSessions = $screenStep1.find("#scheduled-session-list");
$languageList = $('#session-language-list');
$sessionPlusMusiciansLabel = $screen.find('label[for="session-plus-musicians"]');
$editScheduledSessions = $('#edit_scheduled_sessions');
$btnSelectFiles = $screen.find('.btn-select-files');
$selectedFilenames = $('#selected-filenames');
$uploadSpinner = $screen.find($('.upload-spinner'));
$policyTypes = $('input[name="session-policy-type"]');
initializeControls();

View File

@ -121,13 +121,7 @@
}
select, .easydropdown {
box-shadow: none !important;
color: #666666;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
@include flat_dropdown;
}
}

View File

@ -51,4 +51,29 @@ $short-screen: 600px; // toolbars / chrome for x768
box-sizing: content-box;
}
@mixin flat_dropdown {
box-shadow: none !important;
color: #666666;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
@mixin white_dropdown {
ul {
background-color:white;
}
}
@mixin no_top_padding_dropdown {
.selected {
padding-top:0;
}
.carat {
margin-top:-9px;
}
}

View File

@ -1,148 +1,15 @@
@import "client/common.css.scss";
#create-session-layout {
.fan-chat-options {
display:none;
}
}
.session-header {
padding: 15px 35px;
.session-stepnumber {
display: block;
padding: 12px;
padding-top: 7px;
width: 12px;
height: 18px;
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
border-radius: 18px;
font-size: 22px;
margin-right: 10px;
font-family: helvetica;
text-decoration: none;
border: solid 1px #ed3618;
background-color: #333;
color: #ed3618 !important;
background-color:rgb(51, 51, 51);
.content-wrapper {
border-bottom-width:0;
}
.session-stepactive {
border: none;
background-color: #ed3618;
color: #333 !important;
}
.session-stephover {
&:hover {
background-color: #222;
}
}
.session-step-title {
float: left;
color: #ccc;
font-size: 28px;
width: 350px;
margin-top: 3px;
display: none;
}
}
.session-wrapper {
padding: 10px 35px 5px 35px;
white-space: initial;
h3 {
font-weight: bold;
}
> div.session {
width: 50%;
&.right {
font-size: 13px;
}
}
}
#session-step-1 {
height: 310px;
ul#create-session-type {
margin-left: 0px;
list-style: none;
li {
margin-bottom: 10px;
}
}
.session-when-info {
background-color: #3E3E3E;
padding: 10px;
color: #adadad;
}
#start-scheduled-wrapper {
.session-list {
height: 250px;
overflow: auto;
ul#scheduled-session-list {
margin-left: 0px;
list-style: none;
li {
margin-bottom: 5px;
}
}
}
}
ul#scheduled-session-list {
li {
padding: 3px 0px;
}
}
}
#session-step-2 {
.hb10 {
padding: 0px 0px 10px 0px;
}
#select-genre {
padding-bottom: 10px;
}
.btn-select-files {
margin-top: 4px;
}
#selected-filenames {
margin-top: 4px;
}
}
#session-step-3 {
height: 310px;
.session-instrumentlist {
padding: 10px;
height: 65px;
background-color: #c5c5c5;
border: none;
-webkit-box-shadow: inset 2px 2px 3px 0px #888;
box-shadow: inset 2px 2px 3px 0px #888;
color: #666;
overflow: auto;
font-size: 14px;
}
.plus-checkbox {
.icheckbox_minimal {
float: left;
}
}
}
#session-step-4 {
height: 310px;
.info-box {
background-color: #3E3E3E;
padding: 10px;
@ -150,36 +17,322 @@
font-size: 13px;
}
.terms-checkbox {
float:left;
display:block;
margin-right:5px;
.session-header {
padding: 15px 35px;
.session-stepnumber {
display: block;
padding: 12px;
padding-top: 7px;
width: 12px;
height: 18px;
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
border-radius: 18px;
font-size: 22px;
margin-right: 10px;
font-family: helvetica;
text-decoration: none;
border: solid 1px #ed3618;
background-color: #333;
color: #ed3618 !important;
}
.session-stepactive {
border: none;
background-color: #ed3618;
color: #333 !important;
}
.session-stephover {
&:hover {
background-color: #222;
}
}
.session-step-title {
float: left;
color: #ccc;
font-size: 28px;
width: 350px;
margin-top: 3px;
display: none;
}
}
.terms {
font-size:11px;
width:auto;
display:block;
white-space:normal;
.session-when-info {
margin-top:20px;
}
.fan-chat-options {
display:none;
}
ul#session-policy {
margin-left: 0px;
list-style: none;
.session-wrapper {
padding: 10px 35px 5px 35px;
white-space: initial;
h3 {
font-weight: bold;
color:#dedede;
}
> div.session {
width: 50%;
&.right {
font-size: 13px;
}
}
}
#session-start-date {
@include border_box_sizing;
width:100%;
}
.start-time-list-holder .easydropdown-wrapper, .end-time-list-holder .easydropdown-wrapper, .recurring-mode-list-holder .easydropdown-wrapper, .timezone-list-holder .easydropdown-wrapper{
width:100%
}
.timezone-list-holder .dropdown-container {
left:-100px;
}
.end-label {
@include border_box_sizing;
padding-left:5px;
}
#session-step-1 {
ul#create-session-type {
margin-left: 0px;
list-style: none;
li {
margin-bottom: 10px;
}
}
#start-scheduled-wrapper {
.session-list {
height: 250px;
overflow: auto;
ul#scheduled-session-list {
margin-left: 0px;
list-style: none;
li {
margin-bottom: 5px;
}
}
}
}
ul#scheduled-session-list {
li {
padding: 3px 0px;
}
}
}
#session-step-2 {
#select-genre {
padding-bottom: 10px;
}
.btn-select-files {
margin-top: 10px;
margin-left:0;
width:105px;
@include border_box_sizing;
}
.spinner-small.upload-spinner {
display:none;
position: absolute;
left: 0px;
margin-top: 4px;
}
.select-files-section {
width:115px;
position:absolute;
}
#selected-filenames {
margin-top:10px;
font-size:12px;
margin-left: 5px;
li {
margin-bottom:1px;
white-space:nowrap;
line-height:14px;
}
li span {
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
display:block;
}
}
.selected-files-section {
padding: 0 10px 0 115px;
overflow: hidden;
width: 100%;
@include border_box_sizing;
}
.session-description-header {
margin-bottom:5px;
white-space:nowrap;
}
}
#session-step-3 {
.session-instrumentlist {
padding: 10px;
height: 100px;
background-color: #c5c5c5;
border: none;
-webkit-box-shadow: inset 2px 2px 3px 0px #888;
box-shadow: inset 2px 2px 3px 0px #888;
color: #666;
overflow: auto;
font-size: 14px;
select, .easydropdown {
@include flat_dropdown;
@include no_top_padding_dropdown;
.selected {
font-size:13px;
}
}
.dropdown-container {
@include white_dropdown;
}
}
.rsvp-level, .rsvp-count {
display:inline-block;
}
.rsvp-level {
margin-left:10px;
}
.instrument-rsvp-row {
}
.plus-checkbox {
.icheckbox_minimal {
float: left;
margin-right:3px;
}
label {
float:none;
text-overflow: ellipsis;
overflow:hidden;
white-space: nowrap;
}
min-width:120px;
}
.instruments-rsvp-help-text {
margin-top:10px;
font-size:12px;
line-height:14px;
}
.plus-any-interested-section {
white-space:nowrap;
}
}
#session-step-4 {
.terms-checkbox {
float:left;
display:block;
margin-right:5px;
}
.terms {
font-size:11px;
width:auto;
display:block;
white-space:normal;
}
ul#session-policy {
margin-left: 0px;
list-style: none;
li {
margin-bottom: 10px;
}
}
.session-musician-access-header, .session-fans-access-header {
margin: 0 0 5px 0;
}
}
#session-step-5 {
}
.session-buttons {
padding-right: 30px;
padding-bottom: 20px;
}
#session-name-disp {
font-style:italic;
}
#session-name {
width:100%;
@include border_box_sizing;
}
.upload-files-section {
margin-bottom:20px;
}
.btn-choose-friends {
// margin-left:138px;
}
.invite-info-text {
font-size:13px;
line-height:15px;
}
.session-language-list-header {
margin-top:25px;
margin-bottom:20px;
}
#create-session-buttons {
margin-top:10px;
}
.error-text {
margin:2px 0 0 2em;
li {
margin-bottom: 10px;
margin-bottom:0;
}
}
}
#session-step-5 {
height: 310px;
}
.session-buttons {
padding-right: 30px;
padding-bottom: 20px;
}
.btn-choose-friends {
margin:0;
@ -205,7 +358,8 @@
.session-description {
padding:5px;
width: 80%;
width: 100%;
@include border_box_sizing;
}
.radio-text {

View File

@ -26,6 +26,11 @@ body {
font-size: 14px;
font-family: Raleway, Arial, Helvetica, sans-serif;
font-weight: 300;
input,textarea {
font-family: Raleway, Arial, Helvetica, sans-serif;
font-weight: 300;
}
}
b { font-weight: bold; }
@ -321,6 +326,10 @@ input[type="text"], input[type="password"]{
font-size:15px;
}
textarea {
font-size:15px;
}
.mr10 {
margin-right:10px;

View File

@ -1,4 +1,4 @@
@import "client/common.css.scss";
@import "client/common";
[layout-id="session"] {

View File

@ -127,7 +127,7 @@ class ApiMusicSessionsController < ApiController
history.band = band
history.genre_id = (params[:genres].length > 0 ? params[:genres][0] : nil) if params[:genres]
history.legal_terms = params[:legal_terms]
history.language = 'english'
history.language = 'eng'
history.legal_policy = 'standard'
history.creator = current_user
history.save

View File

@ -48,13 +48,14 @@ module MusicSessionHelper
def music_session_languages
languages = []
common_languages = LanguageList::COMMON_LANGUAGES
# sort by name
common_languages = LanguageList::COMMON_LANGUAGES.sort {|a, b| a.name <=> b.name}
english = LanguageList::LanguageInfo.find('English')
languages.push(:id => english.iso_639_1, :label => english.name)
languages.push(:id => english.iso_639_3, :label => english.name)
common_languages
common_languages.reject {|lang| lang == english}.each do |language|
languages.push(:id => language.iso_639_1, :label => language.name == 'Modern Greek (1453-)' ? 'Greek' : language.name)
languages.push(:id => language.iso_639_3, :label => language.name == 'Modern Greek (1453-)' ? 'Greek' : language.name)
end
languages
end
end

View File

@ -1,3 +1,3 @@
object @music_notations
attribute :id, :filename
attribute :id, :file_name

View File

@ -32,4 +32,8 @@
<script type="text/template" id="template-help-move-on-loopback-success">
You can move to the next step now.
</script>
<script type="text/template" id="template-help-session-plus-musicians">
Plus any interested JamKazam musicians that I approve.
</script>

View File

@ -64,7 +64,7 @@
</li>
</ul>
</div>
<div class="session-when-info mt10">
<div class="session-when-info info-box">
<div class="" info-id="start-scheduled">
If you have already scheduled a session, and you want to start the session now so that other
musicians who RSVP'd can join you in the session, then choose the session you want to start now
@ -101,7 +101,7 @@
<div class="w35 right">
<div id="start-scheduled-wrapper">
<div>
<h3 class="left">My scheduled sessions</h3>
<h3 class="left">My Scheduled Sessions</h3>
<%= link_to '(edit)', '#', class: 'right', id: 'edit_scheduled_sessions', target: '_blank' %>
<div class="clearall"></div>
</div>
@ -126,18 +126,18 @@
</div>
<div class="clearall left ib w15 h40">Start:</div>
<div class="left ib w35 h40">
<div class="left ib w35 h40 start-time-list-holder">
<select id="start-time-list">
</select>
</div>
<div class="left ib w15 h40">End:</div>
<div class="left ib w35 h40">
<div class="left ib w15 h40 end-label">End:</div>
<div class="left ib w35 h40 end-time-list-holder">
<select id="end-time-list">
</select>
</div>
<div class="clearall left ib w35 h40">Time Zone:</div>
<div class="right ib w65 h40">
<div class="right ib w65 h40 timezone-list-holder">
<select id="timezone-list" class="w100">
<% ActiveSupport::TimeZone.zones_map.each do |name, tz| %>
<option value="<%= name + ',' + tz.tzinfo.name %>" class="label"><%= tz.to_s %></option>
@ -146,7 +146,7 @@
</div>
<div class="clearall left ib w35 h40">Recurring:</div>
<div class="right ib w65 h40">
<div class="right ib w65 h40 recurring-mode-list-holder">
<select id="recurring-mode-list" class="w100">
<option value="once" class="label">Not Recurring</option>
<option value="weekly" class="label">Weekly</option>
@ -157,9 +157,9 @@
<div class="clearall"></div>
</div>
<div id="session-step-2" class="create-session-wizard" layout-wizard-step="1">
<div class="w100 hb10">
<div class="w100">
<div id="divSessionGenre" class="left w40">
<div class="mb5">Please select a genre for your session:</div>
<h3 class="mb5">Please select a genre for your session:</h3>
<div id="create-session-genre">
<%= render "genreSelector" %>
</div>
@ -170,11 +170,11 @@
</div>
<div class="clearall"></div>
</div>
<div class="w100 hb10">
<div id="divSessionName" class="w40 mb10 left">
<div class="mb5">Please enter a name for your session:</div>
<div class="w100 mt15">
<div id="divSessionName" class="w40 left">
<h3 class="mb5">Please enter a name for your session:</h3>
<div>
<input id="session-name" type="text" name="session-name" class="w80">
<input id="session-name" type="text" name="session-name">
</div>
</div>
<div class="w50 right">
@ -182,9 +182,9 @@
</div>
<div class="clearall"></div>
</div>
<div class="w100 hb10">
<div id="divSessionDescription" class="w40 mb10 left">
<div class="mb5">Please enter a description for your session:</div>
<div class="w100 mt15">
<div id="divSessionDescription" class="w40 left">
<h3 class="session-description-header">Please enter a description for your session:</h3>
<div>
<textarea rows=3 id="session-description" name="description" class="session-description"></textarea>
</div>
@ -195,17 +195,18 @@
</div>
<div class="clearall"></div>
</div>
<div class="w100 hb10">
<div class="w50 hb10 left">
<div class="w100 mt20 upload-files-section">
<div class="w50 left">
<h3 class="hb3">Upload music notation for your session (optional):</h3>
<div>
<div class="w30 left">
<a class="button-orange btn-select-files" href="#">Select Files...</a>
<div class="spinner-small upload-spinner"></div>
<div class="select-files-section">
<a class="button-orange btn-select-files" href="#">SELECT FILES...</a>
<input type="file" class="hidden" id="session-select-files" value="Select Files..."
accept=".pdf, .png, .jpg, .jpeg, .gif, .xml, .mxl, .txt" multiple>
</div>
<div class="w70 left">
<div id="selected-filenames"></div>
<div class="selected-files-section">
<ul id="selected-filenames"></ul>
</div>
<div class="clearall"></div>
</div>
@ -220,21 +221,22 @@
<div id="session-step-3" class="create-session-wizard" layout-wizard-step="2">
<div class="w45 left">
<div id="create-session-invite-musicians"></div>
<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">
Plus any interested JamKazam musicians that I approve
</label>
<div class="clearall"></div>
<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">
Plus any interested JamKazam musicians that I approve
</label>
<div class="clearall"></div>
</div>
</div>
<br/>
<div class="f13">
<div class="invite-info-text">
To invite specific friends, click the Choose Friends button and select them in the dialog box, or
just start typing your friends' names and select them from the popup menu. If you choose to let
other interested musicians join you, you will have the opportunity to approve them when they RSVP.
</div>
<br/>
<h3>What language will be spoken?</h3>
<h3 class="session-language-list-header">What language will be spoken?</h3>
<select id="session-language-list">
<% music_session_languages.each do |language| %>
<option value="<%= language[:id] %>"><%= language[:label] %></option>
@ -246,14 +248,13 @@
<h3 class="mb5">What will you play?</h3>
<div class="session-instrumentlist f12" id="instrument-select-list">
</div>
<br><br>
<br>
<h3 class="mb5">What other instruments/parts will you need?</h3>
<div class="session-instrumentlist f12" id="instrument-select-rsvp-list">
<div class="f12">
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.
</div>
<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.
</div>
</div>
<div class="clearall"></div>
@ -328,7 +329,7 @@
</div>
</div>
<div class="right w40">
<h3>How will you handle musician access?</h3>
<h3 class="session-musician-access-header">How will you handle musician access?</h3>
<select id="session-musician-access">
<option value="only-rsvp">Only RSVP musicians may join</option>
<option value="musicians-approval" selected="selected">Musicians may join by approval</option>
@ -340,7 +341,7 @@
RSVPs from a set of musicians who are likely to join you, and you don't need any other musicians,
and don't want to be disturbed by others asking to join while you are playing in the session.
</div>
<div class="info-box" musician-access-type="musicans-approval">
<div class="info-box" musician-access-type="musicians-approval">
This is a good option when you have invited some musicians who are likely to join you, but you still
want to let other musicians request to join your session while it's in progress. Musicians can't
just wander in, but they can ask to join while you are in session, and you can approve or not.
@ -352,7 +353,7 @@
</div>
</div>
<br>
<h3>How will you handle fan access?</h3>
<h3 class="session-fans-access-header">How will you handle fan access?</h3>
<select id="session-fans-access">
<option value="listen-chat-band">Fans may listen, chat with the band</option>
<option value="listen-chat-each" selected="selected">Fans may listen, chat with each other</option>
@ -376,31 +377,30 @@
<div class="left w55">
<h3>When are you starting your session?</h3>
<div id="session-start-type-disp" class="mt5"></div>
<br/><br/>
<h3 class="mb5">What are you playing?</h3>
<h3 class="mb5 mt20">What are you playing?</h3>
<em id="session-name-disp"></em>
<div id="session-description-disp" class="mt5"></div><br/>
<div id="session-notations-disp" class="mt5"></div><br/>
<div id="session-description-disp" class="mt5"></div>
<div id="session-notations-disp" class="mt5"></div>
<h3>What language will be spoken?</h3>
<h3 class="mt20">What language will be spoken?</h3>
<div id="session-language-disp" class="mt5"></div>
</div>
<div class="right w40">
<h3>Who is invited?</h3>
<div id="session-invited-disp" class="mt5"></div><br/>
<div id="session-invited-disp" class="mt5"></div>
<h3>What instruments/parts do you need?</h3>
<h3 class="mt20">What instruments/parts do you need?</h3>
<div class="left ib w20 mt5">Me:</div>
<div class="left ib w75 mt5" id="session-instruments-me-disp" class="mt5"></div>
<div class="clearall left ib w20">Others:</div>
<div class="left ib w75" id="session-instruments-rsvp-disp" class="mt5"></div><br clear="all"></br>
<div class="left ib w75" id="session-instruments-rsvp-disp" class="mt5"></div><br clear="all">
<h3>What access policies are in effect?</h3>
<h3 class="mt20">What access policies are in effect?</h3>
<div id="session-musician-access-disp" class="mt5"></div>
<div id="session-fans-access-disp"></div><br/><br/>
<div id="session-fans-access-disp"></div>
<h3>What legal policy is in effect?</h3>
<h3 class="mt20">What legal policy is in effect?</h3>
<div id="session-policy-disp" class="mt5"></div>
</div>
<div class="clearall"></div>
@ -431,7 +431,7 @@
<a href='#' class="session-stepnumber left" data-step-number="3">4</a>
<div class="session-step-title">What Are Your Policies?</div>
<a href='#' class="session-stepnumber left" data-step-number="4">5</a>
<div class="session-step-title">Review & Confirm?</div>
<div class="session-step-title">Review & Confirm</div>
<div class="clearall"></div>
</div>
</script>
@ -474,26 +474,32 @@
<!-- Instrument select template for RSVP -->
<script type="text/template" id="template-instrument-rsvp-option">
<div class="left ib w35 mb5 plus-checkbox clearall">
<input type="checkbox" id="{id}" session-instrument-id="{value}">
<label for="{id}" class="radio-text">
{label}
</label>
</div>
<div class="right ib w65 mb5">
<select class="f12 rsvp-count" session-instrument-id="{value}">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<select class="f12 rsvp-level" session-instrument-id="{value}">
<option value="0">Any Skill Level</option>
<option value="1">Beginner</option>
<option value="2">Beginner to Intermediate</option>
<option value="3">Intermediate</option>
<option value="4">Intermediate to Advanced</option>
<option value="5">Advanced</option>
</select>
<div class="instrument-rsvp-row">
<div class="left ib mb5 plus-checkbox clearall">
<input type="checkbox" id="{id}" session-instrument-id="{value}">
<label for="{id}" class="radio-text">
{label}
</label>
</div>
<div class="right ib w65 mb5">
<div class="rsvp-count">
<select class="f12 rsvp-count" session-instrument-id="{value}">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div class="rsvp-level">
<select class="f12 rsvp-level" session-instrument-id="{value}">
<option value="0">Any Skill Level</option>
<option value="1">Beginner</option>
<option value="2">Beginner to Intermediate</option>
<option value="3">Intermediate</option>
<option value="4">Intermediate to Advanced</option>
<option value="5">Advanced</option>
</select>
</div>
</div>
</div>
</script>

View File

@ -107,7 +107,7 @@ FactoryGirl.define do
approval_required false
musician_access true
legal_terms true
language 'english'
language 'eng'
legal_policy 'standard'
genre JamRuby::Genre.first
association :creator, :factory => :user

View File

@ -42,10 +42,11 @@ describe "Create Session Flow", :js => true, :type => :feature, :capybara_featur
find('div#schedule-future-wrapper')
find('h3', text: 'When will the session happen?')
find('input#session-start-date')
find('select#start-time-list')
find('select#end-time-list')
find('select#timezone-list')
find('select#recurring-mode-list')
find('.start-time-list-holder .easydropdown')
find('.end-time-list-holder .easydropdown')
find('.start-time-list-holder .easydropdown')
find('.timezone-list-holder .easydropdown')
find('.recurring-mode-list-holder .easydropdown')
end
end
@ -120,9 +121,8 @@ describe "Create Session Flow", :js => true, :type => :feature, :capybara_featur
it "initial status" do
find('.session-step-title', text: 'Who Is Playing With You?')
find('input#session-plus-musicians[type="checkbox"][checked="checked"]')
find('input[type="checkbox"][session-instrument-id="electric guitar"][checked="checked"]')
expect( find(:css, 'select#session-language-list').value ).to eq('en')
expect( find(:css, 'select#session-language-list', :visible => false).value ).to eq('eng')
page.should have_css(".session-stepnumber", :count => 5)
page.should have_css(".session-stepnumber.session-stepactive", :count => 1)
@ -152,8 +152,8 @@ describe "Create Session Flow", :js => true, :type => :feature, :capybara_featur
find('input#session-policy-standard[type="radio"][checked="checked"]')
find('input#session-policy-confirm[type="checkbox"]')
expect( find(:css, 'select#session-musician-access').value ).to eq('musicians-approval')
expect( find(:css, 'select#session-fans-access').value ).to eq('listen-chat-each')
expect( find(:css, 'select#session-musician-access', :visible => false).value ).to eq('musicians-approval')
expect( find(:css, 'select#session-fans-access', :visible => false).value ).to eq('listen-chat-each')
page.should have_css(".btn-back")
page.should have_css(".btn-next")

View File

@ -26,7 +26,7 @@ describe "Active Music Session API ", :type => :api do
let(:defopts) { { :name => "session name", :description => "session description",
:genres => ["classical"], :musician_access => true, :approval_required => false,
:fan_chat => true, :fan_access => true,
:legal_policy => true, :language => 'english',
:legal_policy => true, :language => 'eng',
:timezone => "utc"} }
let(:defpart) { { :as_musician => true,
:tracks => [{"instrument_id" => "electric guitar",

View File

@ -22,7 +22,7 @@ describe "Scheduled Music Session API ", :type => :api do
let(:defopts) { { :name => "session name", :description => "session description",
:genres => ["classical"], :musician_access => true, :approval_required => false,
:fan_chat => true, :fan_access => true,
:legal_policy => true, :language => 'english',
:legal_policy => true, :language => 'eng',
:timezone => "utc"} }
before(:all) do