+#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;
float:left;
}
#header .search{
- margin-right:50px;
+ margin-right:10px;
float:right;
}
#git_logo{
#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;
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;
#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;
+}
<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>