added branch and tree to nav
Foxtons Web Design [Thu, 25 Mar 2010 16:47:01 +0000 (16:47 +0000)]
root/repository/shortlog.tt2
root/static/css/core.css
root/static/i/icons/tree.gif [new file with mode: 0755]
root/wrapper.tt2

index 33aa93c..90f7ea4 100755 (executable)
@@ -1,4 +1,2 @@
 [% subinclude('/fragment/' _ c.action, c.req.captures, c.req.parameters) %]
 
-<h2>Branches</h2>
-[% subinclude('/fragment/repository/heads', c.req.captures) %]
\ No newline at end of file
index 1018603..bcbc7f0 100755 (executable)
@@ -1,3 +1,20 @@
+#debug_holder{
+       
+       display:none;
+       
+       clear:both;
+       padding-top:30px;
+       margin:30px 0;
+}
+
+#debug_holder pre{
+       margin:0;
+       padding:10px;
+       border:1px solid #ddd;
+       background-color:#f0f0f0;
+}
+
+
 body{
        background:#FAFAFA url(/static/i/bg.png) repeat-x left top;
        padding:0;
@@ -41,7 +58,7 @@ a img{
        float:left;
 }
 #header .search{
-       margin-right:50px;
+       margin-right:10px;
        float:right;
 }
 #git_logo{
@@ -58,26 +75,14 @@ a img{
 #footer p{
        margin-left:15px;
 }
-#debug_holder{
-       display:none;
-       clear:both;
-       padding-top:30px;
-       margin:30px 0;
-}
 
-#debug_holder pre{
-       margin:0;
-       padding:10px;
-       border:1px solid #ddd;
-       background-color:#f0f0f0;
-}
 
 /* nav tabs */
 #nav_logs{
        width:80%;
        clear:both;
        float:right;
-       margin:-5px 50px 0 0;
+       margin:-5px 10px 0 0;
 }
 #nav_logs ul{
        margin:0;
@@ -105,6 +110,9 @@ a#log_short{
 a#log_full{
        background:#666 url(/static/i/icons/fulllog.gif) no-repeat 15px center;
 }
+a#tree{
+       background:#666 url(/static/i/icons/tree.gif) no-repeat 15px center;
+}
 #nav_logs li a:hover{
        text-decoration:underline;
        background-color:#DC143C;
@@ -112,8 +120,12 @@ a#log_full{
 #nav_logs li.selected a{
        background-color:#333;
 }
-
-
+#nav_logs #branch_selector{
+       padding:10px 15px 10px 48px;
+       font-size:1.3em;
+       font-weight:bold;
+       color:#666;
+}
 
 
 
diff --git a/root/static/i/icons/tree.gif b/root/static/i/icons/tree.gif
new file mode 100755 (executable)
index 0000000..49d75b8
Binary files /dev/null and b/root/static/i/icons/tree.gif differ
index 593246a..dd52ce9 100755 (executable)
@@ -29,7 +29,7 @@
        <div class="sub_holder">
                <div id="header">
                        <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; %]
                                
                
                
                <div id="nav_logs" [% 'style="visibility:hidden"' IF c.action.name == "index" %]>
+               
+                       [% IF c.req.captures.size == 1; SET path = 'repository'; ELSE; SET path = 'ref'; END %]
+                       
                        <ul>
-                               [% IF c.req.captures.size == 1; SET path = 'repository'; ELSE; SET path = 'ref'; END %]
                                
+                               [%# FIXME: tree path  #%]
+                                       [%- IF Repository %]
+                                               [% SET tree_path = c.uri_for_action('/' _ path _ '/shortlog', c.req.captures).replace("/shortlog","/HEAD/tree") %]
+                                       [% ELSE %]
+                                               [% SET tree_path = c.uri_for_action('/' _ path _ '/tree', c.req.captures) %]
+                                       [% END %]
+                                       
+                               <li [% 'class="selected"' IF c.action.name.match('tree') %]><a href="[% tree_path %]" id="tree">Tree</a></li>
+
+
                                <li [% 'class="selected"' IF c.action.name.match('longlog') %]><a href="[% c.uri_for_action('/' _ path _ '/longlog', c.req.captures) %]" id="log_full">Long log</a></li>
+                               
                                <li [% 'class="selected"' IF c.action.name.match('shortlog') %]><a href="[% c.uri_for_action('/' _ path _ '/shortlog', c.req.captures) %]" id="log_short">Short log</a></li>
+
+                               
+                               <li id="branch_selector">
+                                       [%# FIXME: convert to c.uri_for_action  #%]
+                                       
+                                       Branches 
+                                       <select onchange="document.location.href='/[% Repository.name %]/'+this.options[this.selectedIndex].text + '/shortlog';">
+                                               <option value="">HEAD</option>
+                                       
+                                       [% FOREACH branch_head IN Repository.heads %]
+                                               <option [% "selected" IF c.req.path.search(branch_head.name) %]>[% branch_head.name %]</option>
+                                       [% END %]
+                                       
+                                       </select>
+                               </li>
+                               
                        </ul>
                </div>
        
                / <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/shortlog">[% Repository.name %]</a>
                        [%- END %]
                        /
+                       [%- IF Repository %]
+                               [%# FIXME: output branch name in a nicer way!!!  #%]
+                               [% FOREACH branch_head IN Repository.heads %]
+                                       [% IF c.req.path.search(branch_head.name) %]
+                               <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/[% branch_head.name %]/shortlog">[% branch_head.name %]</a> /
+                                       [% END %]
+                               [% END %]
+                       [%- END %]
                        
-                       
-                       [% c.action.name.replace("_"," ").replace("log", " log").replace("fancy","").replace("index","Repositories") FILTER ucfirst %]
+                       [%- 
+                               c.action.name
+                                       .replace("_"," ")
+                                       .replace("log", " log")
+                                       .replace("fancy","")
+                                       .replace("index","Repositories") 
+                                       FILTER ucfirst 
+                       -%]
                        
        
                        
 </div>
 
 
-
 <div id="content_holder">
        <div id="content" class="sub_holder">
                <div id="content_inner">
 </div>
 
 
+
 <div id="debug_holder">
        <div id="debug" class="sub_holder">
 
        [% USE Dumper %]
        <pre>
        [% Repository.path %]
-       [% Dumper.dump(c.action.name) %]
+       [%# Dumper.dump(c.req.path) %]
        </pre>
        
        </div>