Start recording commit message bodies in Commit objects

I'll be using this for the upcoming "Russian novel" easter egg.

Change-Id: I2f8445f062bee2039a9dc3d61372b93a44662f7d
Reviewed-on: https://gerrit.causes.com/26613
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add Flesch class

This also is in support of the upcoming "Russian novel" easter egg. This
class gives us a cheap approximation of the Flesch Reading Ease score[1]
which we will be deriving for commit messages.

[1]: http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_test

Change-Id: If4f4bbb8ef2b5d9edb7458d7da7937aa2ca7a2aa
Reviewed-on: https://gerrit.causes.com/26614
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add Team class

I'll be calling on this functionality presently to build the Russian
Novel easter egg.

Change-Id: I68e8956fc9e58d1ab98b7350264572880c09c7e4
Reviewed-on: https://gerrit.causes.com/26615
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add Russian novel easter egg

Accessible at /russian-novels, or via the "я" link in the global nav
bar, this page shows a bubble chart representing the Russianness of an
author's commit messages over the requested interval.

  - bubble size indicates overall Russianness (commit message length)
  - bubble text shows the author name
  - bubble hover shows detailed stats on Russianness, Flesch Reading
    Ease score (lower scores indicate harder-to-read commit messages)
    and author and team name
  - bubble color indicates team membership

This is a quick easter egg hacked together for fun, so I will probably
loop back later and clean up the overall placement of the code (as an
easter egg, it perhaps warrants being better encapsulated off somewhere
peripheral, rather than cluttering up the main Commit and CommitSet
classes).

Change-Id: Iaf7c374f913ed271fc16c674a68386c8126634ee
Reviewed-on: https://gerrit.causes.com/26616
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Don't leak variables into global context in /russian-novels

Change-Id: I148bdc686abe678d19b69cb43aee1ebe5dc168fa
Reviewed-on: https://gerrit.causes.com/26617
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Have D3 load JSON separately on /russian-novels

This allows us to render the page immediately, and then show the bubble
chart once we have the data for it.

For now, no progress or loading indicator is in place; I'll add that
shortly.

Change-Id: I26215c5d057059c7ac988c7641c92c5e9230c1be
Reviewed-on: https://gerrit.causes.com/26618
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Resize bubble chart to match window

Make the bubble chart as large as possible. This means that we try to
make the SVG fill up as much width as the `#bubble-chart` div has
available, but we don't ever go any wider than `window.innerHeight *
1.2`, because on very wide displays this would induce an awkward need to
scroll in order to see the entire chart.

Additionally, to make things look nice, center the chart.

Note that the dimensions are calculated once only, when the window is
first displayed. We don't make any attempt to recalculate on window
resize.

Change-Id: I6c30ab2b100fc3e6502982227a15695abdf03dda
Reviewed-on: https://gerrit.causes.com/26619
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add hover effect to bubble chart nodes

Change-Id: Id599d1cc3eb93b96b1a546b22a0a1b04b443df6a
Reviewed-on: https://gerrit.causes.com/26620
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Propagate "days" variable to server for JSON bubble chart data request

When we switched to pulling the JSON down asynchronously we effectively
broke the "days" variable.

Change-Id: Ic3d7a366e1de6eb44c718208357599678ec9290f
Reviewed-on: https://gerrit.causes.com/26621
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Remove useless/null data variable

This has been unused since the switch to async fetching of the JSON for
the bubble chart.

Change-Id: Ie66aa93a04d958bc08bae23c1f9835acbff71f6f
Reviewed-on: https://gerrit.causes.com/26622
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Display progress bar while loading bubble-chart

We are listening for progress events, but without streaming on the
server we're not really going to get any of those in a meaningful way
(especially because we can't start streaming the JSON until the entire
commit set machinery has finished its job).

So, we just throw up a crude indeterminate progress bar.

It's better than nothing.

Change-Id: Icb9d2b51f23013d1aa451254ed65d4e7129b8ed9
Reviewed-on: https://gerrit.causes.com/26623
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Show a Bootstrap alert on error while loading bubble chart

For now we're using some janky string-based jQuery client-side
templating. I'll come up with something cleaner for this later.

Change-Id: I8b6006cc7561022c1ce5809d58d934cce576b562
Reviewed-on: https://gerrit.causes.com/26624
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Fix minor alignment glitch

Change-Id: Iec7e3ba8fbede2d292cbbf325d2511f74f2c5ce2
Reviewed-on: https://gerrit.causes.com/26625
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Use terser syntax for clearing our chart area on error

Change-Id: I3a964765c525dd583b1b2de84bb87cb976a88863
Reviewed-on: https://gerrit.causes.com/26626
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Start using Bower to manage twigg-app dependencies

This commit switches over to Bower for all of twigg-app's front-end
dependencies, with the exception of replace.js, whose Bower-ification is
currently awaiting review here:

  https://gerrit.causes.com/26425

This means that d3, nvd3, jquery, bootstrap, and boostrap-glyphicons are
all being pulled down into the "bower_components" directory with `bower
install`. This will make updating easier than manually downloading and
placing new versions.

For now, replace.js has been manually copied over.

Note that `gem build` does the wrong thing if "public/vendor" is just a symlink to
"bower_components (it adds only normal files to the gem archive). We can
work around this by changing the direction of the symlink:
"public/vendor" is the real directory and "bower_components" is just a
symlink to it; `bower install` does the right thing.

One other minor thing to note: the bootstrap-glyphicons project doesn't
have any tags right now, so we have to point the "version" at
"gh-pages", which is the only branch in the repo.

Change-Id: I5eef3454cd04e067ea6b20a4dfebd83811e9a4e3
Reviewed-on: https://gerrit.causes.com/26627
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Make Russian novel bubbles links to corresponding author pages

The partial duplication of the routing logic in the JS (specifically,
the name-to-slug transformation logic) is a slight smell, but the
benefit is clear.

Change-Id: I5a5fa8ff2d819be7f04c8e43767880f830549a25
Reviewed-on: https://gerrit.causes.com/26628
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add Compass

As per the directions here:

  https://github.com/chriseppstein/compass/wiki/Sinatra-Integration

I didn't add the Haml configuration as that page suggests, because Haml
already outputs HTML5 by default.

This will be used in a future commit to make use of the "user-select"
mixin, and possibly later on, others as well.

Change-Id: I363cd302fcef48d515eb191fd05d7485fd57b77b
Reviewed-on: https://gerrit.causes.com/26629
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Make Russianness bubble text unselectable

This leads to a nicer user experience, because it means that accidental
dragging while clicking doesn't make the pretty bubbles looks ugly.

Change-Id: I1ba3f1ab3c035a0be2946b9ee5b69f8e83107093
Reviewed-on: https://gerrit.causes.com/26630
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Get rid of unnecessary excessive spacing

Change-Id: If98f4dd792b72408736c119218c75762e633ab8e
Reviewed-on: https://gerrit.causes.com/26631
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Remove dependency on nvd3

Replace the nvd3 bar chart with a pure-d3 implementation. This reduces
our dependency footprint and gives us finer-grained control over how
these things actually look. This first cut is a little crude, but it is
close to parity with what we had before. In developing this I took
pointers from:

  http://bl.ocks.org/mbostock/3885304
  http://jsfiddle.net/chrisJamesC/MmEjF/34/

Change-Id: Iac55f07737cd4a7b0ba22639037f4ffa4c5b48d9
Reviewed-on: https://gerrit.causes.com/26632
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>