There's something wrong with the swf_fu gem. It's not worth it to fix a
gem that hasn't seen any activity in six years and is using outdated
flash technology in the first place.
Also removing some instance variables that were never invoked in the
views. This sets up a future refactoring of the method of comptuting
rolling averages, which differs between the two types of "last year"
views being refactored.
Pull logic into the controller from the view. There were only a couple
of tiny differences between the running actions and the total actions
view, so I added a couple of instance variables and then called the same
template twice.
This may be a bit extreme.
It's modeled after the ideal "rails way".
In the controller, we now know the name of a single resource. It
doesn't happen to be backed by a database table, but it does know all
about the task of collecting stats, leaving the controller concerned
with just munging params and rendering stuff.
I called the resource `IndexPage`, to avoid the temptation of trying to
reuse it, which can get pretty messy.
Later, if a better abstraction appears, it should be fairly painless to
alter.
If you have fewer than 10 projects, then empty running projects were
linked to with the path `/projects/-1`.
Copy/pasted the list strategy from the other project sections in the
same partial so the duplication becomes explicit.
This fixes a bug where if you have fewer than 10 projects, your top 10
projects were listed as:
6 - n/a (n/a)
6 - n/a (n/a)
6 - n/a (n/a)
6 - n/a (n/a)
rather than
7 - n/a (n/a)
8 - n/a (n/a)
9 - n/a (n/a)
10 - n/a (n/a)
The :min was pointing at the max value, and the inverse.
I had to tweak a few of the language files as well, to make sure that
minimum and maximum are pointing to the correct values.
I didn't touch the hebrew language file, so someone with the correct
language skills may want to take a look at it to make sure that the text
matches the interpolation variables that get sent in.