mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-25 14:04:54 -05:00
Merge branch 'pr/1387'
Conflicts: app/views/editor/level/LevelEditView.coffee
This commit is contained in:
commit
d7cb76d10c
4 changed files with 14 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
extends /templates/base
|
//extends /templates/base
|
||||||
|
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
|
|
@ -33,7 +33,8 @@ block header
|
||||||
- var patches = level.get('patches')
|
- var patches = level.get('patches')
|
||||||
if patches && patches.length
|
if patches && patches.length
|
||||||
span.badge= patches.length
|
span.badge= patches.length
|
||||||
|
li
|
||||||
|
a(href="#docs-components-view", data-toggle="tab", data-i18n="editor.level_tab_docs") Documentation
|
||||||
.navbar-header
|
.navbar-header
|
||||||
span.navbar-brand #{level.attributes.name}
|
span.navbar-brand #{level.attributes.name}
|
||||||
|
|
||||||
|
@ -120,6 +121,8 @@ block outer_content
|
||||||
div.tab-pane#editor-level-patches
|
div.tab-pane#editor-level-patches
|
||||||
.patches-view
|
.patches-view
|
||||||
|
|
||||||
|
div.tab-pane#docs-components-view
|
||||||
|
|
||||||
div#error-view
|
div#error-view
|
||||||
|
|
||||||
block footer
|
block footer
|
|
@ -1,4 +1,5 @@
|
||||||
RootView = require 'views/kinds/RootView'
|
#RootView = require 'views/kinds/RootView'
|
||||||
|
CocoView = require 'views/kinds/CocoView'
|
||||||
template = require 'templates/docs/components'
|
template = require 'templates/docs/components'
|
||||||
CocoCollection = require 'collections/CocoCollection'
|
CocoCollection = require 'collections/CocoCollection'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
|
@ -7,15 +8,16 @@ class ComponentDocsCollection extends CocoCollection
|
||||||
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
|
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
|
||||||
model: LevelComponent
|
model: LevelComponent
|
||||||
|
|
||||||
module.exports = class ComponentDocumentationView extends RootView
|
module.exports = class ComponentDocumentationView extends CocoView
|
||||||
id: 'docs-components-view'
|
id: 'docs-components-view'
|
||||||
template: template
|
template: template
|
||||||
|
className: 'tab-pane'
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
super(options)
|
super(options)
|
||||||
@componentDocs = new ComponentDocsCollection()
|
@componentDocs = new ComponentDocsCollection()
|
||||||
@supermodel.loadCollection @componentDocs, 'components'
|
@supermodel.loadCollection @componentDocs, 'components'
|
||||||
|
|
||||||
onLoaded: ->
|
onLoaded: ->
|
||||||
console.log 'we have the components...', (c.get('name') for c in @componentDocs.models)
|
console.log 'we have the components...', (c.get('name') for c in @componentDocs.models)
|
||||||
console.log 'we have the attributes...', (c.attributes for c in @componentDocs.models)
|
console.log 'we have the attributes...', (c.attributes for c in @componentDocs.models)
|
||||||
|
@ -35,4 +37,4 @@ module.exports = class ComponentDocumentationView extends RootView
|
||||||
c.language = 'javascript'
|
c.language = 'javascript'
|
||||||
else
|
else
|
||||||
c.language = me.get('aceConfig').language
|
c.language = me.get('aceConfig').language
|
||||||
c
|
c
|
|
@ -16,6 +16,7 @@ LevelForkView = require './modals/ForkLevelModal'
|
||||||
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
SaveVersionModal = require 'views/modal/SaveVersionModal'
|
||||||
PatchesView = require 'views/editor/PatchesView'
|
PatchesView = require 'views/editor/PatchesView'
|
||||||
VersionHistoryView = require './modals/LevelVersionsModal'
|
VersionHistoryView = require './modals/LevelVersionsModal'
|
||||||
|
ComponentDocsView = require 'views/docs/ComponentDocumentationView'
|
||||||
|
|
||||||
module.exports = class LevelEditView extends RootView
|
module.exports = class LevelEditView extends RootView
|
||||||
id: 'editor-level-view'
|
id: 'editor-level-view'
|
||||||
|
@ -74,6 +75,8 @@ module.exports = class LevelEditView extends RootView
|
||||||
@subViews['scriptsTab'] = @insertSubView new ScriptsTabView world: @world, supermodel: @supermodel, files: @files
|
@subViews['scriptsTab'] = @insertSubView new ScriptsTabView world: @world, supermodel: @supermodel, files: @files
|
||||||
@subViews['componentsTab'] = @insertSubView new ComponentsTabView supermodel: @supermodel
|
@subViews['componentsTab'] = @insertSubView new ComponentsTabView supermodel: @supermodel
|
||||||
@subViews['systemsTab'] = @insertSubView new SystemsTabView supermodel: @supermodel
|
@subViews['systemsTab'] = @insertSubView new SystemsTabView supermodel: @supermodel
|
||||||
|
@subviews['componentsDocsTab'] = @insertSubView new ComponentDocsView supermodel: @supermodel
|
||||||
|
|
||||||
Backbone.Mediator.publish 'level-loaded', level: @level
|
Backbone.Mediator.publish 'level-loaded', level: @level
|
||||||
@showReadOnly() if me.get('anonymous')
|
@showReadOnly() if me.get('anonymous')
|
||||||
@patchesView = @insertSubView(new PatchesView(@level), @$el.find('.patches-view'))
|
@patchesView = @insertSubView(new PatchesView(@level), @$el.find('.patches-view'))
|
||||||
|
|
Loading…
Reference in a new issue