VRFS-4066 VRFS-4044 bugs fixed

This commit is contained in:
Seth Call 2016-05-18 23:03:22 -05:00
parent 94397136d3
commit 397be9ab14
8 changed files with 92 additions and 15 deletions

View File

@ -1676,7 +1676,7 @@ module JamRuby
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
email = @student.email
@subject = "Your lesson with #{@student.first_name} on JamKazam is starting soon"
@subject = "Your lesson with #{@teacher.first_name} on JamKazam is starting soon"
unique_args = {:type => "send_starting_notice_student"}
sendgrid_category "Notification"

View File

@ -265,11 +265,12 @@
"shoppingCart", "checkoutPayment", "checkoutOrder", "redeemComplete", "checkoutComplete",
"teachers/setup/introduction", "teachers/setup/basics", "teachers/setup/experience", "teachers/setup/pricing",
"account/profile", "account/profile/experience", "account/profile/interests", "account/profile/samples",
"jamclass"]
"jamclass", "jamclass/searchOptions", "teachers/search", "profile/teacher", "jamclass/test-drive-selection", "jamclass/book-lesson"]
$(document).on(context.JK.EVENTS.SCREEN_CHANGED, function(e, data) {
var show = false;
console.log("data.newScreen", data.newScreen)
if (data.newScreen && activate.indexOf(data.newScreen) > -1) {
show = true;
}

View File

@ -2,6 +2,7 @@ context = window
rest = context.JK.Rest()
logger = context.JK.logger
SessionActions = context.SessionActions
UserStore = context.UserStore
LessonTimerStore = context.LessonTimerStore
LessonTimerActions = context.LessonTimerActions
@ -81,7 +82,7 @@ LessonTimerActions = context.LessonTimerActions
@cancelLesson(lesson)
# @@app.layout.showDialog('cancel-lesson-dialog', {d1: lessonId})
else if data.lessonAction == 'join'
window.location.href = '/client#/session/' + lesson.music_session.id
SessionActions.enterSession(lesson.music_session.id)
else if data.lessonAction == 'reschedule'
@rescheduleLesson(lesson)
else if data.lessonAction == 'start-5-min'
@ -337,7 +338,7 @@ LessonTimerActions = context.LessonTimerActions
joinLessonNow: (lesson, e) ->
e.preventDefault();
window.location.href = '/client#/session/' + lesson.music_session.id
SessionActions.enterSession(lesson.music_session.id)
render: () ->
disabled = @state.updating
@ -437,7 +438,7 @@ LessonTimerActions = context.LessonTimerActions
else if lessonData.times.initialWindow
minutes = -lessonData.times.until.minutes
if minutes == 1
if minutes == 1 || minutes == 0
timeStmt = `<span>This lesson just started. <a onClick={this.joinLessonNow.bind(this, lessonData)}>join lesson now</a></span>`
else
timeStmt = `<span>Started {minutes} minutes ago. <a onClick={this.joinLessonNow.bind(this, lessonData)}>join lesson now</a></span>`

View File

@ -266,7 +266,7 @@ rest = context.JK.Rest()
rest.legacyCreateSession(data).done((response) =>
newSessionId = response.id
context.JK.SessionUtils.setAutoOpenJamTrack(jamTrack) # so that the session screen will pick this up
context.location = '/client#/session/' + newSessionId
context.SessionActions.enterSession(newSessionId)
# Re-loading the session settings will cause the form to reset with the right stuff in it.
# This is an extra xhr call, but it keeps things to a single codepath
#loadSessionSettings()

View File

@ -214,7 +214,7 @@ ProfileActions = @ProfileActions
summary = ''
if searchOptions.onlyMySchool
summary += "my school teachers only"
summary += "From My School Only"
instruments = searchOptions.instruments
if instruments? && instruments.length > 0
@ -222,7 +222,9 @@ ProfileActions = @ProfileActions
bit = "Instrument = #{InstrumentStore.display(instruments[0])}"
else
instruments.length > 1
bit = "Instruments = #{InstrumentStore.display(instruments[0])}..."
bit = "Instruments = #{InstrumentStore.display(instruments[0])} ... "
if summary.length > 0
summary += ', '
summary += " #{bit}"
subjects = searchOptions.subjects
@ -231,7 +233,9 @@ ProfileActions = @ProfileActions
bit = "Subject = #{SubjectStore.display(subjects[0])}"
else
subjects.length > 1
bit = "Subjects = #{SubjectStore.display(subjects[0])}..."
bit = "Subjects = #{SubjectStore.display(subjects[0])} ... "
if summary.length > 0
summary += ', '
summary += " #{bit}"
genres = searchOptions.genres
@ -240,18 +244,61 @@ ProfileActions = @ProfileActions
bit = "Genre = #{GenreStore.display(genres[0])}"
else
genres.length > 1
bit = "Genres = #{GenreStore.display(genres[0])}..."
bit = "Genres = #{GenreStore.display(genres[0])} ... "
if summary.length > 0
summary += ', '
summary += " #{bit}"
languages = searchOptions.languages
if languages? && languages.length > 0
if languages.length == 1
bit = "Genre = #{LanguageStore.display(languages[0])}"
bit = "Language = #{LanguageStore.display(languages[0])}"
else
languages.length > 1
bit = "Genres = #{LanguageStore.display(languages[0])}..."
bit = "Languages = #{LanguageStore.display(languages[0])} ... "
if summary.length > 0
summary += ', '
summary += " #{bit}"
if searchOptions.teaches_beginner || searchOptions.teaches_intermediate || searchOptions.teaches_advanced
bit = "Teaches "
qualifier = ''
if searchOptions.teaches_beginner
qualifier += "Beginner"
if searchOptions.teaches_intermediate
if qualifier.length > 0
qualifier += ", "
qualifier += "Intermediate"
if searchOptions.teaches_advanced
if qualifier.length > 0
qualifier += ", "
qualifier += "Advanced"
if summary.length > 0
summary += ', '
summary += " #{bit}#{qualifier}"
if searchOptions.student_age?
if summary.length > 0
summary += ', '
summary += "Student Age = #{searchOptions.student_age}"
if searchOptions.years_teaching?
if summary.length > 0
summary += ', '
summary += "Years Teaching = #{searchOptions.years_teaching}"
if searchOptions.location?.country?
if summary.length > 0
summary += ', '
summary += "Country = #{searchOptions.location.country}"
if searchOptions.location?.region?
if summary.length > 0
summary += ', '
summary += "Region = #{searchOptions.location.region}"
if summary.length == 0
summary = 'all teachers'
@ -309,11 +356,13 @@ ProfileActions = @ProfileActions
<div className="screen-content">
<div className="header">
<a href="/client#/home">JamKazam Home</a>&nbsp;:&nbsp;
<a href="/client#/jamclass">JamClass Home</a>&nbsp;:&nbsp;
<a className="teacher-search-options" href="/client#/jamclass/searchOptions" >Teachers Search</a>&nbsp;:&nbsp;
<a href="/client#/jamclass">JamClass Home</a>&nbsp;:&nbsp;
<a className="teacher-search-options" href="/client#/jamclass/searchOptions" >Teachers Search</a><span className="teacher-quote"> :</span>
<span className="search-results-options">
<span className="search-description">
<span className="results-text">Search Results / </span>
<span className="search-summary">{searchDesc}</span>
</span>
</span>
</div>
<div className="results">

View File

@ -1,6 +1,7 @@
context = window
@SessionActions = Reflux.createActions({
enterSession: {}
joinSession: {}
leaveSession: {}
mixersChanged: {}

View File

@ -593,6 +593,12 @@ ConfigureTracksActions = @ConfigureTracksActions
)
.fail(@app.ajaxError)
onEnterSession: (sessionId) ->
if !context.JK.guardAgainstBrowser(@app)
return false;
window.location.href = '/client#/session/' + sessionId
onJoinSession: (sessionId) ->
# poke ShareDialog

View File

@ -10,12 +10,14 @@
}
.header {
height:20px;
margin-bottom:10px;
a {
font-size:16px;
text-decoration:underline;
margin-bottom:5px;
}
.search-results-options {
font-size:16px;
@ -106,6 +108,23 @@
padding-right: 31px;
margin-bottom: 20px;
}
.search-description {
white-space: nowrap;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align:middle;
}
.search-summary {
line-height:16px;
vertical-align: middle;
}
.result-text {
line-height:16px;
}
.teacher-quote {
margin-right: 5px;
}
}