mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
#3138: refactor PrepaidRedeemModal
This commit is contained in:
parent
9cb6e99942
commit
61ea013caf
2 changed files with 6 additions and 12 deletions
|
@ -1,19 +1,19 @@
|
|||
extends /templates/core/modal-base
|
||||
|
||||
block modal-header-content
|
||||
h3 Prepaid Code Details (#{ppc.get('code')})
|
||||
h3 Prepaid Code Details (#{view.ppc.get('code')})
|
||||
|
||||
block modal-body-content
|
||||
if redeemedOn
|
||||
p You redeemed this code: #{redeemedOn}
|
||||
if view.redeemedOn
|
||||
p You redeemed this code: #{view.redeemedOn}
|
||||
else
|
||||
if ppc.openSpots()
|
||||
p: strong Adds #{ppc.get('properties').months} month(s) to your current subscription.
|
||||
if view.ppc.openSpots()
|
||||
p: strong Adds #{view.ppc.get('properties').months} month(s) to your current subscription.
|
||||
p You can redeem this code.
|
||||
else
|
||||
p You cannot redeem this code.
|
||||
|
||||
block modal-footer-content
|
||||
button#close.btn.btn-primary(type="button", data-dismiss="modal") Cancel
|
||||
if !redeemedOn && ppc.openSpots() > 0
|
||||
if !view.redeemedOn && view.ppc.openSpots() > 0
|
||||
button#redeem.btn.btn-primary(type="button", data-dismiss="modal") Redeem Code To My Account
|
||||
|
|
|
@ -17,11 +17,5 @@ module.exports = class PrepaidRedeemModal extends ModalView
|
|||
hasRedeemed = @ppc.userHasRedeemed(me.get('_id'))
|
||||
@redeemedOn = new moment(hasRedeemed).calendar() if hasRedeemed
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.ppc = @ppc
|
||||
c.redeemedOn = @redeemedOn if @redeemedOn
|
||||
c
|
||||
|
||||
onRedeemClicked: ->
|
||||
@trigger 'confirm-redeem'
|
||||
|
|
Loading…
Reference in a new issue