Merge pull request #3168 from Imperadeiro98/use-view
Refactor to use view in template for issue #3138
This commit is contained in:
commit
8b00c38350
12 changed files with 16 additions and 50 deletions
app
templates
views
|
@ -2,7 +2,7 @@ extends /templates/core/modal-base
|
|||
|
||||
block modal-header-content
|
||||
h3 Applicant Code for
|
||||
span.spl= session.get('levelName')
|
||||
span.spl= view.session.get('levelName')
|
||||
|
||||
block modal-body-content
|
||||
.level-session-code-view
|
||||
|
|
|
@ -7,7 +7,7 @@ block content
|
|||
.center
|
||||
img(src="/images/pages/careers/recruiting.png")
|
||||
|
||||
if position === 'software-engineer'
|
||||
if view.position === 'software-engineer'
|
||||
h1.center Software Engineer
|
||||
+company-blurb
|
||||
|
||||
|
@ -46,7 +46,7 @@ block content
|
|||
|
||||
+next-steps
|
||||
|
||||
else if position === 'software-engineer-ios'
|
||||
else if view.position === 'software-engineer-ios'
|
||||
h1.center Software Engineer, iOS
|
||||
+company-blurb
|
||||
|
||||
|
@ -64,7 +64,7 @@ block content
|
|||
|
||||
+next-steps
|
||||
|
||||
else if position === 'game-designer'
|
||||
else if view.position === 'game-designer'
|
||||
h1.center Game Designer
|
||||
+company-blurb
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ block modal-header-content
|
|||
h3 Save Changes to Campaign
|
||||
|
||||
block modal-body-content
|
||||
if !modelsToSave.models.length
|
||||
if !view.modelsToSave.models.length
|
||||
.alert.alert-info(data-i18n="delta.no_changes") No changes
|
||||
|
||||
for model in modelsToSave.models
|
||||
for model in view.modelsToSave.models
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
span.panel-title.spr= model.get('name')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extends /templates/core/modal-base
|
||||
|
||||
block modal-header-content
|
||||
if nonUserCodeProblem
|
||||
if view.options.nonUserCodeProblem
|
||||
h3(data-i18n="play_level.non_user_code_problem_title") Unable to Load Level
|
||||
else
|
||||
h3(data-i18n="play_level.infinite_loop_title") Infinite Loop Detected
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
h4
|
||||
span(data-i18n="play_level.tome_select_a_thang") Select Someone for
|
||||
code #{spell.name}(#{(spell.parameters || []).join(", ")})
|
||||
span.spr(data-i18n="play_level.tome_select_a_thang") Select Someone for
|
||||
code #{view.spell.name}(#{(view.spell.parameters || []).join(", ")})
|
||||
|
|
|
@ -7,8 +7,3 @@ module.exports = class CareersView extends RootView
|
|||
|
||||
constructor: (options, @position) ->
|
||||
super options
|
||||
|
||||
getRenderData: ->
|
||||
context = super()
|
||||
context.position = @position
|
||||
context
|
||||
|
|
|
@ -13,11 +13,6 @@ module.exports = class SaveCampaignModal extends ModalView
|
|||
constructor: (options, @modelsToSave) ->
|
||||
super(options)
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.modelsToSave = @modelsToSave
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
@$el.find('.delta-view').each((i, el) =>
|
||||
$el = $(el)
|
||||
|
|
|
@ -9,8 +9,3 @@ module.exports = class InfiniteLoopModal extends ModalView
|
|||
'click #restart-level-infinite-loop-retry-button': -> Backbone.Mediator.publish 'tome:cast-spell', {}
|
||||
'click #restart-level-infinite-loop-confirm-button': -> Backbone.Mediator.publish 'level:restart', {}
|
||||
'click #restart-level-infinite-loop-comment-button': -> Backbone.Mediator.publish 'tome:comment-my-code', {}
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.nonUserCodeProblem = @options.nonUserCodeProblem
|
||||
c
|
||||
|
|
|
@ -13,12 +13,6 @@ module.exports = class SpellListEntryThangsView extends CocoView
|
|||
@spell = options.spell
|
||||
@avatars = []
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super context
|
||||
context.thangs = @thangs
|
||||
context.spell = @spell
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
avatar.destroy() for avatar in @avatars if @avatars
|
||||
|
|
|
@ -11,10 +11,6 @@ module.exports = class SaveLoadView extends CocoView
|
|||
events:
|
||||
'change #save-granularity-toggle input': 'onSaveGranularityChanged'
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@ module.exports = class PlaySettingsModal extends ModalView
|
|||
constructor: (options) ->
|
||||
super options
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
return unless @supermodel.finished()
|
||||
|
|
|
@ -12,11 +12,6 @@ module.exports = class JobProfileCodeModal extends ModalView
|
|||
super(arguments...)
|
||||
@session = options.session
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.session = @session
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
codeView = new LevelSessionCodeView({session:@session})
|
||||
|
|
Reference in a new issue