From 540c9cc00282d7a170986f03b758d5df6c21ecee Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 21 Jan 2009 00:18:39 -0700 Subject: [PATCH] Clean up stats page. --- chora/stats.php | 12 ++++++++---- chora/templates/stats/stats.inc | 6 +++--- chora/themes/screen.css | 4 +++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/chora/stats.php b/chora/stats.php index f6193c832..f54f13faa 100644 --- a/chora/stats.php +++ b/chora/stats.php @@ -11,16 +11,20 @@ require_once dirname(__FILE__) . '/lib/base.php'; -$fl = &$VC->getFileObject($where, $cache); +$fl = $VC->getFileObject($where, $cache); Chora::checkError($fl); $extraLink = Chora::getFileViews(); -$author_stats = array(); +$stats = array(); foreach ($fl->logs as $lg) { - @$author_stats[$lg->queryAuthor()]++; + $qa = $lg->queryAuthor(); + if (!isset($stats[$qa])) { + $stats[$qa] = 0; + } + ++$stats[$qa]; } -arsort($author_stats); +arsort($stats); $title = sprintf(_("Statistics for %s"), Text::htmlallspaces($where)); Horde::addScriptFile('prototype.js', 'horde', true); diff --git a/chora/templates/stats/stats.inc b/chora/templates/stats/stats.inc index 1aadea040..a48084730 100644 --- a/chora/templates/stats/stats.inc +++ b/chora/templates/stats/stats.inc @@ -8,12 +8,12 @@ $commits): $width = (int)($commits / $factor); ?> +foreach ($stats as $author => $commits): $width = (int)($commits / $factor); ?>    - get('webroot', 'horde') . '/services/images') . ' (' . $commits . ')' ?> + get('webroot', 'horde') . '/services/images') . ' (' . $commits . ')' ?> diff --git a/chora/themes/screen.css b/chora/themes/screen.css index 2e5db5e27..7040b8d47 100644 --- a/chora/themes/screen.css +++ b/chora/themes/screen.css @@ -272,10 +272,12 @@ table.hrdiff caption { font-weight: bold; padding: 5px; } +table.hrdiff caption img, .statsImg { + border: 1px solid #000; +} table.hrdiff caption img { height: 10px; width: 10px; - border: 1px solid #000; margin-left: 0.5em; vertical-align: baseline; } -- 2.11.0