Merge branch 'pr/1387'

Conflicts:
	app/views/editor/level/LevelEditView.coffee
This commit is contained in:
Michael Schmatz 2014-07-25 19:17:16 -07:00
commit d7cb76d10c
4 changed files with 14 additions and 6 deletions

View file

@ -1,4 +1,4 @@
extends /templates/base
//extends /templates/base
block content

View file

@ -33,7 +33,8 @@ block header
- var patches = level.get('patches')
if patches && patches.length
span.badge= patches.length
li
a(href="#docs-components-view", data-toggle="tab", data-i18n="editor.level_tab_docs") Documentation
.navbar-header
span.navbar-brand #{level.attributes.name}
@ -120,6 +121,8 @@ block outer_content
div.tab-pane#editor-level-patches
.patches-view
div.tab-pane#docs-components-view
div#error-view
block footer

View file

@ -1,4 +1,5 @@
RootView = require 'views/kinds/RootView'
#RootView = require 'views/kinds/RootView'
CocoView = require 'views/kinds/CocoView'
template = require 'templates/docs/components'
CocoCollection = require 'collections/CocoCollection'
LevelComponent = require 'models/LevelComponent'
@ -7,15 +8,16 @@ class ComponentDocsCollection extends CocoCollection
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
model: LevelComponent
module.exports = class ComponentDocumentationView extends RootView
module.exports = class ComponentDocumentationView extends CocoView
id: 'docs-components-view'
template: template
className: 'tab-pane'
constructor: (options) ->
super(options)
@componentDocs = new ComponentDocsCollection()
@supermodel.loadCollection @componentDocs, 'components'
onLoaded: ->
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)
@ -35,4 +37,4 @@ module.exports = class ComponentDocumentationView extends RootView
c.language = 'javascript'
else
c.language = me.get('aceConfig').language
c
c

View file

@ -16,6 +16,7 @@ LevelForkView = require './modals/ForkLevelModal'
SaveVersionModal = require 'views/modal/SaveVersionModal'
PatchesView = require 'views/editor/PatchesView'
VersionHistoryView = require './modals/LevelVersionsModal'
ComponentDocsView = require 'views/docs/ComponentDocumentationView'
module.exports = class LevelEditView extends RootView
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['componentsTab'] = @insertSubView new ComponentsTabView supermodel: @supermodel
@subViews['systemsTab'] = @insertSubView new SystemsTabView supermodel: @supermodel
@subviews['componentsDocsTab'] = @insertSubView new ComponentDocsView supermodel: @supermodel
Backbone.Mediator.publish 'level-loaded', level: @level
@showReadOnly() if me.get('anonymous')
@patchesView = @insertSubView(new PatchesView(@level), @$el.find('.patches-view'))