Remove tabs from all files. Add more statistics to stats.cgi.

This commit is contained in:
zach%zachlipton.com 2005-08-17 21:36:19 +00:00
Родитель 2ea28aaa56
Коммит 087bc13d2c
4 изменённых файлов: 51 добавлений и 26 удалений

Просмотреть файл

@ -61,12 +61,12 @@ p#banner-version { font-size: 85%; }
.footer
{
padding: 10px;
background-color: #FFFF99;
width: 55%;
border: 1px solid #000;
position: absolute;
bottom: 10px;
padding: 10px;
background-color: #FFFF99;
width: 55%;
border: 1px solid #000;
position: absolute;
bottom: 10px;
}
.pagetitle
@ -95,8 +95,8 @@ p#banner-version { font-size: 85%; }
.menu_content
{
left: 250px;
position: absolute;
left: 250px;
position: absolute;
}
.key

Просмотреть файл

@ -33,27 +33,37 @@ my $c = new CGI;
print $c->header();
# find the number of testcases in the database
Litmus::DB::Test->set_sql('numtests', "SELECT COUNT(*) as count from __TABLE__");
my $numtests = Litmus::DB::Test->search_numtests()->next()->count();
# find the number of users in the database
Litmus::DB::User->set_sql('numusers', "SELECT COUNT(*) as count from __TABLE__");
my $numusers = Litmus::DB::User->search_numusers()->next()->count();
# get a list of the top 15 testers of all time, sorted by the number
# of test results submitted:
Litmus::DB::User->set_sql('toptesters', "SELECT users.userid, count(*) AS count
FROM users, testresults
WHERE
users.userid=testresults.user
GROUP BY user
ORDER BY count DESC
LIMIT 15;");
FROM users, testresults
WHERE
users.userid=testresults.user
GROUP BY user
ORDER BY count DESC
LIMIT 15;");
my @testers = Litmus::DB::User->search_toptesters();
my @toptesters;
foreach my $curtester (@testers) {
my %testerinfo;
$testerinfo{"email"} = $curtester->email();
$testerinfo{"numtests"} = $curtester->count();
push(@toptesters, \%testerinfo);
my %testerinfo;
$testerinfo{"email"} = $curtester->email();
$testerinfo{"numtests"} = $curtester->count();
push(@toptesters, \%testerinfo);
}
my $vars = {
toptesters => \@toptesters,
numtests => $numtests,
numusers => $numusers,
toptesters => \@toptesters,
};
Litmus->template()->process("stats/stats.html.tmpl", $vars) ||

Просмотреть файл

@ -22,7 +22,7 @@
# $test - the test object to display
# @results - the list of all possible test results
# $showallresults (optional) - if true, then all test results
# will be shown
# will be shown
#
#%]
@ -63,7 +63,7 @@
[% FOREACH curresult = test.testresults %]
[% UNLESS showallresults %]
[% IF curresult.isrecent == 0 && nonrecentcount >= 3 %]
[% NEXT %]
[% NEXT %]
[% ELSIF curresult.isrecent == 0 %]
[% nonrecentcount = nonrecentcount+1 %]
[% END %]

Просмотреть файл

@ -19,21 +19,36 @@
#%]
[%# INTERFACE:
# $numtests - the number of tests in the database
# $numusers - the number of users in the database
# @toptesters - an array of the top testers in the system, where each
# element contains a hash with keys "email" and "numtests"
# element contains a hash with keys "email" and "numtests"
#%]
[% INCLUDE global/header.html.tmpl title = 'Statistics' %]
<p class="pagetitle">Statistics</p>
<p class="pagetitle">Litmus - Statistics</p>
<p class="pageinstruction">General Statistics</p>
<ul>
<li>Testcases - [% numtests FILTER html %] testcases</li>
<li>Users - [% numusers FILTER html %] users</li>
</ul>
<p class="pageinstruction">Tester Statistics</p>
<div>
<p><strong>Top Testers</strong></p>
<p><strong>Top Testers:</strong></p>
<table border="1">
<tr><td><strong>Tester</strong></td><td><strong># Tests Run</strong></td></tr>
<tr><td></td><td><strong>Tester</strong></td><td><strong># Tests Run</strong></td></tr>
[% count = 1 %]
[% FOREACH curtester = toptesters %]
<tr><td>[% curtester.email FILTER html %]</td><td>[% curtester.numtests FILTER html %]</td></tr>
<tr>
<td>[% count FILTER html %]</td>
<td>[% curtester.email FILTER html %]</td>
<td>[% curtester.numtests FILTER html %]</td>
</tr>
[% count = count+1 %]
[% END %]
</table>
</div>