Add sale end date to year sub page

This commit is contained in:
Matt Lott 2015-08-26 15:22:56 -07:00
parent ea6bc6faf3
commit b6ddb41df6
4 changed files with 27 additions and 1 deletions

View file

@ -443,9 +443,11 @@
sale_button: "Sale!"
sale_button_title: "Save 35% when you purchase a 1 year subscription"
sale_click_here: "Click Here"
sale_ends: "Ends"
sale_feature_here: "Here's what you'll get:"
sale_feature4: "<strong>42,000 bonus gems</strong> awarded immediately!"
sale_continue: "Ready to continue adventuring?"
sale_limited_time: "Limited time offer!"
sale_new_heroes: "New heroes!"
sale_title: "Back to School Sale"
sale_view_button: "Buy 1 year subscription for"

View file

@ -7,5 +7,22 @@
font-size: 16px
.sale-blurb
font-size: 22px
.sale-ends
position: relative
left: 0px
top: 50px
font-size: 18px
line-height: 18px
background-color: red
color: white
margin: 0 7px
border-radius: 3px
padding: 6px
width: 200px
text-align: center
-ms-transform: rotate(330deg) /* IE 9 */
-moz-transform: rotate(330deg) /* Firefox */
-webkit-transform: rotate(330deg) /* Safari and Chrome */
-o-transform: rotate(330deg) /* Opera */
#pay-button
font-size: 18px

View file

@ -20,6 +20,12 @@ block content
if state === 'purchasing'
.alert.alert-info(data-i18n="account_invoices.purchasing")
else
div.sale-ends
if new Date() < saleEndDate
span.spr(data-i18n="subscribe.sale_ends")
span #{moment(saleEndDate).fromNow()}
else
span(data-i18n="subscribe.sale_limited_time")
h1.center(data-i18n="subscribe.sale_title")
p.center
img(src="/images/pages/account/subscription/teacher-banner.png")

View file

@ -11,6 +11,7 @@ module.exports = class SubscriptionSaleView extends RootView
id: "subscription-sale-view"
template: template
yearSaleAmount: 7900
saleEndDate: new Date('2015-09-05')
events:
'click #pay-button': 'onPayButton'
@ -34,13 +35,13 @@ module.exports = class SubscriptionSaleView extends RootView
c = super()
c.heroes = @heroes.models
c.payButtonText = @payButtonText
c.saleEndDate = @saleEndDate
c.state = @state
c.stateMessage = @stateMessage
c
onHeroesLoaded: ->
@formatHero hero for hero in @heroes.models
console.log @heroes.models
formatHero: (hero) ->
hero.name = utils.i18n hero.attributes, 'extendedName'