Don't pass in entire global config just for the aspect ratio.

Passing in the entire globalConfig object from the parent scope makes the graph
widget less reusable (closely tied to the structure of that global config) and
also makes it less clear what the graph really needs from it.

Since the aspect ratio is now passed as a copy through multiple scope
layers (dashboard -> graph -> graph_chart), we need to redraw the graphs
only after the corresponding Angular cycle has completely, so instead of
calling `redrawGraphs` when changing the ratio select, I call
`nextCycleRedraw` now.
Merge pull request #42 from prometheus/refactor/aspect-ratio-var

Don't pass in entire global config just for the aspect ratio.
Add template variables.

This adds a global settings option "Show template variables", which then
expands a pane allowing the user to define template variables to be
interpolated via the `{{varname}}` notation inside widget titles, graph
expressions, and frame URLs.
Allow encoding dashboard settings in the URL

This allows the URL hash to contain a Base64-encoded JSON object which is
read/written via Angular encoders/decoders. Currently, it is used by the
dashboard controller to read and merge `globalSettings` at page load, and to
store them back in the URL hash whenever `globalSettings` changes.

Additionally, the AngularJS "hashbang" part of the URL (see [1]) may
contain human-readable overrides for any template variables. Paths may
now look like this:

http://promdash-host/demo-dash#!?host=myhost&service=api#<base64-config>

Both hashbang parts of the URL are optional. Settings are overriden in
the following precedence (later ones override earlier settings):

- config retrieved from server, as saved previously
- config retrieved from base64 hash part of the URL
- template vars retrieved from the hashbang part of the URL

[1] http://docs.angularjs.org/img/guide/hashbang_vs_regular_url.jpg
Use $apply() in ngChanged to immediately propagate model changes.

Otherwise, if ngChanged was used to refresh after changes in frame URLs, the
frame was only reloaded after triggering a second AngularJS dirty checking
cycle.
Merge pull request #46 from prometheus/feature/variables

Add template variables and allow config passing via URL hash
Merge branch 'master' into graphite-resizing

Conflicts:
	app/assets/javascripts/angular/controllers/frame_ctrl.js
	app/assets/javascripts/angular/directives/frame.js.erb
	app/views/dashboards/show.html.erb