Commit graph

59 commits

Author SHA1 Message Date
Katrina Owen
961227da0c Extract pie chart data logic into model layer
Move most of the tests for this logic into the unit test layer.
2013-03-18 19:49:54 -06:00
Katrina Owen
6e2f1a8e5f De-dupe pie chart view
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.
2013-03-18 18:56:41 -06:00
Katrina Owen
d5a555fbac Encapsulate dependencies of stats index page
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.
2013-03-02 17:35:19 -07:00
Katrina Owen
615a9e46c9 Encapsulate counts and totals into a class.
Move queries out of the view and into the model layer.
2013-03-02 17:22:15 -07:00
Katrina Owen
6ccb9a81fb Group context-related pieces in a class 2013-03-02 17:21:03 -07:00
Katrina Owen
8b1f0a34a0 Group project-related stats into a class.
Reduce number of instance variables available to the views.
Replace raw SQL with AR-type query.
2013-03-02 17:12:14 -07:00
Reinier Balt
1e3782ce67 Merge pull request #168 from kytrinyx/stats-actions
Encapsulate the stats for actions on the stats index page
2013-03-02 13:58:32 -08:00
Matt Rogers
9e4ec67dd2 Merge pull request #167 from kytrinyx/stats-contexts-view
Simplify context partial in stats
2013-03-02 13:52:52 -08:00
Katrina Owen
03282638af Move calculation out of view 2013-03-02 16:16:45 -05:00
Katrina Owen
27ba50b460 Extract time to complete partial 2013-03-02 16:16:45 -05:00
Katrina Owen
62336f94cd Move time to complete stats into separate class
This separates out the calculations from the queries so we can get
decent tests around them.
2013-03-02 16:16:45 -05:00
Katrina Owen
0ebb98d49f Encapsulate action stats
This gets rid of a bunch of instance variables in the view/controller
layer.
2013-03-02 16:16:45 -05:00
Katrina Owen
2d2e5fd133 Simplify context partial in stats 2013-03-02 16:15:18 -05:00
Katrina Owen
d4fb1f95d8 Add spaces so tag cloud columns can wrap. 2013-03-02 15:52:39 -05:00
Matt Rogers
004339a2ca Merge pull request #164 from kytrinyx/adjust-font-size
Split up the font size calculation
2013-03-02 05:40:38 -08:00
Katrina Owen
3f496db4b4 Split up the font size calculation
The font size is a view concern, but the relative size belongs in the
model layer.
2013-03-02 07:14:52 -05:00
Katrina Owen
a41704b72f Collapse duplication in stats project view 2013-03-02 00:48:59 -05:00
Katrina Owen
254179b4c8 Simplify stats projects view
Use `each_with_index` instead of hand-wrought index to loop through
projects, and use a partial for the duplicated empty list items.
2013-03-02 00:38:54 -05:00
Katrina Owen
2686a0d3b5 Don't link to null projects
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.
2013-03-02 00:19:47 -05:00
Katrina Owen
6385059de8 Increment list counter in project view
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)
2013-03-02 00:11:31 -05:00
Katrina Owen
0aa6ea183b Extract chart value object
This simplifies the views (slightly).
2013-03-01 20:38:24 -05:00
Matt Rogers
8b0f3e986a Merge branch 'tag-cloud' of https://github.com/kytrinyx/tracks 2013-03-01 16:49:53 -06:00
Matt Rogers
14a47f0480 Merge pull request #156 from kytrinyx/min-max
Swap min/max variables in i18n translation
2013-02-28 19:36:33 -08:00
Katrina Owen
d577dd9201 Completely whimsical whitespace adjustment. 2013-02-28 22:32:24 -05:00
Katrina Owen
d478efdd01 Move font calculation into tag cloud 2013-02-28 22:30:34 -05:00
Katrina Owen
2321d1f2a3 Call the cloud partial twice
Delete half the partial, and use each of the cloud objects to call it.
2013-02-28 22:03:39 -05:00
Katrina Owen
b5868d5c70 Use tag cloud objects in view
This allows us to not set the individual instance variables for the tag
cloud attributes.
2013-02-28 22:00:23 -05:00
Katrina Owen
cb9073f4bd Swap min/max variables in i18n translation
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.
2013-02-28 20:43:11 -05:00
Katrina Owen
ce9db80743 Correct typo in variable name 2013-02-28 20:34:46 -05:00
Reinier Balt
3a3a1ac22e production needs extension of swf 2012-07-16 17:47:30 +02:00
Reinier Balt
22e166c370 add swf to asset pipeline. Fixes #1311 2012-07-16 17:38:44 +02:00
Reinier Balt
0b1d521bbf ugly fix for deprecation warnings fopr mouseover and fix failing tests 2012-06-27 21:40:12 +02:00
Reinier Balt
5e477a4d25 first pass of all tests done 2012-05-18 15:33:47 +02:00
Reinier Balt
13b58f3a10 all unit and functional tests are passing 2012-04-30 13:56:40 +02:00
Reinier Balt
e74f8842ae Get more i18n fixed in for he locale. Include fallback to en locale and include pluralization mechanism 2012-04-16 13:19:04 +02:00
Reinier Balt
22feb7d7eb add i18n to last stats graph and update locales (google translate) 2012-04-12 14:18:08 +02:00
Reinier Balt
f32e5b256b further i18n changes for Hebrew, impacting other locales too 2012-04-11 21:10:19 +02:00
Reinier Balt
ac270884ed add more translations for he locale. Contributed by Darian Shalev 2012-04-11 20:22:05 +02:00
Reinier Balt
1bce9a670d implement #1030. 2012-01-21 20:20:24 +01:00
Reinier Balt
bc7bf459db fix small regressions 2012-01-20 23:50:27 +01:00
Reinier Balt
78a2bd7f49 further refactoring of stats controller and views 2012-01-20 23:35:00 +01:00
Reinier Balt
b948cc48b2 further refactoring and more tests 2012-01-20 23:35:00 +01:00
Reinier Balt
2349bee535 further refactorings and tests
one test is failing, will fix that next time
2012-01-20 23:34:59 +01:00
Reinier Balt
61624ed455 completed first pass of refactoring 2012-01-20 23:34:58 +01:00
Reinier Balt
c61238933c add recurring_todos to done_overview and fix routes 2011-07-09 17:19:13 +02:00
Reinier Balt
559a02d6f1 start on done overview page 2011-07-09 17:19:12 +02:00
Marcus Ilgner
fd3f69d927 Changed code to support basic i18n.
Added RubyMine configuration and rvm setup to .gitignore.
2010-11-09 16:31:26 +08:00
Reinier Balt
6a49a8a5bd fix type of #1074. Thanks gadicath. 2010-10-20 09:01:53 +02:00
Reinier Balt
084dc26e73 Fixes #1056 by not assuming that count is a string 2010-08-06 16:57:54 +02:00
Reinier Balt
65ecb7b019 migrated flashobject_helper to swf_fu because the first is not maintained anymore. Fixes #796 2010-07-29 21:41:36 +02:00