summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-10-03 14:54:55 +0200
committerfranck cuny <franck@lumberjaph.net>2010-10-03 14:54:55 +0200
commit161add37d65ca28ff19142aec901d8925a2f961a (patch)
tree8e49537af0d5f3f6f95a69f92d93135d7210902f /lib
parentscript to import frmo redis; more data to tests (diff)
downloadjitterbug-161add37d65ca28ff19142aec901d8925a2f961a.tar.gz
add gravatar; update layout
Diffstat (limited to 'lib')
-rw-r--r--lib/jitterbug/Project.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/jitterbug/Project.pm b/lib/jitterbug/Project.pm
index 30821ef..5cd05af 100644
--- a/lib/jitterbug/Project.pm
+++ b/lib/jitterbug/Project.pm
@@ -4,6 +4,7 @@ use Dancer ':syntax';
use Dancer::Plugin::DBIC;
use jitterbug::Plugin::Template;
+use Digest::MD5 qw/md5_hex/;
use DateTime;
use XML::Feed;
@@ -18,6 +19,7 @@ get '/:project' => sub {
my $commits;
foreach (@$builds) {
+ $_->{avatar} = md5_hex( lc( $_->{author}->{email} ) );
my $t = $_->{timestamp};
(my $d) = $t =~ /^(\d{4}-\d{2}-\d{2})/;
push @{$commits->{$d}}, $_;
@@ -69,7 +71,9 @@ sub _sorted_builds {
my @builds;
while ( my $c = $commits->next ) {
- push @builds, from_json( $c->content );
+ my $content = from_json($c->content);
+ $content->{id} = $c->sha256 if (!$content->{id});
+ push @builds, $content;
}
@builds = sort { $b->{timestamp} cmp $a->{timestamp} } @builds;