mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-28 06:54:13 -04:00
Added the foundation of a component docs view.
This commit is contained in:
parent
86a3fbacd1
commit
12543cf4dd
3 changed files with 34 additions and 0 deletions
app
2
app/styles/docs/components.sass
Normal file
2
app/styles/docs/components.sass
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#docs-components-view
|
||||||
|
color: saddlebrown
|
6
app/templates/docs/components.jade
Normal file
6
app/templates/docs/components.jade
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
extends /templates/base
|
||||||
|
|
||||||
|
block content
|
||||||
|
ul
|
||||||
|
for component in components
|
||||||
|
li= component.get('name')
|
26
app/views/docs/components_view.coffee
Normal file
26
app/views/docs/components_view.coffee
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
RootView = require 'views/kinds/RootView'
|
||||||
|
template = require 'templates/docs/components'
|
||||||
|
CocoCollection = require 'collections/CocoCollection'
|
||||||
|
LevelComponent = require 'models/LevelComponent'
|
||||||
|
|
||||||
|
class ComponentDocsCollection extends CocoCollection
|
||||||
|
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation'
|
||||||
|
model: LevelComponent
|
||||||
|
|
||||||
|
module.exports = class UnnamedView extends RootView
|
||||||
|
id: 'docs-components-view'
|
||||||
|
template: template
|
||||||
|
|
||||||
|
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)
|
||||||
|
super()
|
||||||
|
|
||||||
|
getRenderData: ->
|
||||||
|
c = super()
|
||||||
|
c.components = @componentDocs.models
|
||||||
|
c
|
Loading…
Add table
Add a link
Reference in a new issue