added compare diffs feature and fixed a couple of css issues
[catagits/Gitalist.git] / root / fragment / ref / history.tt2
old mode 100644 (file)
new mode 100755 (executable)
index a405234..0e5ee10
@@ -1,51 +1,52 @@
-[%
-  INCLUDE '_log_pager.tt2';
-%]  <table class='history listing'>
-   <thead>
-    <tr>
-     <th>sha1</th>
-     <th>time</th>
-     <th>author</th>
-     <th>message</th>
-     <th>actions</th>
-    </tr>
-   </thead>
-
-   <tfoot>
-    <tr>
-     <td>sha1</td>
-     <td>time</td>
-     <td>author</td>
-     <td>message</td>
-     <td>actions</td>
-    </tr>
-   </tfoot>
+[% BLOCK history_table_headfoot %]
+[% SET cell = type == 'head' ? 'th' : 'td' %]
+[%# FIXME: should  c.req.arguments.0 be path instead? %]
+<tr>
+<[% cell %] colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]','[% c.req.arguments.0 %]');return false;">Compare</a></[% cell %]>
+ <[% cell %]>sha1</[% cell %]>
+ <[% cell %]>time</[% cell %]>
+ <[% cell %]>message</[% cell %]>
+ <[% cell %]>author</[% cell %]>
+ <[% cell %]>actions</[% cell %]>
+</tr>
+[% END %]
+<form name="theform">
+ <table class='listing'>
+   <thead>[% PROCESS history_table_headfoot type = 'head' %]</thead
 
    <tbody>
    [% FOREACH line IN log_lines %]
-    <tr>
-     <td class='sha1' title='[% line.sha1 %]'>[% INCLUDE '_chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
+ <tr [% "class='invert'" IF loop.count % 2 %]>
+       <td><input type="radio" name="sha1_a" value="[% line.sha1 %]" [% "checked" IF loop.count == 2 %] /></td>
+       <td><input type="radio" name="sha1_b" value="[% line.sha1 %]" [% "checked" IF loop.count == 1 %]/></td>
+     <td class='sha1' title='[% line.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
      <td class='time-since' title='[% line.authored_time %]'>[% time_since(line.authored_time) %]</td>
-     <td class='author'>[% line.author.name | html %]</td>
+    
      <td>
        [% short_cmt(line.comment) | html %]
        [% INCLUDE '_refs.tt2' object = line.0 %]
      </td>
+         <td class='author'>[% line.author.name | html %]</td>
      <td class='action-list'>
      [% IF filetype == 'tree' %]
-       <a href="[% c.uri_for("tree", {h=line.sha1, hb=line.sha1}) %]">tree</a>
+       <a href="[% c.uri_for_action("/ref/tree", [Repository.name, line.sha1], filename) %]" title="Blob" class="button blob">blob</a>
       [% ELSIF filetype == 'blob' %]
-       <a href="[% c.uri_for("blob", {hb=line.sha1, f=filename}) %]">blob</a>
+       <a href="[% c.uri_for_action("/ref/blob", [Repository.name, line.sha1], filename) %]" title="Blob" class="button blob">blob</a>
       [% END %]
-       <a href="[% c.uri_for("commitdiff", {h=line.sha1}) %]">commitdiff</a>
+       <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1]) %]" title="Commit diff" class="button diff">commitdiff</a>
       [% IF filetype == 'blob' %]
-       <a href="[% c.uri_for("blobdiff", {hb="HEAD", hpb=line.sha1, f=filename}) %]">diff to current</a>
+       <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1], 'HEAD', filename) %]" title="Diff to current" class="button diffcurrent">diff to current</a>
        [% END %]
      </td>
     </tr>
    [% END %]
+  <tr>
+       <td colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></td>
+       <td colspan="5"></td>
+</tr>
    </tbody>
   </table>
+</form>
 [%
-  INCLUDE '_log_pager.tt2';
+  INCLUDE 'inc/log_pager.tt2';
 %]