From: dsc Date: Thu, 8 Mar 2012 18:43:31 +0000 (-0800) Subject: Adds desc form; fixes some styling. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=790161ed3fd076fe6fdb057ab3373014ede2537a;p=kraken-ui.git Adds desc form; fixes some styling. --- diff --git a/lib/server/server.co b/lib/server/server.co index 4bf161b..5d29b1f 100755 --- a/lib/server/server.co +++ b/lib/server/server.co @@ -148,7 +148,7 @@ app.get '/preset/:slug', (req, res, next) -> # 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 diff --git a/lib/template/graph.jade b/lib/template/graph.jade index 9a3dd6b..74e403e 100644 --- a/lib/template/graph.jade +++ b/lib/template/graph.jade @@ -29,20 +29,24 @@ section.graph(id=graph_id) .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} + + p.help-block A description of the graph. .graph-data-pane.tab-pane(id="graph-#{graph_id}-data") .row-fluid diff --git a/lib/vis/vis-view.co b/lib/vis/vis-view.co index c72e94e..1927620 100644 --- a/lib/vis/vis-view.co +++ b/lib/vis/vis-view.co @@ -61,7 +61,7 @@ VisView = exports.VisView = BaseView.extend do # {{{ # 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 @@ -109,18 +109,18 @@ VisView = exports.VisView = BaseView.extend do # {{{ [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. diff --git a/www/css/graph.styl b/www/css/graph.styl index ebf30a3..fd8812c 100644 --- a/www/css/graph.styl +++ b/www/css/graph.styl @@ -3,6 +3,8 @@ section.graph position relative + max-width 900px + margin 0 auto * position relative @@ -174,9 +176,9 @@ section.graph z-index 2 width auto min-width 50px - min-height 1.5em + min-height 2em max-width none - line-height 1.5 + line-height 2 cursor pointer text-align center diff --git a/www/css/text.styl b/www/css/text.styl index 32134cc..3bcf9d7 100644 --- a/www/css/text.styl +++ b/www/css/text.styl @@ -7,7 +7,7 @@ $fonts_headers = "gotham rounded", "helvetica neue", helvetica, arial, sans-seri html, body font-family $fonts_body - font-size $font_size + // font-size $font_size line-height 1.5 color $body_text background-color $foot_bgcolor diff --git a/www/graph/edit.jade b/www/graph/edit.jade index 5033daa..73b1bf2 100644 --- a/www/graph/edit.jade +++ b/www/graph/edit.jade @@ -4,7 +4,6 @@ block title title Kraken: Graph Test Page append styles - mixin css('forms.css') mixin css('graph.css') mixin css('isotope.css')