mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Set upper limit to max seats you can purchase at once
This commit is contained in:
parent
13b9d81e4c
commit
a10aec256f
2 changed files with 11 additions and 6 deletions
app
|
@ -78,11 +78,14 @@ block content
|
|||
br
|
||||
|
||||
p.text-center#price-form-group
|
||||
strong
|
||||
span(data-i18n="account_prepaid.purchase_total")
|
||||
span.spr : #{view.numberOfStudents}
|
||||
span(data-i18n="courses.enrollments")
|
||||
span.spl x $#{(view.pricePerStudent/100).toFixed(2)} = #{view.getPriceString()}
|
||||
if view.numberOfStudentsIsValid()
|
||||
strong
|
||||
span(data-i18n="account_prepaid.purchase_total")
|
||||
span.spr : #{view.numberOfStudents}
|
||||
span(data-i18n="courses.enrollments")
|
||||
span.spl x $#{(view.pricePerStudent/100).toFixed(2)} = #{view.getPriceString()}
|
||||
else
|
||||
strong Invalid number of students
|
||||
|
||||
p.text-center
|
||||
button#purchase-btn.btn.btn-lg.btn-success.uppercase(data-i18n="courses.purchase_now")
|
||||
|
|
|
@ -72,10 +72,12 @@ module.exports = class PurchaseCoursesView extends RootView
|
|||
|
||||
updatePrice: ->
|
||||
@renderSelectors '#price-form-group'
|
||||
|
||||
numberOfStudentsIsValid: -> @numberOfStudents > 0 and @numberOfStudents < 100000
|
||||
|
||||
onClickPurchaseButton: ->
|
||||
return @openModalView new AuthModal() if me.isAnonymous()
|
||||
if @numberOfStudents < 1 or not _.isFinite(@numberOfStudents)
|
||||
unless @numberOfStudentsIsValid()
|
||||
alert("Please enter the maximum number of students needed for your class.")
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue