Fix up the long log, add more gravatars, fix up links and time stamps and other bits
Tomas Doran [Wed, 20 Jan 2010 23:10:27 +0000 (23:10 +0000)]
lib/Gitalist/Controller/Fragment/Repository.pm
lib/Gitalist/URIStructure/Repository.pm
root/fragment/repository/log.tt2 [deleted file]
root/fragment/repository/longlog.tt2 [new file with mode: 0644]
root/fragment/repository/summary.tt2
root/repository/longlog.tt2 [moved from root/repository/log.tt2 with 69% similarity]

index ad011f6..135cb8f 100644 (file)
@@ -7,7 +7,7 @@ with 'Gitalist::URIStructure::Repository';
 
 sub base : Chained('/fragment/base') PathPart('') CaptureArgs(0) {}
 
-after shortlog => sub {
+after log => sub {
     my ($self, $c) = @_;
     my $repository  = $c->stash->{Repository};
 #    my $commit   =  $self->_get_object($c, $c->req->param('hb'));
index 3de316d..df26f4f 100644 (file)
@@ -23,12 +23,14 @@ sub find : Chained('base') PathPart('') CaptureArgs(1) {
 
 sub summary : Chained('find') PathPart('') Args(0) {}
 
-sub shortlog : Chained('find') Args(0) {}
-
 sub heads : Chained('find') Args(0) {}
 
-sub log : Chained('find') Args(0) {}
-
 sub tags : Chained('find') Args(0) {}
 
+sub log : Chained('find') PathPart('') CaptureArgs(0) {}
+
+sub shortlog : Chained('log') Args(0) {}
+
+sub longlog : Chained('log') PathPart('log') Args(0) {}
+
 1;
diff --git a/root/fragment/repository/log.tt2 b/root/fragment/repository/log.tt2
deleted file mode 100644 (file)
index 7170be7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-  <div id='log'>
-  [% FOREACH line IN log_lines %]
-    <div class='entry'>
-    <div class="message">
-       [% message = line.comment | html;
-         message.replace("\n", "<br/>") %]
-       <div class='chroma-hash'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1 %]</div>
-      </div>
-      <div class="meta">
-       <table class='summary' cellspacing='0' cellpadding='0'>
-       <tr><td>author</td><td class='author'>[% line.author.name | html %]</td></tr>
-       <tr><td>authored time</td><td class='time'>[% line.authored_time %]</td></tr>
-       [% IF line.author.name != line.committer.name %]
-       <tr><td>committer</td><td class='author'>[% line.committer.name | html %]</td></tr>
-       <tr><td>committered time</td><td class='time'>[% line.committed_time %]</td></tr>
-       [% END %]
-       </table>
-       <span class="time-since">[% time_since(line.authored_time) %]</span>
-       <div class="action-list">
-        <a href="[% c.uri_for("commit", {h=line.sha1}) %]">commit</a>
-       | <a href="[% c.uri_for("commitdiff", {h=line.sha1}) %]">commitdiff</a>
-       | <a href="[% c.uri_for("tree", {h=line.sha1, hb=line.sha1}) %]">tree</a>
-       </div>
-      </div>
-    </div>
-  [% END %]
-  </div>
diff --git a/root/fragment/repository/longlog.tt2 b/root/fragment/repository/longlog.tt2
new file mode 100644 (file)
index 0000000..adf9557
--- /dev/null
@@ -0,0 +1,32 @@
+  <div id='log'>
+  [% FOREACH line IN log_lines %]
+    <div class='entry'>
+    <div class="message">
+       [% message = line.comment | html;
+         message.replace("\n", "<br/>") %]
+       <div class='chroma-hash'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1 %]</div>
+      </div>
+      <div class="meta">
+       <table class='summary' cellspacing='0' cellpadding='0'>
+       <tr><td>author</td><td class='author'>
+           <img style="float: left; padding-right: 10px" src="[% uri_for_gravatar(line.author.email, 20) %]">
+           [% line.author.name | html %]</td></tr>
+       <tr><td>authored time</td><td class='time'>[% time_since(line.authored_time) %]</td></tr>
+       [% IF line.author.name != line.committer.name %]
+       <tr><td>committer</td><td class='author'>
+           <img style="float: left; padding-right: 10px" src="[% uri_for_gravatar(line.author.email, 20) %]">
+           [% line.committer.name | html %]
+       </td></tr>
+       <tr><td>committered time</td><td class='time'>[% line.committed_time %]</td></tr>
+       [% END %]
+       </table>
+       <span class="time-since">[% time_since(line.authored_time) %]</span>
+       <div class="action-list">
+        <a href="[% c.uri_for_action("/commit/commit", [Repository.name, line.sha1]) %]">commit</a>
+       | <a href="[% c.uri_for_action("/commit/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
+       | <a href="[% c.uri_for_action("/commit/tree", [Repository.name, line.sha1]) %]">tree</a>
+       </div>
+      </div>
+    </div>
+  [% END %]
+  </div>
index 68fb0a8..a2a160c 100644 (file)
@@ -1,5 +1,5 @@
 <dl>
  <dt>description</dt><dd>[% Repository.description %]</dd>
  <dt>owner</dt><dd>[% Repository.owner %]</dd>
- <dt>last change</dt><dd>[% Repository.last_change %]</dd>
+ <dt>last change</dt><dd>[% time_since(Repository.last_change) %]</dd>
 </dl>
similarity index 69%
rename from root/repository/log.tt2
rename to root/repository/longlog.tt2
index 0a3b026..6963772 100644 (file)
@@ -2,7 +2,7 @@
 <div class='content'>
   [% INCLUDE '_log_pager.tt2';
 
-  subinclude('/fragment/repository/log', c.req.captures);
+  subinclude('/fragment/repository/longlog', c.req.captures);
 
   INCLUDE '_log_pager.tt2'; %]
 </div>