# req.url += '.json'
next()
-app.get '/graph/:slug/?', (req, res, next) ->
+app.get '/graph(/:slug)?/?', (req, res, next) ->
{slug} = req.params
# console.log '/graph/:slug/?'
# console.log ' slug: ', slug
.graph-info-pane.tab-pane.active(id="graph-#{graph_id}-info")
.row-fluid
.half.control-group
- label.slug.control-label(for='slug') Slug
- .controls
- input.span3.slug(type='text', id='slug', name='slug', placeholder='graph_slug', value=slug)
- p.help-block The slug uniquely identifies this graph and will be displayed in the URL.
- .half.control-group
- .row-fluid
+ .control-group
+ label.slug.control-label(for='slug') Slug
+ .controls
+ input.span3.slug(type='text', id='slug', name='slug', placeholder='graph_slug', value=slug)
+ p.help-block The slug uniquely identifies this graph and will be displayed in the URL.
+ .control-group
+ label.width.control-label(for='width') Size
+ .controls
+ input.span1.width(type='text', id='width', name='width', value=width)
+ | ×
+ input.span1.height(type='text', id='height', name='height', value=height)
+ p.help-block Choosing 'auto' will size the graph to the viewport bounds.
.half.control-group
- label.width.control-label(for='width') Width
+ label.desc.control-label(for='desc') Description
.controls
- input.span1.width(type='text', id='width', name='width', value=width)
- p.help-block Choosing 'auto' will size the graph to the viewport bounds.
- .half.control-group
- label.height.control-label(for='height') Height
- .controls: input.span1.height(type='text', id='height', name='height', value=height)
+ //- textarea.span3.desc(id='desc', name='desc', placeholder='Graph description.') #{desc}
+ <textarea class="span3 desc" id="desc" name="desc" placeholder="Graph description.">#{desc}</textarea>
+ p.help-block A description of the graph.
.graph-data-pane.tab-pane(id="graph-#{graph_id}-data")
.row-fluid
# Note: can't debounce the method itself, as the debounce wrapper returns undefined
$ root .on 'resize', _.debounce(@resizeViewport, DEBOUNCE_RENDER)
- @id = _.domize 'graph', (@model.id or @model.cid)
+ @id = _.domize 'graph', (@model.get('slug', @model.id or @model.cid))
@model.on 'destroy', @remove, this
@model.on 'change', @render, this
[k, v, opts] = arguments
values = { "#k": v }
- options = @scaffold.collection
+ fields = @scaffold.collection
if values
for k, v in values
- options.get(k)?.setValue v, opts
+ fields.get(k)?.setValue v, opts
this
else
- opts = @model.toJSON({ -keepDefaults })?.options or {}
+ options = @model.toJSON({ -keepDefaults })?.options or {}
for k of @FILTER_CHART_OPTIONS
- # console.log "filter #k?", not opts[k]
- if k in opts and not opts[k]
- delete opts[k]
- opts
+ # console.log "filter #k?", not options[k]
+ if k in options and not options[k]
+ delete options[k]
+ options
/**
* Resizes chart according to the model's width and height.