Use view in template

This commit is contained in:
Imperadeiro98 2015-12-26 14:21:06 +00:00
parent bfeee90f51
commit b7ba677b00
8 changed files with 5 additions and 26 deletions

View file

@ -137,7 +137,7 @@ block content
span.spr Managed subscriptions are discontinued. Please contact
a(href='mailto:team@codecombat.com') team@codecombat.com
span.spl for more information.
.panel-body
if view.recipientSubs.nextPaymentAmount > 0 && view.recipientSubs.sponsorSub
h4(data-i18n="account.next_payment")

View file

@ -1,7 +1,7 @@
extends /templates/base
block header
if campaign.loading
if view.campaign.loading
nav.navbar.navbar-default(role='navigation')#campaign-editor-top-nav
.container-fluid
ul.nav.navbar-nav

View file

@ -5,8 +5,8 @@ block modal-header-content
block modal-body-content
div#normal-view
each sizeObject, size in presetSizes
each preset in presets
each sizeObject, size in view.presetSizes
each preset in view.presets
a(href="#")
div.choose-option(data-preset-type=preset.type, data-preset-size=size, style="background:url(/images/pages/editor/level/preset_"+preset.type+"_"+size+".jpg) no-repeat center; background-size: cover")
div.preset-size.name-label.capitalize

View file

@ -1 +1 @@
span.doc-title(data-property-name=doc.name)= doc.title
span.doc-title(data-property-name=view.doc.name)= view.doc.title

View file

@ -53,11 +53,6 @@ module.exports = class SubscriptionView extends RootView
@personalSub.update => @render?()
@recipientSubs.update => @render?()
getRenderData: ->
c = super()
c.emailValidator = @emailValidator
c
# Personal Subscriptions
onClickStartSubscription: (e) ->

View file

@ -144,11 +144,6 @@ module.exports = class CampaignEditorView extends RootView
super()
getRenderData: ->
c = super()
c.campaign = @campaign
c
onClickPatches: (e) ->
@patchesView = @insertSubView(new PatchesView(@campaign), @$el.find('.patches-view'))
@patchesView.load()

View file

@ -635,11 +635,5 @@ module.exports = class GenerateTerrainModal extends ModalView
getRandomThang: (thangList) ->
return thangList[_.random(0, thangList.length-1)]
getRenderData: ->
c = super()
c.presets = presets
c.presetSizes = presetSizes
c
onHidden: ->
location.reload() if @reloadOnClose

View file

@ -31,11 +31,6 @@ module.exports = class SpellPaletteEntryView extends CocoView
@doc.initialHTML = @docFormatter.formatPopover()
@aceEditors = []
getRenderData: ->
c = super()
c.doc = @doc
c
afterRender: ->
super()
@$el.addClass(@doc.type)