sorted design of search
Foxtons Web Design [Wed, 14 Apr 2010 17:00:10 +0000 (18:00 +0100)]
(cherry picked from commit ef0ad44d281eb459d1d3968096f69cdc63021db1)

root/nav/search.tt2
root/repository/search.tt2 [changed mode: 0644->0755]
root/search.tt2 [changed mode: 0644->0755]
root/search_help.tt2 [changed mode: 0644->0755]
root/static/css/core.css
root/static/i/buttons/search.png [new file with mode: 0755]
root/wrapper.tt2

index 8e15e07..9721094 100755 (executable)
@@ -14,7 +14,9 @@
       -->
   </select>
   <span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1">re</label></span>
-   <sup><a href="[% c.uri_for_action('/search_help') %]">?</a></sup> 
+   <sup><a href="[% c.uri_for_action('/search_help') %]">?</a></sup>
+   
+   <input type="submit" class="button_submit" value="" />
   </form>
 </div>
 [% END %]
old mode 100644 (file)
new mode 100755 (executable)
index 76b3e6a..f9f670d
@@ -1,30 +1,44 @@
-<div class='content'>
-  [%# XXX Nabbed the HTML below from gitweb's log action. %]
-  [% FOREACH result IN results %]
-  <div class="header">
-   <a class="title" href="[% c.uri_for_action('/ref/commit', [ Repository.name, result.sha1 ]) %]">
-    <span class="age">[% result.authored_time %]</span>
-    [% short_cmt(result.comment) | html %]
-   </a>
-  </div>
+[% BLOCK shortlog_table_headfoot %]
+[% SET cell = type == 'head' ? 'th' : 'td' %]
+<tr>
+       <[% cell %] colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></[% cell %]>
+       <[% cell %]>ID (sha1)</[% cell %]>
+       <[% cell %]>Last change</[% cell %]>
+       <[% cell %]>Message</[% cell %]>
+       <[% cell %]>By</[% cell %]>
+       <[% cell %]>Actions</[% cell %]>
+</tr>
+[% END %]
 
-  <div class="title_text">
-   <div class="log_link">
-     <a href="[% c.uri_for_action('/ref/commit', [Repository.name, result.sha1]) %]">commit</a>
-   | <a href="[% c.uri_for_action('/ref/diff_fancy', [Repository.name, result.sha1]) %]">commitdiff</a>
-   | <a href="[% c.uri_for_action('/ref/tree', [Repository.name, result.tree_sha1]); %][%# hb=line.sha1 %]">tree</a>
-   </div>
-   <i>[% result.author.name | html %] [% line.authored_time %]</i>
-  </div>
-
-  <div class="log_body">
-   [%
+<form name="theform">
+<table class='listing'>
+<thead>[% PROCESS shortlog_table_headfoot type = 'head' %]</thead>
+<tbody>
+[% FOREACH result IN results %]
+ <tr [% "class='invert'" IF loop.count % 2 %]>
+       <td><input type="radio" name="sha1_a" value="[% result.sha1 %]" [% "checked" IF loop.count == 2 %] /></td>
+       <td><input type="radio" name="sha1_b" value="[% result.sha1 %]" [% "checked" IF loop.count == 1 %]/></td>
+       <td class='sha1' title='[% result.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = result.sha1.substr(0, 7) %]</td>
+       <td class='time-since' title='[% result.authored_time %]'>[% time_since(result.authored_time) %]</td>
+       <td>[%
      # XXX This is fragile at best.
      html_comment = result.comment | html;
      html_comment.replace(
        c.req.param('text'), '<span class="match">' _ c.req.param('text') _ '</span>'
      );
-   %]
-  </div>
-  [% END %]
-</div>
+   %]</td>
+       <td class='author'><img src="[% uri_for_gravatar(result.author.email, 21) %]" />[% result.author.name | html %]</td>
+       <td class='action-list'>
+               <a href="[% c.uri_for_action("/ref/commit", [Repository.name, result.sha1]) %]" title="Commit details" class="button commit">commit</a>
+               <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, result.sha1]) %]" title="Commit difference" class="button diff">commitdiff</a>
+               <a href="[% c.uri_for_action("/ref/tree", [Repository.name, result.sha1]) %]" title="Tree" class="button tree">tree</a>
+       </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>
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 60a97a1..86e8154
@@ -1,8 +1,12 @@
+<h3>Search help</h3>
+
+<div class="copy">
 <p><strong>Pattern</strong> is by default a normal string that is matched precisely (but without
 regard to case, except in the case of pickaxe). However, when you check the <em>re</em> checkbox,
 the pattern entered is recognized as the POSIX extended
 <a href="http://en.wikipedia.org/wiki/Regular_expression">regular expression</a> (also case
 insensitive).</p>
+
 <dl>
 <dt><b>commit</b></dt>
 <dd>The commit messages and authorship information will be scanned for the given pattern.</dd>
@@ -23,4 +27,4 @@ added, removed or "modified" the string) will be listed. This search can take a
 takes a lot of strain on the server, so please use it wisely. Note that since you may be
 interested even in changes just changing the case as well, this search is case sensitive.</dd>
 </dl>
-
+</div>
index befb5d2..fca2565 100755 (executable)
@@ -53,6 +53,9 @@ a img{
        padding-bottom:30px;
        background:transparent url([% c.uri_for('/static/i/bg_top.png') %]) no-repeat;
 }
+.copy{
+       padding:10px;
+}
 #logo{
        margin-left:-10px;
        float:left;
@@ -275,7 +278,9 @@ a.raw{
        border:1px solid #ddd;
        margin:30px 15px;
 }
-
+.match{
+       background-color:#ffff00;
+}
 a.rss_logo {
   float: right;
   padding: 3px 0px;
@@ -299,6 +304,16 @@ a.rss_logo:hover {
 }
 
 
+.button_submit{
+       text-indent:-999999px;
+       overflow:hidden;
+       width:95px;
+       height:26px;
+       border:0;
+       background:transparent url([% c.uri_for('/static/i/buttons/search.png') %]) no-repeat;
+       cursor: pointer;
+}
+
 
 /* paging */
 .pager{
diff --git a/root/static/i/buttons/search.png b/root/static/i/buttons/search.png
new file mode 100755 (executable)
index 0000000..4768621
Binary files /dev/null and b/root/static/i/buttons/search.png differ
index 7f482d1..3cef238 100755 (executable)
                        <a href="[% c.uri_for('/') %]" id="logo"><img src="[% c.uri_for('/static/i/logo.png') %]" alt="Gitalist" /></a>
 
                        <div class="search">
-                               [% IF Repository; INCLUDE 'nav/search.tt2'; ELSE; %]
-                               
-                               <form method="get" action="[% c.uri_for_action('/search') %]" enctype="application/x-www-form-urlencoded">
-          <p class="projsearch">Search:
-           <input type="text" name="s" value="[% search_text %]" />
-          </p>
-         </form>
+                       [% IF Repository; INCLUDE 'nav/search.tt2'; ELSE; %]
+                       
+                       <!--
+                       [%# FIXME - Search submits to blank(ish) page %]
+                       <form method="get" action="[% c.uri_for_action('/search') %]" enctype="application/x-www-form-urlencoded">
+                          <p class="projsearch">Search:
+                           <input type="text" name="s" value="[% search_text %]" />
+                          </p>
+                       </form>
+                       -->
                        [% END %]
                        </div>
                </div>