about summary refs log tree commit diff
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
parentscript to import frmo redis; more data to tests (diff)
downloadjitterbug-161add37d65ca28ff19142aec901d8925a2f961a.tar.gz
add gravatar; update layout
-rw-r--r--lib/jitterbug/Project.pm6
-rw-r--r--public/css/style.css17
-rw-r--r--views/project/index.tt23
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 @@
   <div id="content">
     <h2><a href="<: $project.url :>"><: $project.name :></a> / build history <a href="<: $base_uri :>/project/<: $project.name :>/feed"><img src="<: $uri_base :>/images/feed.png" /></a></h2>
 
-    <strong>"<: $project.description :>"</strong>
+    <div class="project_baseline"><strong>"<: $project.description :>"</strong></div>
 
     :for $days -> $day {
       <h3 class="builds-day" id="builds-day-<: $day :>"><: $day :></h3>
@@ -11,7 +11,14 @@
           <div class="commit" id="<: $commit.id :>">
             <div class="description">
               <div class="message"><pre><: $commit.message :></pre></div>
-              <div class="name"><: $commit.author.name :></div>
+              <div class="name">
+                <div class="gravatar">
+                  <img src="http://www.gravatar.com/avatar/<: $commit.avatar :>?s=30" />
+                </div>
+                <div class="author"><: $commit.author.name :></div>
+                <div class="date"><: $commit.dt.month :></div>
+              </div>
+              <div style="clear:both;"></div>
               <br />
               <div class="builds">
                 :for $commit.build.version.keys() -> $version {
@@ -21,11 +28,15 @@
             </div>
             <div class="git">
               commit&nbsp;&nbsp;&nbsp;<a href="<: $commit.url :>"><: $commit.id :></a><br />
-              commited&nbsp;<: $commit.timestamp :><br />
-              ref&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<: $commit.ref :><br />
-              <: if $commit.build { :>
-                built in&nbsp;<: $commit.build.end_time - $commit.build.start_time :>&nbsp;seconds</br >
+
+              <: if $commit.ref { :>
+                on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<: $commit.ref :>
               <: } :>
+              <br />
+              <: if $commit.build.start_time { :>
+                built in&nbsp;<: $commit.build.end_time - $commit.build.start_time :>&nbsp;seconds
+              <: } :>
+              <br />
             </div>
           </div>
           <div class="display_test_result" style="display: none" id="result-<: $commit.id :>">