mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 10:56:53 -05:00
f0fa88206d
* Refactor several related endpoints and views * Redesign EnrollmentView, add TeacherContactModal * Add "Enrollment Status" tab to TeacherClassView * Delete PurchaseCoursesView and related files * Style-flatten RemoveStudentModal * Fix error handling in ActivateLicensesModal * TeacherCoursesView loads faster by only loading course campaigns, and not load prepaids
19 lines
564 B
CoffeeScript
19 lines
564 B
CoffeeScript
CocoModel = require './CocoModel'
|
|
|
|
module.exports = class StripeCoupon extends CocoModel
|
|
@className: 'StripeCoupon'
|
|
@schema: {}
|
|
urlRoot: '/stripe/coupons'
|
|
idAttribute: 'id'
|
|
|
|
formatString: ->
|
|
bits = [@id]
|
|
if @get('percent_off')
|
|
bits.push "(#{@get('percent_off')}% off)"
|
|
else if @get('amount_off')
|
|
bits.push "($#{@get('amount_off')} off)"
|
|
if @get('duration')
|
|
bits.push "(duration: #{@get('duration')})"
|
|
if @redeem_by
|
|
bits.push "(redeem by: #{moment(@get('redeem_by')).format('lll')}"
|
|
return bits.join(' ')
|