VRFS-2701 wip current interests editing
This commit is contained in:
parent
948174f19a
commit
4e456bce41
|
|
@ -48,7 +48,7 @@
|
|||
description : instrument.description,
|
||||
id : instrument.id
|
||||
});
|
||||
$instrumentSelector.append(template)
|
||||
$instrumentSelector.append(template);
|
||||
});
|
||||
|
||||
// and fill in the proficiency for the instruments that the user can play
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
|
||||
function navigateTo(targetLocation) {
|
||||
resetForm();
|
||||
window.location = targetLocation;
|
||||
context.location = targetLocation;
|
||||
}
|
||||
|
||||
function handleUpdateProfile() {
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
genres: genres,
|
||||
skill_level: $scroller.find('select[name=skill_level]').val(),
|
||||
concert_count: $scroller.find('select[name=concert_count]').val(),
|
||||
studio_session_count: $scroller.find('select[name=studio_session_count]').val(),
|
||||
studio_session_count: $scroller.find('select[name=studio_session_count]').val()
|
||||
})
|
||||
.done(postUpdateProfileSuccess)
|
||||
.fail(postUpdateProfileFailure);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
(function(context,$) {
|
||||
|
||||
"use strict";
|
||||
|
||||
context.JK = context.JK || {};
|
||||
context.JK.AccountProfileInterests= function(app) {
|
||||
var $document = $(document);
|
||||
var logger = context.JK.logger;
|
||||
var EVENTS = context.JK.EVENTS;
|
||||
var api = context.JK.Rest();
|
||||
var userId;
|
||||
var user = {};
|
||||
var profileUtils = context.JK.ProfileUtils;
|
||||
|
||||
var $screen = $('#account-profile-interests');
|
||||
var $scroller = $screen.find('#account-profile-content-scroller');
|
||||
var $btnCancel = $scroller.find('#account-edit-profile-cancel');
|
||||
var $btnBack = $scroller.find('#account-edit-profile-back');
|
||||
var $btnSubmit = $scroller.find('#account-edit-profile-submit');
|
||||
|
||||
function beforeShow(data) {
|
||||
userId = data.id;
|
||||
}
|
||||
|
||||
function afterShow(data) {
|
||||
renderInterests();
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
$scroller.find('form .error-text').remove();
|
||||
$scroller.find('form .error').removeClass("error");
|
||||
}
|
||||
|
||||
function populateAccountProfile(userDetail) {
|
||||
|
||||
|
||||
context.JK.dropdown($('select', $scroller));
|
||||
}
|
||||
|
||||
function events() {
|
||||
console.log("HERE2");
|
||||
$btnCancel.on('click', function(evt) { evt.stopPropagation(); navigateTo('/client#/account'); 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; } );
|
||||
}
|
||||
|
||||
function renderInterests() {
|
||||
$.when(api.getUserProfile())
|
||||
.done(function(userDetailResponse) {
|
||||
var userDetail = userDetailResponse[0];
|
||||
populateAccountProfile(userDetail);
|
||||
});
|
||||
|
||||
context.JK.dropdown($('select'));
|
||||
}
|
||||
|
||||
function navigateTo(targetLocation) {
|
||||
console.log("HERE");
|
||||
context.location = targetLocation;
|
||||
}
|
||||
|
||||
function handleUpdateProfile() {
|
||||
resetForm();
|
||||
|
||||
api.updateUser({
|
||||
instruments: instruments,
|
||||
genres: genres,
|
||||
skill_level: $scroller.find('select[name=skill_level]').val(),
|
||||
concert_count: $scroller.find('select[name=concert_count]').val(),
|
||||
studio_session_count: $scroller.find('select[name=studio_session_count]').val()
|
||||
})
|
||||
.done(postUpdateProfileSuccess)
|
||||
.fail(postUpdateProfileFailure);
|
||||
}
|
||||
|
||||
function postUpdateProfileSuccess(response) {
|
||||
$document.triggerHandler(EVENTS.USER_UPDATED, response);
|
||||
context.location = "/client#/account/profile/samples";
|
||||
}
|
||||
|
||||
function postUpdateProfileFailure(xhr, textStatus, errorMessage) {
|
||||
|
||||
var errors = JSON.parse(xhr.responseText)
|
||||
|
||||
if(xhr.status == 422) {
|
||||
|
||||
}
|
||||
else {
|
||||
app.ajaxError(xhr, textStatus, errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
var screenBindings = {
|
||||
'beforeShow': beforeShow,
|
||||
'afterShow': afterShow
|
||||
};
|
||||
|
||||
app.bindScreen('account/profile/interests', screenBindings);
|
||||
|
||||
events();
|
||||
|
||||
$screen.iCheck({
|
||||
checkboxClass: 'icheckbox_minimal',
|
||||
radioClass: 'iradio_minimal',
|
||||
inheritClass: true
|
||||
});
|
||||
}
|
||||
|
||||
this.initialize = initialize;
|
||||
this.beforeShow = beforeShow;
|
||||
this.afterShow = afterShow;
|
||||
return this;
|
||||
};
|
||||
|
||||
})(window,jQuery);
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
@import "client/common.css.scss";
|
||||
|
||||
|
||||
#account-profile-interests {
|
||||
.interest {
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
a.help {
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
div.genres {
|
||||
width: 20%;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
a.select-genre {
|
||||
text-decoration: underline;
|
||||
font-size: 12px;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
span.genre-list {
|
||||
font-style: italic;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.interest-options {
|
||||
width: 30%;
|
||||
margin-bottom: 15px;
|
||||
|
||||
label {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
input[type=text].rate {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +1,17 @@
|
|||
<!-- Account Profile Screen -->
|
||||
<div layout="screen" id="account-profile-experience" layout-id="account/profile/experience" class="screen secondary">
|
||||
<!-- header -->
|
||||
<div class="content-head">
|
||||
<!-- icon -->
|
||||
<div class="content-icon">
|
||||
<%= image_tag "content/icon_account.png", {:width => 27, :height => 20} %>
|
||||
</div>
|
||||
<!-- section head text -->
|
||||
<h1>my account</h1>
|
||||
<%= render "screen_navigation" %>
|
||||
</div>
|
||||
<!-- end header -->
|
||||
|
||||
<!-- profile scrolling area -->
|
||||
<div class="content-body">
|
||||
<div id="account-profile-content-scroller" class="content-body-scroller account-content-scroller">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end content scrolling area -->
|
||||
</div>
|
||||
|
||||
<script type="text/template" id="template-account-profile-experience">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,222 @@
|
|||
<div layout="screen" id="account-profile-interests" layout-id="account/profile/interests" 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-interests-form">
|
||||
|
||||
<h2>edit profile: current interests</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="1" />
|
||||
</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="0" />
|
||||
</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">None specified</span>
|
||||
</div>
|
||||
|
||||
<div class="field left w35">
|
||||
<label>Play Commitment</label>
|
||||
<select name="virtual_play_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 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="1" />
|
||||
</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="0" />
|
||||
</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">None specified</span>
|
||||
</div>
|
||||
|
||||
<div class="field left w15">
|
||||
<label>Play Commitment</label>
|
||||
<select name="traditional_play_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 name="touring">
|
||||
<option value='1'>Yes</option>
|
||||
<option value='0'>No</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearall"/>
|
||||
|
||||
<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="1" />
|
||||
</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="0" />
|
||||
</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">None specified</span>
|
||||
</div>
|
||||
|
||||
<div class="field left w15">
|
||||
<label>Hourly Rate:</label>
|
||||
<input type="text" class="rate" name="hourly_rate" />
|
||||
</div>
|
||||
|
||||
<div class="field left w15">
|
||||
<label>Daily Rate:</label>
|
||||
<input type="text" class="rate" name="daily_rate" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearall"/>
|
||||
|
||||
<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="1" />
|
||||
</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="0" />
|
||||
</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">None specified</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearall"/>
|
||||
|
||||
<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="1" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="fcowriting-yes">Yes</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left w30">
|
||||
<div class="left w25">
|
||||
<input type="radio" name="cowriting" id="cowriting-no" value="0" />
|
||||
</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">None specified</span>
|
||||
</div>
|
||||
|
||||
<div class="field left w35">
|
||||
<label>Purpose</label>
|
||||
<select 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>
|
||||
<a id="account-edit-profile-back" class="button-grey">BACK</a>
|
||||
<a id="account-edit-profile-submit" class="button-orange">SAVE & NEXT</a>
|
||||
</div>
|
||||
|
||||
<div class="clearall"/>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -214,8 +214,8 @@
|
|||
var accountProfileExperience = new JK.AccountProfileExperience(JK.app);
|
||||
accountProfileExperience.initialize();
|
||||
|
||||
// var accountProfileInterests = new JK.AccountProfileInterests(JK.app);
|
||||
// accountProfileInterests.initialize();
|
||||
var accountProfileInterests = new JK.AccountProfileInterests(JK.app);
|
||||
accountProfileInterests.initialize();
|
||||
|
||||
// var accountProfileSamples = new JK.AccountProfileSamples(JK.app);
|
||||
// accountProfileSamples.initialize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue