Remove footnotes

Prior to this commit, the graphs were being described using footnotes.
This was meant to be a temporary solution, and now that a better option
has been found, the footnotes are no longer needed.
Refactor JavaScript and begin to add info buttons

Prior to this commit, all of the JavaScript for generating dc.js
graphs was all in once place and poorly organized. This made it
difficult to understand, harder to make changes, and impossible to
reuse the functionality elsewhere.

Now, the JavaScript has been refactored into methods and moved into
a separate file to fix the mentioned issues.

Information buttons have also been added to the first two graphs
on the dashboard. The buttons provide a much better way to give
a more detailed description about the graphs than the footnotes.
Finish adding info buttons

Prior to this commit, only two of the graphs on the dashboard had
buttons which provided more detailed descriptions of the graphs.

Now, buttons and descriptions have been added for all graphs.
Switch buttons to click instead of hover

Prior to this commit, all the description buttons were triggered
simply by hovering. This was not ideal because it prevented the
dashboard from being mobile friendly. Now, you must click the button to
display the description, and click it again to hide it again.
Add text input field and slider

Prior to this commit, there was no way for the user to define
what date range they wanted the graphs to represent. Now a text
field has been added as a temporary solution to this problem. If users
enter the start date in the right format, it will adjust the graphs
accordingly.

Due to the desire not to have to deal with sanitizing user input,
the text field will soon be replaced with a slider. The slider is
present on the page but does not adjust anything yet.
Removed text field and make slider work

Prior to this commit, the start date had to be defined by a text
input field which was not ideal. Now, that input option has been
removed and the slider is now functional, allowing users to
switch between five different views.
Tweak styling and update graphs with slide bar

Prior to this commit, the styling of the graphs would not change
when the slider adjusted the time scale. Now the graphs adjust
themselves when they are re-rendered with the new date range so
that they are easier to read.
Add (poorly formatted) footer

Prior to this commit, the dashboard did not have a footer. This was
not idea because there was no clear place to put the slider. Now a
footer has been added and the slider has been put into it.

Currently, the footer is very poorly formatted and looks kind of awful.
Change repo_names to forge module repos

Prior to this commit, the rake tasks `job:import and
`job:import_if_sunday` only looked at the puppetlabs repositories
`puppet`, `hiera`, `puppetlabs-stdlib`, and `facter`. This commit makes
it look at a (dynamically generated) list of repositories for puppetlabs
forge modules.

Add regex check for getting repo_names

Add regex check for getting repo_names - for real this time

Add repositories table to database

This commit adds a repositories table to the database, and has the
pull_requests table get repo info through there. This commit also adds a
rake task that updates the repositories table from the forge api.

Reorganize layout

Prior to this commit, the website was designed in order to only view
pull requests for 4 repositories. If you wanted to display many more
than that, then the "# of requests per repo" graph did not display
nicely.

This commit reorganizes the layout, removing the "# of requests per
repo" graph entirely (until I can find a better way to include it), and
providing a sidebar that lets you filter data for individual pages.

Change repo_names to forge module repos

Prior to this commit, the rake tasks `job:import and
`job:import_if_sunday` only looked at the puppetlabs repositories
`puppet`, `hiera`, `puppetlabs-stdlib`, and `facter`. This commit makes
it look at a (dynamically generated) list of repositories for puppetlabs
forge modules.

Add regex check for getting repo_names

Add regex check for getting repo_names - for real this time

Add module filter to sidebar

Remove duplication in module.erb and main.erb code

Prior to this commit, the main.erb page and module.erb had mostly
the same code, to display the same types of graphs. This commit
refacters the code so that main.erb uses module.erb as a partial,
removing duplication.

Add dynamic styles to sidebar

This commit adds styles to the sidebar such that the name of the module
you are currently viewing is highlighted.

Update Heroku app link

Remove repo_names function from Rakefile

Make import tasks dependent on repositories task

Make sidebar load repositories server side

Make sidebar load repositories server side (fixed)

Refacter to increase load speed

