* teacher profile musician profile QA'ed some
This commit is contained in:
parent
88afc1c272
commit
0d49744a7a
|
|
@ -48,6 +48,7 @@ module JamRuby
|
|||
|
||||
teacher = user.teacher
|
||||
teacher ||= user.build_teacher()
|
||||
teacher.user = user
|
||||
|
||||
teacher.website = params[:website] if params.key?(:website)
|
||||
teacher.biography = params[:biography] if params.key?(:biography)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ describe Teacher do
|
|||
|
||||
|
||||
it "with instruments" do
|
||||
teacher = user.build_teacher
|
||||
teacher = Teacher.build_teacher(user, {})
|
||||
teacher.instruments << instrument1
|
||||
teacher.instruments << instrument2
|
||||
teacher.save.should be_true
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@
|
|||
}
|
||||
|
||||
function afterShow(data) {
|
||||
if (window.ProfileStore.solo) {
|
||||
$btnSubmit.text('SAVE & RETURN TO PROFILE');
|
||||
}
|
||||
else {
|
||||
$btnSubmit.text('SAVE & NEXT');
|
||||
}
|
||||
resetForm();
|
||||
renderAccountProfile();
|
||||
}
|
||||
|
|
@ -224,12 +230,17 @@
|
|||
return false;
|
||||
});
|
||||
|
||||
$('#account-profile-content-scroller').on('click', '#account-change-avatar', function(evt) { evt.stopPropagation(); navToAvatar(); return false; } );
|
||||
$('#account-profile-content-scroller').on('click', '#account-change-avatar', function (evt) {
|
||||
evt.stopPropagation();
|
||||
navToAvatar();
|
||||
return false;
|
||||
});
|
||||
|
||||
enableSubmits();
|
||||
}
|
||||
|
||||
function renderAccountProfile() {
|
||||
|
||||
$.when(api.getUserProfile())
|
||||
.done(function (userDetail) {
|
||||
recentUserDetail = userDetail;
|
||||
|
|
@ -289,7 +300,11 @@
|
|||
return false;
|
||||
});
|
||||
$btnSubmit.removeClass("disabled");
|
||||
$('#account-profile-content-scroller').on('submit', '#account-edit-email-form', 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-edit-email-form").removeClass("disabled");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,14 @@
|
|||
}
|
||||
|
||||
function afterShow(data) {
|
||||
|
||||
if (window.ProfileStore.solo) {
|
||||
$btnBack.hide()
|
||||
$btnSubmit.text('SAVE & RETURN TO PROFILE');
|
||||
}
|
||||
else {
|
||||
$btnBack.show()
|
||||
$btnSubmit.text('SAVE & NEXT');
|
||||
}
|
||||
|
||||
resetForm();
|
||||
|
|
|
|||
|
|
@ -72,9 +72,11 @@
|
|||
function afterShow(data) {
|
||||
if (window.ProfileStore.solo) {
|
||||
$btnBack.hide()
|
||||
$btnSubmit.text('SAVE & RETURN TO PROFILE');
|
||||
}
|
||||
else {
|
||||
$btnBack.show()
|
||||
$btnSubmit.text('SAVE & NEXT');
|
||||
}
|
||||
|
||||
renderInterests()
|
||||
|
|
|
|||
|
|
@ -60,9 +60,11 @@
|
|||
function afterShow(data) {
|
||||
if (window.ProfileStore.solo) {
|
||||
$btnBack.hide()
|
||||
$btnSubmit.text('SAVE & RETURN TO PROFILE');
|
||||
}
|
||||
else {
|
||||
$btnBack.show()
|
||||
$btnSubmit.text('SAVE & FINISH');
|
||||
}
|
||||
|
||||
$.when(loadFn())
|
||||
|
|
@ -167,6 +169,10 @@
|
|||
}
|
||||
|
||||
function buildNonJamKazamEntry($sampleList, type, source) {
|
||||
|
||||
// remove anything that matches
|
||||
$sampleList.find('[data-recording-id=' + source.recording_id + ']').remove();
|
||||
|
||||
// TODO: this code is repeated in HTML file
|
||||
var recordingIdAttr = ' data-recording-id="' + source.recording_id + '" ';
|
||||
var recordingUrlAttr = ' data-recording-url="' + source.url + '" ';
|
||||
|
|
@ -395,7 +401,7 @@
|
|||
|
||||
|
||||
setTimeout(function() {
|
||||
urlValidator = new JK.SiteValidator('url', userNameSuccessCallback, userNameFailCallback, parent)
|
||||
urlValidator = new JK.SiteValidator('url', websiteSuccessCallback, userNameFailCallback, parent)
|
||||
urlValidator.init()
|
||||
|
||||
soundCloudValidator = new JK.SiteValidator('soundcloud', userNameSuccessCallback, userNameFailCallback, parent)
|
||||
|
|
@ -437,6 +443,13 @@
|
|||
$inputDiv.append("<span class='error-text'>Invalid username</span>").show();
|
||||
}
|
||||
|
||||
function websiteSuccessCallback($inputDiv) {
|
||||
$inputDiv.addClass('error');
|
||||
$inputDiv.find('.error-text').remove();
|
||||
$inputDiv.append("<span class='error-text'>Invalid URL</span>").show();
|
||||
}
|
||||
|
||||
|
||||
function soundCloudSuccessCallback($inputDiv) {
|
||||
siteSuccessCallback($inputDiv, soundCloudRecordingValidator, $soundCloudSampleList, 'soundcloud');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -604,11 +604,14 @@
|
|||
}
|
||||
|
||||
function getUserProfile(options) {
|
||||
if (!options) {
|
||||
options = {}
|
||||
}
|
||||
var id = getId(options);
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/api/users/" + id + "/profile",
|
||||
url: "/api/users/" + id + "/profile" + '?' + $.param(options),
|
||||
processData: false
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@
|
|||
|
||||
// buttons
|
||||
var $btnEdit = $screen.find('.edit-profile-btn');
|
||||
var $btnTeacherProfileEdit = $screen.find('.edit-teacher-profile-btn');
|
||||
var $btnTeacherProfileView = $screen.find('.view-teacher-profile-btn');
|
||||
var $btnAddFriend = $screen.find('#btn-add-friend');
|
||||
var $btnFollowUser = $screen.find('#btn-follow-user');
|
||||
var $btnMessageUser = $screen.find('#btn-message-user');
|
||||
|
|
@ -145,7 +147,7 @@
|
|||
user = null;
|
||||
decrementedFriendCountOnce = false;
|
||||
sentFriendRequest = false;
|
||||
userDefer = rest.getUserProfile({id: userId})
|
||||
userDefer = rest.getUserProfile({id: userId, show_teacher:true})
|
||||
.done(function (response) {
|
||||
user = response;
|
||||
configureUserType();
|
||||
|
|
@ -169,6 +171,10 @@
|
|||
return user.musician;
|
||||
}
|
||||
|
||||
function isTeacher() {
|
||||
return user.teacher;
|
||||
}
|
||||
|
||||
function isCurrentUser() {
|
||||
return userId === context.JK.currentUserId;
|
||||
}
|
||||
|
|
@ -200,6 +206,13 @@
|
|||
|
||||
if (isCurrentUser()) {
|
||||
$btnEdit.show();
|
||||
$btnTeacherProfileEdit.show();
|
||||
if(isTeacher()) {
|
||||
$btnTeacherProfileView.show();
|
||||
}
|
||||
else {
|
||||
$btnTeacherProfileView.hide();
|
||||
}
|
||||
$btnAddFriend.hide();
|
||||
$btnFollowUser.hide();
|
||||
$btnMessageUser.hide();
|
||||
|
|
@ -207,6 +220,8 @@
|
|||
configureFriendFollowersControls();
|
||||
|
||||
$btnEdit.hide();
|
||||
$btnTeacherProfileEdit.hide();
|
||||
$btnTeacherProfileView.show();
|
||||
$btnAddFriend.show();
|
||||
$btnFollowUser.show();
|
||||
$btnMessageUser.show();
|
||||
|
|
@ -258,6 +273,16 @@
|
|||
window.ProfileActions.startProfileEdit(null, false)
|
||||
return false;
|
||||
})
|
||||
$btnTeacherProfileEdit.click(function(e) {
|
||||
e.preventDefault()
|
||||
window.ProfileActions.startTeacherEdit(null, false)
|
||||
return false;
|
||||
})
|
||||
$btnTeacherProfileView.click(function(e) {
|
||||
e.preventDefault()
|
||||
context.location = '/client#/profile/teacher/' + context.JK.currentUserId;
|
||||
return false;
|
||||
})
|
||||
$btnEditBio.click(function(e) {
|
||||
e.preventDefault()
|
||||
window.ProfileActions.startProfileEdit(null, true)
|
||||
|
|
|
|||
|
|
@ -625,6 +625,7 @@ proficiencyDescriptionMap = {
|
|||
profileSelections = []
|
||||
|
||||
for tile, i in @TILES
|
||||
console.log("@state.selected", @state.selected, @state.selected == tile)
|
||||
classes = classNames({last: i == @TILES.length - 1, active: @state.selected == tile})
|
||||
|
||||
profileSelections.push(`<div className="profile-tile"><a className={classes}
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ rest = window.JK.Rest()
|
|||
|
||||
<div className="teacher-field" name="years_teaching">
|
||||
<label htmlFor="years-teaching-experience">Years Teaching Experience:</label>
|
||||
<input className="years-teaching-experience" name="years_teaching" ref ="years_teaching_experience" type="number" min="0" max="99" value={this.state.years_teaching} onChange={this.handleTextChange} placeholder="Select" />
|
||||
<input className="years-teaching-experience" name="years_teaching" ref ="years_teaching_experience" type="number" min="0" max="99" value={this.state.years_teaching} onChange={this.handleTextChange} />
|
||||
</div>
|
||||
|
||||
<div className="teacher-field" name="years_playing">
|
||||
<label htmlFor="teacher-playing-experience">Years Playing Experience:</label>
|
||||
<input className="years-playing-experience" name="years_playing" ref="years_playing_experience" type="number" min="0" max="99" value={this.state.years_playing} onChange={this.handleTextChange} placeholder="Select" />
|
||||
<input className="years-playing-experience" name="years_playing" ref="years_playing_experience" type="number" min="0" max="99" value={this.state.years_playing} onChange={this.handleTextChange} />
|
||||
</div>
|
||||
</div>
|
||||
<TeacherSetupNav hideBack={true} handleNav={this.handleNav}/>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ ProfileActions = @ProfileActions
|
|||
|
||||
render: () ->
|
||||
if window.ProfileStore.solo
|
||||
saveText = 'SAVE'
|
||||
saveText = 'SAVE & RETURN TO PROFILE'
|
||||
else
|
||||
if @props.last
|
||||
saveText = 'SAVE & FINISH'
|
||||
else
|
||||
saveText = 'SAVE & NEXT'
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ rest = window.JK.Rest()
|
|||
{priceRows}
|
||||
|
||||
<br className="clearall"/>
|
||||
<TeacherSetupNav handleNav={this.handleNav}></TeacherSetupNav>
|
||||
<TeacherSetupNav handleNav={this.handleNav} last={true}></TeacherSetupNav>
|
||||
</div>`
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -492,9 +492,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 1.05em;
|
||||
}
|
||||
}
|
||||
|
||||
#bands-screen {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,29 @@
|
|||
&.no-online-presence {
|
||||
display:block;
|
||||
}
|
||||
float:left;
|
||||
margin-right:20px;
|
||||
margin-top:20px;
|
||||
|
||||
&.bandcamp-presence img {
|
||||
|
||||
position:relative;
|
||||
top:9px;
|
||||
}
|
||||
|
||||
&.user-website img {
|
||||
position:relative;
|
||||
top:-5px;
|
||||
}
|
||||
}
|
||||
.performance-sample-option {
|
||||
margin-right:40px;
|
||||
a {
|
||||
display:block;
|
||||
}
|
||||
img {
|
||||
margin-bottom:5px;
|
||||
}
|
||||
}
|
||||
.instruments-holder {
|
||||
margin-bottom:20px;
|
||||
|
|
@ -78,6 +101,7 @@
|
|||
font-weight:600;
|
||||
font-size:18px;
|
||||
margin: 0px 0px 10px 0px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
|
|
|
|||
|
|
@ -124,6 +124,17 @@
|
|||
float:left;
|
||||
margin-right:20px;
|
||||
margin-top:20px;
|
||||
|
||||
&.bandcamp-presence img {
|
||||
|
||||
position:relative;
|
||||
top:9px;
|
||||
}
|
||||
|
||||
&.user-website img {
|
||||
position:relative;
|
||||
top:-5px;
|
||||
}
|
||||
}
|
||||
|
||||
.performance-sample-option {
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@
|
|||
}
|
||||
.add-experience-btn {
|
||||
width:80px;
|
||||
font-size:16px;
|
||||
font-size:12px;
|
||||
margin-right:0;
|
||||
}
|
||||
.teacher-third-column {
|
||||
|
|
@ -338,9 +338,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 1.05em;
|
||||
}
|
||||
|
||||
label.strong-label {
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ ApiUsersController < ApiController
|
|||
:online_presences, :performance_samples])
|
||||
.find(params[:id])
|
||||
|
||||
@show_teacher_profile = params[:show_teacher]
|
||||
|
||||
respond_with @profile, responder: ApiResponder, :status => 200
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -31,3 +31,9 @@ end
|
|||
child :musician_instruments => :instruments do
|
||||
attributes :description, :proficiency_level, :priority, :instrument_id
|
||||
end
|
||||
|
||||
if @show_teacher_profile && @profile && @profile.teacher
|
||||
node :teacher do
|
||||
partial("api_teachers/detail", :object => @profile.teacher)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
<div class="user-header">
|
||||
<h2 id="username"></h2>
|
||||
<%= link_to("EDIT PROFILE", '/client#/account/profile', :class => "button-orange edit-profile-btn") %>
|
||||
<%= link_to("EDIT TEACHER PROFILE", '/client#/profile/teachers/setup/introduction', :class => "button-orange edit-teacher-profile-btn") %>
|
||||
<%= link_to("VIEW TEACHER PROFILE", '/client#/profile/profile/teacher/ID', :class => "button-orange view-teacher-profile-btn") %>
|
||||
</div>
|
||||
|
||||
<!-- action buttons -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue