sorted design of search
[catagits/Gitalist.git] / root / repository / search.tt2
1 [% BLOCK shortlog_table_headfoot %]
2 [% SET cell = type == 'head' ? 'th' : 'td' %]
3 <tr>
4         <[% cell %] colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></[% cell %]>
5         <[% cell %]>ID (sha1)</[% cell %]>
6         <[% cell %]>Last change</[% cell %]>
7         <[% cell %]>Message</[% cell %]>
8         <[% cell %]>By</[% cell %]>
9         <[% cell %]>Actions</[% cell %]>
10 </tr>
11 [% END %]
12
13 <form name="theform">
14 <table class='listing'>
15 <thead>[% PROCESS shortlog_table_headfoot type = 'head' %]</thead>
16 <tbody>
17 [% FOREACH result IN results %]
18  <tr [% "class='invert'" IF loop.count % 2 %]>
19         <td><input type="radio" name="sha1_a" value="[% result.sha1 %]" [% "checked" IF loop.count == 2 %] /></td>
20         <td><input type="radio" name="sha1_b" value="[% result.sha1 %]" [% "checked" IF loop.count == 1 %]/></td>
21         <td class='sha1' title='[% result.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = result.sha1.substr(0, 7) %]</td>
22         <td class='time-since' title='[% result.authored_time %]'>[% time_since(result.authored_time) %]</td>
23         <td>[%
24      # XXX This is fragile at best.
25      html_comment = result.comment | html;
26      html_comment.replace(
27        c.req.param('text'), '<span class="match">' _ c.req.param('text') _ '</span>'
28      );
29    %]</td>
30         <td class='author'><img src="[% uri_for_gravatar(result.author.email, 21) %]" />[% result.author.name | html %]</td>
31         <td class='action-list'>
32                 <a href="[% c.uri_for_action("/ref/commit", [Repository.name, result.sha1]) %]" title="Commit details" class="button commit">commit</a>
33                 <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, result.sha1]) %]" title="Commit difference" class="button diff">commitdiff</a>
34                 <a href="[% c.uri_for_action("/ref/tree", [Repository.name, result.sha1]) %]" title="Tree" class="button tree">tree</a>
35         </td>
36 </tr>
37 [% END %]
38 <tr>
39         <td colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></td>
40         <td colspan="5"></td>
41 </tr>
42 </tbody>
43 </table>
44 </form>