Prior to this commit, the website would iterate through pull_request
results twice before putting them in the graph: once in web_app.rb, and
once in the javascript in module.erb. This slowed down graph loading
considerably (*especially* on the home page).

This commit refacters the code so that the site only iterates through
the pull_request results once. It does this by formatting the data in
`web_app.rb` in one SQL query, without requiring an additional array
iteration.

Replace footnotes with tooltip buttons

Prior to this commit, information about each graph was displayed in
awkward footnotes. This commit replaces those footnotes with Bootstrap
tooltip buttons.

Add pull request per repo bar chart to main page

This commit adds a bar chart showing the number of pull requests for
each repository on the home page.

Move pie charts heigher on page

Add sorting to pull requests per repo chart

Prior to this commit, the pull requests per repo chart listed the
repositories in alphabetical order of their module names. This commit
instead has the graph sorting them by number of pull requests, in
descending order

Re-add sidebar filtering

In a previous commit, I had accidentally removed the `filterable` CSS
class that allowed for module filtering  in the sidebar. This commit
re-adds that feature.

Remove sorting from pull-requests-per-repo chart

Prior to this commit, the pull-requests-per-repo graph was sorted from
most to least pull requests. Unfortunately, the implementation of
sorting caused the graph to display wildly innacurate data (e.g.:
negative numbers of pull requests for some repositories) whenever the
user applied cross filtering. I was unable to find another way to
implement this that did not cause other problems. The best method I
found made the bars 2px wide.

Therefore, this commit removes sorting altogether. However, the 2px-bar
method is left commented out should anyone find a solution to that
problem.

Remove console debugging code

Add default value to repo_id field

Prior to this commit, the field `repo_id` in `pull_requests` had no
default value. this caused ActiveRecord to complain about "Cannot
add a NOT NULL column with default value NULL" when running migrations
during rake tests. This commit adds a default value of 0 to the repo_id
field.

Note that: 1) The rake task job:import should always provide a repo_id,
and thus the default should never end up being used in production, and
2) there should not be a repo with id 0 anyway.

Remove obsolete generate_repositories method

Prior to this commit, the `generate_repositories` method was still
floating around in the application class, even though that method is now
unesecary now that repository data is stored in its own table. This
commit removes that method.

Remove gigantic block of commented code

Remove whitespace

Rewrite spec tests for new database format

Prior to this commit, the spec tests had not been updated to reflect the
the new database structure, particularly the fact that the Repository
class was a model for a table now. This commit updates the tests to
reflect that.

Re-add sorting to pull-requests-per-repo graph

Prior to this commit, I had removed the sorting-by-pull-request-count
feature from the pull-requests-per-repo graph because (as documented in
an earlier commit), that made the bars needle thin for some reason. I
contacted the developer for dc.js, and he had no idea why the frak that
was happening, but he showed me how to force the bars to be the width I
wanted. So this commit re-adds the sort feature.

Abstracts how spec tests generate test data

Prior to this commit, spec tests generated test database records in an
ad hoc fashion. This commit adds to `spec_helper.rb` some hashes with
default field values for one repository record and one pull request record
that belongs to it. Spec tests that need to have test data in the database
can easily create a pull request and repository record using those
hashes.

Add spec tests for web_app.rb

Prior to this commit, there were no spec tests for `web_app.rb`. This
commit adds some (very simple) tests for each of the Sinatra routes.
These tests check 1) that the page can be be reached, 2) where relevant,
some routes return `Not Found` when passed an invalid module name, and
3) where relevant, the route returns a JSON string. More tests to come.

Test that web_app routes return right type of JSON

Add tests to JSON routes for web_app

Prior to this commit, there were tests in `web_app_spec.rb` that checked
that the routes that return JSON  did in fact return JSON, and that they
returned either an array or a hash (as applicable). This commit adds
more detailed tests, which check that the routes return hash(es) with
the right keys.

Fixing a couple bugs from prev commits

Route GET /data/puppet_pulls/:name should return array, not hash

Adding comments

Changing tooltip trigger to click from hover

Add date slider

This commit adds a slider tool to the top of the page that allows you to
filter by date