VRFS-2701 VRFS-2699 wip performance samples edit screen

This commit is contained in:
Brian Smith 2015-03-21 10:04:46 -04:00
parent 299caa5b59
commit 9acb235a6d
14 changed files with 366 additions and 14 deletions

View File

@ -268,3 +268,4 @@ jam_track_redeemed.sql
connection_metronome.sql
preview_jam_track_tracks.sql
cohorts.sql
alter_genre_player_unique_constraint.sql

View File

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

View File

@ -18,6 +18,9 @@
var nilOptionStr = '<option value=""></option>';
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; } );
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,223 @@
<div layout="screen" id="account-profile-samples" layout-id="account/profile/samples" class="screen secondary">
<div class="content-head">
<div class="content-icon">
<%= image_tag "content/icon_account.png", {:width => 27, :height => 20} %>
</div>
<h1>my account</h1>
<%= render "screen_navigation" %>
</div>
<div class="content-body">
<div id="account-profile-content-scroller" class="content-body-scroller account-content-scroller">
<div class="content-wrapper account-profile">
<form id="account-edit-profile-samples-form">
<h2>edit profile: online presence &amp; performance samples</h2>
<div>
<div class="left interest-options">
<label>I would like to join a virtual band <a class="help">[?]</a></label>
<div class="left w30">
<div class="left w25">
<input type="radio" name="virtual_band" id="virtual-band-yes" value="true" />
</div>
<div>
<label for="virtual-band-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<input type="radio" name="virtual_band" id="virtual-band-no" value="false" />
</div>
<div>
<label for="virtual-band-no">No</label>
</div>
</div>
</div>
<div id="virtual-band-genres" class="left genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
<div class="field left w35">
<label>Play Commitment</label>
<select id="virtual-band-commitment" name="virtual_band_commitment">
<option value="1">infrequent</option>
<option value="2">once a week</option>
<option value="3">2-3 times a week</option>
<option value="4">4+ times a week</option>
</select>
</div>
</div>
<div class="clearall"></div>
<div>
<div class="left interest-options">
<label>I would like to join a traditional band <a class="help">[?]</a></label>
<div class="left w30">
<div class="left w25">
<input type="radio" name="traditional_band" id="traditional-band-yes" value="true" />
</div>
<div>
<label for="traditional-band-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<input type="radio" name="traditional_band" id="traditional-band-no" value="false" />
</div>
<div>
<label for="traditional-band-no">No</label>
</div>
</div>
</div>
<div id="traditional-band-genres" class="left genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
<div class="field left w15">
<label>Play Commitment</label>
<select id="traditional-band-commitment" name="traditional_band_commitment">
<option value="1">infrequent</option>
<option value="2">once a week</option>
<option value="3">2-3 times a week</option>
<option value="4">4+ times a week</option>
</select>
</div>
<div class="field left w10">
<label>Touring Option</label>
<select id="traditional-band-touring" name="touring">
<option value='1'>Yes</option>
<option value='0'>No</option>
</select>
</div>
</div>
<div class="clearall"></div>
<div>
<div class="left interest-options">
<label>I am available to play in paid sessions <a class="help">[?]</a></label>
<div class="left w30">
<div class="left w25">
<input type="radio" name="paid_sessions" id="paid-sessions-yes" value="true" />
</div>
<div>
<label for="paid-sessions-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<input type="radio" name="paid_sessions" id="paid-sessions-no" value="false" />
</div>
<div>
<label for="paid-sessions-no">No</label>
</div>
</div>
</div>
<div id="paid-sessions-genres" class="left genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
<div class="field left w15">
<label>Hourly Rate:</label>
<input type="text" class="rate" id="hourly-rate" name="paid_sessions_hourly_rate" />
</div>
<div class="field left w15">
<label>Daily Rate:</label>
<input type="text" class="rate" id="daily-rate" name="paid_sessions_daily_rate" />
</div>
</div>
<div class="clearall"></div>
<div>
<div class="left interest-options">
<label>I am available to play in free sessions <a class="help">[?]</a></label>
<div class="left w30">
<div class="left w25">
<input type="radio" name="free_sessions" id="free-sessions-yes" value="true" />
</div>
<div>
<label for="free-sessions-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<input type="radio" name="free_sessions" id="free-sessions-no" value="false" />
</div>
<div>
<label for="free-sessions-no">No</label>
</div>
</div>
</div>
<div id="free-sessions-genres" class="left genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
</div>
<div class="clearall"></div>
<div>
<div class="left interest-options">
<label>I would like to co-write with partner(s) <a class="help">[?]</a></label>
<div class="left w30">
<div class="left w25">
<input type="radio" name="cowriting" id="cowriting-yes" value="true" />
</div>
<div>
<label for="cowriting-yes">Yes</label>
</div>
</div>
<div class="left w30">
<div class="left w25">
<input type="radio" name="cowriting" id="cowriting-no" value="false" />
</div>
<div>
<label for="cowriting-no">No</label>
</div>
</div>
</div>
<div id="cowriting-genres" class="left genres">
<label>Desired Genre <a class="select-genre">select</a></label>
<span class="genre-list"></span>
</div>
<div class="field left w35">
<label>Purpose</label>
<select id="cowriting-purpose" name="cowriting_purpose">
<option value='1'>just for fun</option>
<option value='2'>sell music</option>
</select>
</div>
</div>
<br/><br/>
<div class="right field actions">
<a id="account-edit-profile-cancel" class="button-grey">CANCEL</a>&nbsp;&nbsp;
<a id="account-edit-profile-back" class="button-grey">BACK</a>&nbsp;&nbsp;
<a id="account-edit-profile-submit" class="button-orange">SAVE &amp; FINISH</a>
</div>
<div class="clearall"></div>
</form>
</div>
</div>
</div>
</div>

View File

@ -220,8 +220,8 @@
var accountProfileInterests = new JK.AccountProfileInterests(JK.app);
accountProfileInterests.initialize();
// var accountProfileSamples = new JK.AccountProfileSamples(JK.app);
// accountProfileSamples.initialize();
var accountProfileSamples = new JK.AccountProfileSamples(JK.app);
accountProfileSamples.initialize();
var accountAudioProfile = new JK.AccountAudioProfile(JK.app);
accountAudioProfile.initialize();

View File

@ -34,4 +34,5 @@
= render 'dialogs/adjustGearSpeedDialog'
= render 'dialogs/openJamTrackDialog'
= render 'dialogs/openBackingTrackDialog'
= render 'dialogs/genreSelectorDialog'
= render 'dialogs/genreSelectorDialog'
= render 'dialogs/recordingSelectorDialog'