* VRF-3880 many teacher profile fixes

This commit is contained in:
Seth Call 2016-01-19 21:54:55 -06:00
parent 86ea959972
commit 4d8b8a38b6
5 changed files with 35 additions and 9 deletions

View File

@ -175,7 +175,7 @@
function _heartbeat() {
if (app.heartbeatActive) {
console.log("heartbeat active?: " + active)
//console.log("heartbeat active?: " + active)
var message = context.JK.MessageFactory.heartbeat(notificationLastSeen, notificationLastSeenAt, active);
notificationLastSeenAt = undefined;
notificationLastSeen = undefined;

View File

@ -130,6 +130,13 @@
// Blank value is valid:
return ""
}
clientValue = clientValue.trim()
// remove leading $ if present
if (clientValue.indexOf('$') == 0) {
clientValue = clientValue.substring(1)
}
var money = new Number(clientValue);
if(!context._.isNaN(money)) {
@ -137,7 +144,7 @@
}
else {
// restore original value to allow server to reject with validation error
money = clientValue;
money = '';
}
return money;
}

View File

@ -99,8 +99,14 @@ rest = window.JK.Rest()
captureCurrency: (e) ->
for minutes in [30, 45, 60, 90, 120]
pricePerLessonCents = context.JK.ProfileUtils.normalizeMoneyForSubmit($("[name='price_per_lesson_#{minutes}_cents']", @root).val())
pricePerMonthCents = context.JK.ProfileUtils.normalizeMoneyForSubmit($("[name='price_per_month_#{minutes}_cents']", @root).val())
lessonValue = $("[name='price_per_lesson_#{minutes}_cents']", @root).val()
monthlyValue = $("[name='price_per_month_#{minutes}_cents']", @root).val()
pricePerLessonCents = context.JK.ProfileUtils.normalizeMoneyForSubmit(lessonValue)
pricePerMonthCents = context.JK.ProfileUtils.normalizeMoneyForSubmit(monthlyValue)
console.log("minute #{minutes} lessonValue=#{lessonValue} monthlyValue=#{monthlyValue} pricePerLessonCents=#{pricePerLessonCents}, pricePerMonthCents=#{pricePerMonthCents}")
this.setState({
"price_per_lesson_#{minutes}_cents": pricePerLessonCents
@ -109,8 +115,8 @@ rest = window.JK.Rest()
displayLessonAmount = context.JK.ProfileUtils.normalizeMoneyForDisplay(pricePerLessonCents)
displayMonthAmount = context.JK.ProfileUtils.normalizeMoneyForDisplay(pricePerMonthCents)
$("[name='price_per_lesson_#{minutes}_cents']", @root).val(displayLessonAmount)
$("[name='price_per_month_#{minutes}_cents']", @root).val(displayMonthAmount)
#$("[name='price_per_lesson_#{minutes}_cents']", @root).val(displayLessonAmount)
#$("[name='price_per_month_#{minutes}_cents']", @root).val(displayMonthAmount)
navDestination: (instructions) ->
navTo=null
@ -201,7 +207,7 @@ rest = window.JK.Rest()
<label>{minutes} Minutes</label>
</div>
<div className="teacher-third-column inline per-lesson">
<input key={minutes}
<span className="money-type">$</span><input key={minutes}
name={pricePerLessonName}
ref={pricePerLessonName}
className={perLessonInputStyles}
@ -216,7 +222,7 @@ rest = window.JK.Rest()
</input>
</div>
<div className="teacher-third-column inline per-month">
<input key={minutes}
<span className="money-type">$</span><input key={minutes}
name={pricePerMonthName}
ref={pricePerMonthName}
className={perMonthInputStyles}

View File

@ -150,7 +150,6 @@
.video-container {
width: 100%;
padding-bottom: 53.33%;
}
.profile-instrument {

View File

@ -203,8 +203,22 @@
width: 33%;
float: left;
padding-right: 1em;
&.per-lesson, &.per-month {
input{
float:right;
width:calc(100% - 12px);
}
}
}
.money-type {
position: relative;
top: 4px;
}
table.form-table {
width: 100%;
margin-bottom: 1em;