From 5750584769908b8c747774150c23b0f67d12ffbf Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 23 Jun 2014 22:26:27 -0500 Subject: [PATCH] * VRFS-1803 - myriad create session styling fixes; some default behaviors added, UI behavors added; VRFS-1808; change up how upload files works --- admin/spec/factories.rb | 2 +- db/manifest | 3 +- db/up/music_sessions_iso_639_3.sql | 1 + .../jam_ruby/models/musician_instrument.rb | 2 + ruby/spec/factories.rb | 2 +- .../assets/javascripts/instrumentSelector.js | 43 +- web/app/assets/javascripts/jam_rest.js | 1 - .../assets/javascripts/scheduled_session.js | 178 +++++-- .../stylesheets/client/account.css.scss | 8 +- .../assets/stylesheets/client/common.css.scss | 25 + .../stylesheets/client/createSession.css.scss | 476 ++++++++++++------ .../stylesheets/client/jamkazam.css.scss | 9 + .../stylesheets/client/session.css.scss | 2 +- .../api_music_sessions_controller.rb | 2 +- web/app/helpers/music_session_helper.rb | 9 +- web/app/views/api_music_notations/create.rabl | 2 +- web/app/views/clients/_help.html.erb | 4 + .../views/clients/_scheduledSession.html.erb | 154 +++--- web/spec/factories.rb | 2 +- web/spec/features/create_session_flow_spec.rb | 16 +- .../active_music_sessions_api_spec.rb | 2 +- web/spec/requests/music_sessions_api_spec.rb | 2 +- 22 files changed, 610 insertions(+), 335 deletions(-) create mode 100644 db/up/music_sessions_iso_639_3.sql diff --git a/admin/spec/factories.rb b/admin/spec/factories.rb index a2d058d80..74315a7e6 100644 --- a/admin/spec/factories.rb +++ b/admin/spec/factories.rb @@ -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 diff --git a/db/manifest b/db/manifest index bceb5bfa8..986c76ed7 100755 --- a/db/manifest +++ b/db/manifest @@ -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 \ No newline at end of file +change_scheduled_start_music_session.sql +music_sessions_iso_639_3.sql \ No newline at end of file diff --git a/db/up/music_sessions_iso_639_3.sql b/db/up/music_sessions_iso_639_3.sql new file mode 100644 index 000000000..536d7e348 --- /dev/null +++ b/db/up/music_sessions_iso_639_3.sql @@ -0,0 +1 @@ +ALTER TABLE music_sessions ALTER COLUMN language SET DEFAULT 'eng'; \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/musician_instrument.rb b/ruby/lib/jam_ruby/models/musician_instrument.rb index 503a4e6f3..376b99a3c 100644 --- a/ruby/lib/jam_ruby/models/musician_instrument.rb +++ b/ruby/lib/jam_ruby/models/musician_instrument.rb @@ -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" diff --git a/ruby/spec/factories.rb b/ruby/spec/factories.rb index 773e52adb..11547cd93 100644 --- a/ruby/spec/factories.rb +++ b/ruby/spec/factories.rb @@ -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' diff --git a/web/app/assets/javascripts/instrumentSelector.js b/web/app/assets/javascripts/instrumentSelector.js index 240218f59..57d6d6e51 100644 --- a/web/app/assets/javascripts/instrumentSelector.js +++ b/web/app/assets/javascripts/instrumentSelector.js @@ -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); \ No newline at end of file diff --git a/web/app/assets/javascripts/jam_rest.js b/web/app/assets/javascripts/jam_rest.js index 583d7b1ba..27c20a35d 100644 --- a/web/app/assets/javascripts/jam_rest.js +++ b/web/app/assets/javascripts/jam_rest.js @@ -63,7 +63,6 @@ contentType: false, dataType: "json", cache: false, - async: false, url: "/api/music_notations", data: formData }); diff --git a/web/app/assets/javascripts/scheduled_session.js b/web/app/assets/javascripts/scheduled_session.js index 8004d2866..1f29aa488 100644 --- a/web/app/assets/javascripts/scheduled_session.js +++ b/web/app/assets/javascripts/scheduled_session.js @@ -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 = $('').text(fileName); + var $file = $('
  • ').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', "
    Who do you want to invite?
    "); //' + friendInput = inviteMusiciansUtil.inviteSessionCreate('#create-session-invite-musicians', "

    Who do you want to invite?

    "); //' 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(); diff --git a/web/app/assets/stylesheets/client/account.css.scss b/web/app/assets/stylesheets/client/account.css.scss index 9ed774709..1f87d7512 100644 --- a/web/app/assets/stylesheets/client/account.css.scss +++ b/web/app/assets/stylesheets/client/account.css.scss @@ -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; } } diff --git a/web/app/assets/stylesheets/client/common.css.scss b/web/app/assets/stylesheets/client/common.css.scss index 6cb83befb..08bb7e86e 100644 --- a/web/app/assets/stylesheets/client/common.css.scss +++ b/web/app/assets/stylesheets/client/common.css.scss @@ -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; + } +} diff --git a/web/app/assets/stylesheets/client/createSession.css.scss b/web/app/assets/stylesheets/client/createSession.css.scss index 8fda6a729..f462393b7 100644 --- a/web/app/assets/stylesheets/client/createSession.css.scss +++ b/web/app/assets/stylesheets/client/createSession.css.scss @@ -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 { diff --git a/web/app/assets/stylesheets/client/jamkazam.css.scss b/web/app/assets/stylesheets/client/jamkazam.css.scss index 1610a3345..b908ef8ba 100644 --- a/web/app/assets/stylesheets/client/jamkazam.css.scss +++ b/web/app/assets/stylesheets/client/jamkazam.css.scss @@ -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; diff --git a/web/app/assets/stylesheets/client/session.css.scss b/web/app/assets/stylesheets/client/session.css.scss index 302d345b7..c41e33dbe 100644 --- a/web/app/assets/stylesheets/client/session.css.scss +++ b/web/app/assets/stylesheets/client/session.css.scss @@ -1,4 +1,4 @@ -@import "client/common.css.scss"; +@import "client/common"; [layout-id="session"] { diff --git a/web/app/controllers/api_music_sessions_controller.rb b/web/app/controllers/api_music_sessions_controller.rb index faa5e3618..515ea50be 100644 --- a/web/app/controllers/api_music_sessions_controller.rb +++ b/web/app/controllers/api_music_sessions_controller.rb @@ -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 diff --git a/web/app/helpers/music_session_helper.rb b/web/app/helpers/music_session_helper.rb index a0f5779f3..aefeca223 100644 --- a/web/app/helpers/music_session_helper.rb +++ b/web/app/helpers/music_session_helper.rb @@ -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 diff --git a/web/app/views/api_music_notations/create.rabl b/web/app/views/api_music_notations/create.rabl index 3d2f185b2..1df3bde7d 100644 --- a/web/app/views/api_music_notations/create.rabl +++ b/web/app/views/api_music_notations/create.rabl @@ -1,3 +1,3 @@ object @music_notations -attribute :id, :filename \ No newline at end of file +attribute :id, :file_name \ No newline at end of file diff --git a/web/app/views/clients/_help.html.erb b/web/app/views/clients/_help.html.erb index 4d6d5ad1c..c253975a5 100644 --- a/web/app/views/clients/_help.html.erb +++ b/web/app/views/clients/_help.html.erb @@ -32,4 +32,8 @@ + + \ No newline at end of file diff --git a/web/app/views/clients/_scheduledSession.html.erb b/web/app/views/clients/_scheduledSession.html.erb index 23306916a..9714c0af7 100644 --- a/web/app/views/clients/_scheduledSession.html.erb +++ b/web/app/views/clients/_scheduledSession.html.erb @@ -64,7 +64,7 @@
  • -
    +
    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 @@
    -

    My scheduled sessions

    +

    My Scheduled Sessions

    <%= link_to '(edit)', '#', class: 'right', id: 'edit_scheduled_sessions', target: '_blank' %>
    @@ -126,18 +126,18 @@
    Start:
    -
    +
    -
    End:
    -
    +
    End:
    +
    Time Zone:
    -
    +
    @@ -157,9 +157,9 @@
    -
    +
    -
    Please select a genre for your session:
    +

    Please select a genre for your session:

    <%= render "genreSelector" %>
    @@ -170,11 +170,11 @@
    -
    -
    -
    Please enter a name for your session:
    +
    +
    +

    Please enter a name for your session:

    - +
    @@ -182,9 +182,9 @@
    -
    -
    -
    Please enter a description for your session:
    +
    +
    +

    Please enter a description for your session:

    @@ -195,17 +195,18 @@
    -
    -
    +
    +

    Upload music notation for your session (optional):

    -
    - Select Files... +
    + -
    -
    +
    +
      @@ -220,21 +221,22 @@
      -
      - - -
      +
      +
      + + +
      +

      -
      +
      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.
      -
      -

      What language will be spoken?

      +

      What language will be spoken?

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

      -

      How will you handle fan access?

      +

      How will you handle fan access?