Skip to content

Commit

Permalink
added branch and tree to nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxtons Web Design authored and broquaint committed Mar 27, 2010
1 parent 189f3b0 commit 9143f8d
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 24 deletions.
2 changes: 0 additions & 2 deletions root/repository/shortlog.tt2
@@ -1,4 +1,2 @@
[% subinclude('/fragment/' _ c.action, c.req.captures, c.req.parameters) %]

<h2>Branches</h2>
[% subinclude('/fragment/repository/heads', c.req.captures) %]
44 changes: 28 additions & 16 deletions root/static/css/core.css
@@ -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;
Expand Down Expand Up @@ -41,7 +58,7 @@ a img{
float:left;
}
#header .search{
margin-right:50px;
margin-right:10px;
float:right;
}
#git_logo{
Expand All @@ -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;
Expand Down Expand Up @@ -105,15 +110,22 @@ 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;
}
#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;
}



Expand Down
Binary file added root/static/i/icons/tree.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 49 additions & 6 deletions root/wrapper.tt2
Expand Up @@ -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; %]

Expand All @@ -44,11 +44,40 @@


<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>

Expand All @@ -59,9 +88,23 @@
/ <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
-%]



Expand All @@ -71,7 +114,6 @@
</div>



<div id="content_holder">
<div id="content" class="sub_holder">
<div id="content_inner">
Expand Down Expand Up @@ -100,6 +142,7 @@
</div>



<div id="debug_holder">
<div id="debug" class="sub_holder">

Expand All @@ -108,7 +151,7 @@
[% USE Dumper %]
<pre>
[% Repository.path %]
[% Dumper.dump(c.action.name) %]
[%# Dumper.dump(c.req.path) %]
</pre>

</div>
Expand Down

0 comments on commit 9143f8d

Please sign in to comment.