diff --git a/db/manifest b/db/manifest index 761758fe2..4e3709a27 100755 --- a/db/manifest +++ b/db/manifest @@ -268,3 +268,4 @@ jam_track_redeemed.sql connection_metronome.sql preview_jam_track_tracks.sql cohorts.sql +alter_genre_player_unique_constraint.sql \ No newline at end of file diff --git a/db/up/alter_genre_player_unique_constraint.sql b/db/up/alter_genre_player_unique_constraint.sql new file mode 100644 index 000000000..c0159b59b --- /dev/null +++ b/db/up/alter_genre_player_unique_constraint.sql @@ -0,0 +1,2 @@ +ALTER TABLE genre_players DROP CONSTRAINT genre_player_uniqkey; +ALTER TABLE genre_players ADD CONSTRAINT genre_player_uniqkey UNIQUE (player_id, player_type, genre_id, genre_type); \ No newline at end of file diff --git a/web/app/assets/javascripts/accounts_profile.js b/web/app/assets/javascripts/accounts_profile.js index c418c213f..b7189774a 100644 --- a/web/app/assets/javascripts/accounts_profile.js +++ b/web/app/assets/javascripts/accounts_profile.js @@ -18,6 +18,9 @@ var nilOptionStr = ''; var nilOptionText = 'n/a'; var $screen = $('#account-profile-basics'); + var $btnCancel = $screen.find('#account-edit-profile-cancel'); + var $btnSubmit = $screen.find('#account-edit-profile-submit'); + var $biography = null; function beforeShow(data) { @@ -213,8 +216,18 @@ /****************** MAIN PORTION OF SCREEN *****************/ // events for main screen function events() { - $('#account-profile-content-scroller').on('click', '#account-edit-profile-cancel', function(evt) { evt.stopPropagation(); navToAccount(); return false; } ); - $('#account-profile-content-scroller').on('click', '#account-edit-profile-submit', function(evt) { evt.stopPropagation(); handleUpdateProfile(); return false; } ); + $btnCancel.click(function(evt) { + evt.stopPropagation(); + navToAccount(); + return false; + }); + + $btnSubmit.click(function(evt) { + evt.stopPropagation(); + handleUpdateProfile(); + return false; + }); + $('#account-profile-content-scroller').on('submit', '#account-edit-email-form', function(evt) { evt.stopPropagation(); handleUpdateProfile(); return false; } ); $('#account-profile-content-scroller').on('click', '#account-change-avatar', function(evt) { evt.stopPropagation(); navToAvatar(); return false; } ); } diff --git a/web/app/assets/javascripts/accounts_profile_experience.js b/web/app/assets/javascripts/accounts_profile_experience.js index 2a212acd5..3e0b1efb6 100644 --- a/web/app/assets/javascripts/accounts_profile_experience.js +++ b/web/app/assets/javascripts/accounts_profile_experience.js @@ -13,6 +13,9 @@ var $instrumentSelector = null; var $userGenres = null; var profileUtils = context.JK.ProfileUtils; + var $btnCancel = $screen.find('#account-edit-profile-cancel'); + var $btnBack = $screen.find('#account-edit-profile-back'); + var $btnSubmit = $screen.find('#account-edit-profile-submit'); function beforeShow(data) { } @@ -118,9 +121,23 @@ } function events() { - $screen.find('#account-edit-profile-cancel').on('click', function(evt) { evt.stopPropagation(); navigateTo('/client#/profile/' + context.JK.currentUserId); return false; } ); - $screen.find('#account-edit-profile-back').on('click', function(evt) { evt.stopPropagation(); navigateTo('/client#/account/profile/'); return false; } ); - $screen.find('#account-edit-profile-submit').on('click', function(evt) { evt.stopPropagation(); handleUpdateProfile(); return false; } ); + $btnCancel.click(function(evt) { + evt.stopPropagation(); + navigateTo('/client#/profile/' + context.JK.currentUserId); + return false; + }); + + $btnBack.click(function(evt) { + evt.stopPropagation(); + navigateTo('/client#/account/profile/'); + return false; + }); + + $btnSubmit.click(function(evt) { + evt.stopPropagation(); + handleUpdateProfile(); + return false; + }); } function renderExperience() { diff --git a/web/app/assets/javascripts/accounts_profile_interests.js b/web/app/assets/javascripts/accounts_profile_interests.js index 2edbf5f59..6d8ccd40b 100644 --- a/web/app/assets/javascripts/accounts_profile_interests.js +++ b/web/app/assets/javascripts/accounts_profile_interests.js @@ -3,7 +3,7 @@ "use strict"; context.JK = context.JK || {}; - context.JK.AccountProfileInterests= function(app) { + context.JK.AccountProfileInterests = function(app) { var $document = $(document); var logger = context.JK.logger; var EVENTS = context.JK.EVENTS; @@ -154,7 +154,7 @@ function bindGenreSelector(type, $btnSelect, $genreList) { $btnSelect.unbind('click').click(function(evt) { - evt.stopPropagation(); + evt.preventDefault(); var genreText = $genreList.html(); var genres = []; if (genres !== NONE_SPECIFIED) { @@ -164,6 +164,8 @@ ui.launchGenreSelectorDialog(type, genres, function(selectedGenres) { $genreList.html(selectedGenres && selectedGenres.length > 0 ? selectedGenres.join(GENRE_LIST_DELIMITER) : NONE_SPECIFIED); }); + + return false; }); } @@ -175,9 +177,23 @@ bindGenreSelector('free sessions', $btnFreeSessionsGenreSelect, $freeSessionsGenreList); bindGenreSelector('co-writing', $btnCowritingGenreSelect, $cowritingGenreList); - $btnCancel.on('click', function(evt) { evt.stopPropagation(); navigateTo('/client#/profile/' + context.JK.currentUserId); return false; } ); - $btnBack.on('click', function(evt) { evt.stopPropagation(); navigateTo('/client#/account/profile/experience'); return false; } ); - $btnSubmit.on('click', function(evt) { evt.stopPropagation(); handleUpdateProfile(); return false; } ); + $btnCancel.click(function(evt) { + evt.stopPropagation(); + navigateTo('/client#/profile/' + context.JK.currentUserId); + return false; + }); + + $btnBack.click(function(evt) { + evt.stopPropagation(); + navigateTo('/client#/account/profile/experience'); + return false; + }); + + $btnSubmit.click(function(evt) { + evt.stopPropagation(); + handleUpdateProfile(); + return false; + }); context.JK.dropdown($virtualBandCommitment); context.JK.dropdown($traditionalBandCommitment); diff --git a/web/app/assets/javascripts/accounts_profile_samples.js b/web/app/assets/javascripts/accounts_profile_samples.js index e69de29bb..0131f49e4 100644 --- a/web/app/assets/javascripts/accounts_profile_samples.js +++ b/web/app/assets/javascripts/accounts_profile_samples.js @@ -0,0 +1,70 @@ +(function(context,$) { + + "use strict"; + + context.JK = context.JK || {}; + context.JK.AccountProfileSamples = function(app) { + var $document = $(document); + var logger = context.JK.logger; + var EVENTS = context.JK.EVENTS; + var api = context.JK.Rest(); + var ui = new context.JK.UIHelper(JK.app); + var user = {}; + var profileUtils = context.JK.ProfileUtils; + + var $screen = $('#account-profile-samples'); + var $btnAddJkRecording = $screen.find('') + + function beforeShow(data) { + } + + function afterShow(data) { + renderSamples(); + } + + function renderSamples() { + + } + + function events() { + $btnAddJkRecording.click(function(evt) { + evt.preventDefault(); + ui.launchRecordingSelectorDialog('', function(selectedRecordings) { + + }); + + return false; + }); + + $btnAddSoundCloudRecording.click(function(evt) { + + }); + + $btnAddYouTubeVideo.click(function(evt) { + + }); + + $btnSaveAndFinish.click(function(evt) { + $document.triggerHandler(EVENTS.USER_UPDATED, response); + context.location = "/client#/profile/" + context.JK.currentUserId; + }); + } + + function initialize() { + var screenBindings = { + 'beforeShow': beforeShow, + 'afterShow': afterShow + }; + + app.bindScreen('account/profile/samples', screenBindings); + + events(); + } + + this.initialize = initialize; + this.beforeShow = beforeShow; + this.afterShow = afterShow; + return this; + }; + +})(window,jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/dialog/genreSelectorDialog.js b/web/app/assets/javascripts/dialog/genreSelectorDialog.js index 78f8c08dc..f72634d0c 100644 --- a/web/app/assets/javascripts/dialog/genreSelectorDialog.js +++ b/web/app/assets/javascripts/dialog/genreSelectorDialog.js @@ -57,7 +57,7 @@ function events() { $btnSelect.click(function(evt) { - + evt.preventDefault(); var selectedGenres = []; $genres.find('input[type=checkbox]:checked').each(function(index) { selectedGenres.push($(this).val()); @@ -69,6 +69,8 @@ app.layout.closeDialog(dialogId); + return false; + }); } diff --git a/web/app/assets/javascripts/dialog/recordingSelector.js b/web/app/assets/javascripts/dialog/recordingSelectorDialog.js similarity index 100% rename from web/app/assets/javascripts/dialog/recordingSelector.js rename to web/app/assets/javascripts/dialog/recordingSelectorDialog.js diff --git a/web/app/assets/javascripts/ui_helper.js b/web/app/assets/javascripts/ui_helper.js index ed0621e8e..bdebf103d 100644 --- a/web/app/assets/javascripts/ui_helper.js +++ b/web/app/assets/javascripts/ui_helper.js @@ -68,6 +68,12 @@ return genreSelectorDialog.showDialog(); } + function launchRecordingSelectorDialog(recordings, callback) { + var recordingSelectorDialog = new JK.RecordingSelectorDialog(JK.app, recordings, callback); + recordingSelectorDialog.initialize(); + return recordingSelectorDialog.showDialog(); + } + this.addSessionLike = addSessionLike; this.addRecordingLike = addRecordingLike; this.launchCommentDialog = launchCommentDialog; @@ -77,6 +83,7 @@ this.launchRsvpCreateSlotDialog = launchRsvpCreateSlotDialog; this.launchSessionStartDialog = launchSessionStartDialog; this.launchGenreSelectorDialog = launchGenreSelectorDialog; + this.launchRecordingSelectorDialog = launchRecordingSelectorDialog; return this; }; diff --git a/web/app/assets/stylesheets/dialogs/recordingSelector.css.scss b/web/app/assets/stylesheets/dialogs/recordingSelectorDialog.css.scss similarity index 100% rename from web/app/assets/stylesheets/dialogs/recordingSelector.css.scss rename to web/app/assets/stylesheets/dialogs/recordingSelectorDialog.css.scss diff --git a/web/app/views/clients/_account_profile_samples.html.erb b/web/app/views/clients/_account_profile_samples.html.erb index e69de29bb..bb2d80636 100644 --- a/web/app/views/clients/_account_profile_samples.html.erb +++ b/web/app/views/clients/_account_profile_samples.html.erb @@ -0,0 +1,223 @@ +