From 161add37d65ca28ff19142aec901d8925a2f961a Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 3 Oct 2010 14:54:55 +0200 Subject: add gravatar; update layout --- lib/jitterbug/Project.pm | 6 +++++- public/css/style.css | 17 ++++++++++------- views/project/index.tt | 23 +++++++++++++++++------ 3 files changed, 32 insertions(+), 14 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; diff --git a/public/css/style.css b/public/css/style.css index 2e546be..afe68f8 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,6 +1,6 @@ body { -font-family: 'Linux Libertine', Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, 'Times New Roman', serif; +font:13px helvetica,arial,freesans,clean,sans-serif; margin: 0; margin-bottom: 25px; padding: 0; @@ -8,9 +8,6 @@ background-color: #ddd; background-image: url("/images/perldancer-bg.jpg"); background-repeat: no-repeat; background-position: top left; - -font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; -font-size: 13px; color: #333; } @@ -215,6 +212,8 @@ color: white; overflow: hidden; } +.project_baseline {font-size: 110%; margin-top: 3em;margin-bottom: 2.5em;margin-left:1.1em;} + .commit .description { float: left; } @@ -232,11 +231,11 @@ font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",m } .message pre{white-space:pre-wrap;word-wrap:break-word;width:40em;} -.commit .name{clear:left;margin-top:.75em;line-height:1.5em} +/* .commit .name{clear:left;margin-top:.75em;line-height:2em} */ .commit .date{color:#888;line-height:1em;} .commit .builds span {font-size:110%;font-weight: bolder;} -.commit .builds span .PASS{color:green} -.commit .builds span .FAILED{color:red} +.commit .builds span.PASS{color:green} +.commit .builds span.FAIL{color:red} .repo{border:1px solid #d8d8d8;background-color:#f0f0f0;} @@ -246,6 +245,10 @@ ul.repositories h3{margin:0;font-size:14px;white-space:nowrap;} ul.repositories p.desc{margin:0 0 3px 0;font-size:12px;color:#444;} ul.repositories p.updated-at{margin:0;font-size:11px;color:#888;} +.commit .name{float:left; width: 100%;} +.commit .name .date{color:#888;font-size:90%;} +.commit .name .author{font-weight: bolder;} +.commit .gravatar{border:1px solid #d0d0d0;padding:2px;background-color:white;float:left;margin-right:.7em;} .columns .first{float:left;width:450px;} .columns .last{float:right;width:450px;} diff --git a/views/project/index.tt b/views/project/index.tt index 7f3ee1f..9a5f4eb 100644 --- a/views/project/index.tt +++ b/views/project/index.tt @@ -2,7 +2,7 @@

<: $project.name :> / build history

- "<: $project.description :>" +
"<: $project.description :>"
:for $days -> $day {

<: $day :>

@@ -11,7 +11,14 @@
<: $commit.message :>
-
<: $commit.author.name :>
+
+
+ +
+
<: $commit.author.name :>
+
<: $commit.dt.month :>
+
+

:for $commit.build.version.keys() -> $version { @@ -21,11 +28,15 @@
commit   <: $commit.id :>
- commited <: $commit.timestamp :>
- ref      <: $commit.ref :>
- <: if $commit.build { :> - built in <: $commit.build.end_time - $commit.build.start_time :> seconds
+ + <: if $commit.ref { :> + on      <: $commit.ref :> <: } :> +
+ <: if $commit.build.start_time { :> + built in <: $commit.build.end_time - $commit.build.start_time :> seconds + <: } :> +