summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-05-09 10:00:29 +0200
committerfranck cuny <franck@lumberjaph.net>2011-05-09 16:42:15 +0200
commit529b28c2ac24063cd4d991c16e6771c79476fb15 (patch)
tree364b7f11083d79fef4e0e232f068ace1e787eac1
parentshow more informations about a task (closes GH #55) (diff)
downloadjitterbug-529b28c2ac24063cd4d991c16e6771c79476fb15.tar.gz
display the number of builds for the day (closes GH #53)
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to '')
-rw-r--r--lib/jitterbug/Project.pm4
-rw-r--r--views/project/index.tt2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/jitterbug/Project.pm b/lib/jitterbug/Project.pm
index a472151..7616843 100644
--- a/lib/jitterbug/Project.pm
+++ b/lib/jitterbug/Project.pm
@@ -18,17 +18,19 @@ get '/:project' => sub {
my $builds = _sorted_builds($project);
my $commits;
+ my $total_by_days;
foreach (@$builds) {
$_->{avatar} = md5_hex( lc( $_->{author}->{email} ) );
my $t = $_->{timestamp};
(my $d) = $t =~ /^(\d{4}-\d{2}-\d{2})/;
push @{$commits->{$d}}, $_;
+ $total_by_days->{$d}++;
}
my @days = sort {$b cmp $a} keys %$commits;
template 'project/index',
- {project => $project, days => \@days, commits => $commits};
+ {project => $project, days => \@days, commits => $commits, total_by_days => $total_by_days};
};
get '/:project/feed' => sub {
diff --git a/views/project/index.tt b/views/project/index.tt
index 7b03c83..8751d50 100644
--- a/views/project/index.tt
+++ b/views/project/index.tt
@@ -5,7 +5,7 @@
<div class="project_baseline"><strong>"<: $project.description :>"</strong></div>
:for $days -> $day {
- <h3 class="builds-day" id="builds-day-<: $day :>"><: $day :></h3>
+ <h3 class="builds-day" id="builds-day-<: $day :>"><: $day :> (<: $total_by_days[$day] :> build(s))</h3>
: if $~day == 0 {
<div class="commits" id="commits-day-<: $day :>">
: }else{