added file and folder icons to tree view and updated favicon
[catagits/Gitalist.git] / root / wrapper.tt2
CommitLineData
c8a42dd5 1[%- IF no_wrapper || template.name.match('\.(css|js|txt)'); content; ELSE; -%]
82f94bce 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
d3feefcf 5<head>
f71a83ab 6 <!-- git core binaries version [% git_version %] -->
82f94bce 7 <meta charset="utf-8" />
8 <meta name="generator" content="gitweb/[% version %] git/[% git_version %]" />
9 <meta name="robots" content="index, nofollow" />
a349e797 10 <title>[%# FIXME - MING %][%-
da8f4f82 11 title = BLOCK;
12 c.config.sitename;
87581f05 13 IF Repository; ' - ' _ Repository.name | html; END;
906a2dd2 14 IF c.action; ' / ' _ c.action; END;
15 IF filename; ' - ' _ filename | html; END;
a349e797 16 IF c.action && c.action == 'tree'; '/'; END;
da8f4f82 17 END;
18 title;
19 -%] (Gitalist)</title>
20 [% INCLUDE '_header_feeds.tt2' %]
82f94bce 21
2b686219 22 <link rel="stylesheet" type="text/css" href="[% c.uri_for('/core.css') %]" />
97bdf7bc 23 <link rel="shortcut icon" href="[% c.uri_for('/static/favicon.ico') %]" type="image/png" />
71eba67c 24 <script type="text/javascript">
25 // FIXME: this should be in an external js file once c.uri_for works in js files
26 function compareDiffs(repo, path){
27 var f = document.theform;
28 if(!repo){
29 var repo = "";
30 }
31 if(!path){
32 var path = "";
33 }
34 var sha1,sha2;
35 for(var i=0,len=f.length;i<len;i++){
36 if(f[i].name == "sha1_a"){
37 if(f[i].checked){
38 sha1 = f[i].value;
39 }
40 }
41 if(f[i].name == "sha1_b"){
42 if(f[i].checked){
43 sha2 = f[i].value;
44 }
45 }
46 }
d808f958 47 document.location.href = "[% c.uri_for("/") %]" + repo + "/"+ sha2 + "/diff/" + sha1 + "/" + path;
71eba67c 48 }
066e05d3 49 // handles hover sub menus in IE
50 startList = function() {
51 if (document.getElementById && document.getElementById("actions_nav_link")) {
52 var navList = document.getElementById("actions_nav_list");
53 var navLink = document.getElementById("actions_nav_link");
54 // assign event handlers to each element
55 navLink.onmouseover=function() {
56 setNavClass(navList);
57 }
58 navList.onmouseover=function() {
59 setNavClass(navList);
60 }
61 navList.onmouseout=function() {
62 navList.className=navList.className.replace(" actions_nav_list_over", "");
63 }
64 navLink.onmouseout=function() {
65 navList.className=navList.className.replace(" actions_nav_list_over", "");
66 }
67 }
68
69 }
70 function setNavClass(el){
71 var link_el = document.getElementById("actions_nav_link");
72 var offsetAry = findPos(link_el);
73 // set position of list
74 el.style.left = offsetAry[0]+"px";
75 el.style.top = offsetAry[1]+30 +"px";
76 el.className+=" actions_nav_list_over";
77 }
78
79 function addLoadListener(fn){
80 if (typeof window.addEventListener != 'undefined') {
81 window.addEventListener('load', fn, false);
82 }else if (typeof document.addEventListener != 'undefined'){
83 document.addEventListener('load', fn, false);
84 }else if (typeof window.attachEvent != 'undefined'){
85 window.attachEvent('onload', fn);
86 }else{
87 var oldfn = window.onload;
88 if (typeof window.onload != 'function'){
89 window.onload = fn;
90 }else{
91 window.onload = function(){
92 oldfn();
93 fn();
94 };
95 }
96 }
97 }
98 function findPos(obj) {
99 var curleft = curtop = 0;
100 if (obj.offsetParent) {
101 do {
102 curleft += obj.offsetLeft;
103 curtop += obj.offsetTop;
104 }
105 while (obj = obj.offsetParent);
106 return [curleft,curtop];
107 }
108 }
109 addLoadListener(startList);
71eba67c 110 </script>
24701964 111</head>
112
113<body>
114
08d8bb08 115<div id="header_holder">
82f94bce 116 <div class="sub_holder">
08d8bb08 117 <div id="header">
118 <a href="[% c.uri_for('/') %]" id="logo"><img src="[% c.uri_for('/static/i/logo.png') %]" alt="Gitalist" /></a>
9143f8d4 119
08d8bb08 120 <div class="search">
ef0ad44d 121 [% IF Repository; INCLUDE 'nav/search.tt2'; ELSE; %]
122
123 <!--
124 [%# FIXME - Search submits to blank(ish) page %]
125 <form method="get" action="[% c.uri_for_action('/search') %]" enctype="application/x-www-form-urlencoded">
126 <p class="projsearch">Search:
127 <input type="text" name="s" value="[% search_text %]" />
128 </p>
129 </form>
130 -->
08d8bb08 131 [% END %]
132 </div>
82f94bce 133 </div>
134
135
136 <div id="nav_logs" [% 'style="visibility:hidden"' IF c.action.name == "index" %]>
9143f8d4 137
138 [% IF c.req.captures.size == 1; SET path = 'repository'; ELSE; SET path = 'ref'; END %]
139
82f94bce 140 <ul>
03686cdc 141 <li[% ' class="selected"' IF c.action.name.match('tree') %]><a href="[% c.uri_for_action('/ref/tree', c.req.captures) || c.uri_for_action('/repository/tree', c.req.captures) %]" id="tree">Tree</a></li>
9143f8d4 142
80d7575a 143 <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>
9143f8d4 144
80d7575a 145 <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>
9143f8d4 146
147
148 <li id="branch_selector">
9143f8d4 149 Branches
29e66d31 150 <select onchange="document.location.href='[% c.uri_for("/") %][% Repository.name %]/'+this.options[this.selectedIndex].text + '/shortlog';">
9143f8d4 151 <option value="">HEAD</option>
152
153 [% FOREACH branch_head IN Repository.heads %]
154 <option [% "selected" IF c.req.path.search(branch_head.name) %]>[% branch_head.name %]</option>
155 [% END %]
156
157 </select>
158 </li>
159
82f94bce 160 </ul>
161 </div>
162
163 <h1>
164 <a href="[% c.uri_for('/') %]">Home</a>
165
166 [%- IF Repository %]
167 / <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/shortlog">[% Repository.name %]</a>
168 [%- END %]
169 /
9143f8d4 170 [%- IF Repository %]
171 [%# FIXME: output branch name in a nicer way!!! #%]
172 [% FOREACH branch_head IN Repository.heads %]
173 [% IF c.req.path.search(branch_head.name) %]
174 <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/[% branch_head.name %]/shortlog">[% branch_head.name %]</a> /
175 [% END %]
176 [% END %]
177 [%- END %]
82f94bce 178
066e05d3 179
9143f8d4 180 [%-
97bdf7bc 181
182 #FIXME on a history view of a folder, don't show extra actions in dropdown
183 SET on_file_page = 1;
184
0aa355fb 185 SET actions_list = {
186 "blob" => 1,
187 "raw" => 1,
188 "blame" => 1,
189 "history" => 1,
190 };
191
066e05d3 192 SET action_name = c.action.name
193 .replace("_"," ")
194 .replace("log", " log")
195 .replace("fancy","")
196 .replace("index","Repositories");
197 action_name_ucfirst = action_name FILTER ucfirst;
97bdf7bc 198 IF actions_list.$action_name && on_file_page;
0aa355fb 199 '<a href="#" id="actions_nav_link"><span>' _ action_name_ucfirst _ '</span></a>';
200 ELSE;
201 action_name_ucfirst;
202 END;
066e05d3 203
9143f8d4 204 -%]
066e05d3 205
82f94bce 206 </h1>
207
066e05d3 208 [%-
066e05d3 209 IF actions_list.$action_name;
210 '<ul id="actions_nav_list">';
211 FOREACH action IN actions_list;
212 action_output = action.key FILTER ucfirst;
213 NEXT IF action_output == action_name_ucfirst;
214 action = action.key;
7a2c74c3 215 '<li><a href="' _ c.uri_for("/") _ c.req.path.replace(action_name, action) _ '">' _ action_output _ '</a></li>';
066e05d3 216 END;
217 '</ul>';
218 END;
219 -%]
220
82f94bce 221 </div>
222</div>
223
066e05d3 224
82f94bce 225<div id="content_holder">
226 <div id="content" class="sub_holder">
227 <div id="content_inner">
1fd8159c 228
82f94bce 229
d3feefcf 230
10938267 231 [% content %]
10938267 232
82f94bce 233
82f94bce 234 </div>
235 </div>
236</div>
69421cb7 237
eab82ed1 238<div id="footer_holder">
239 <div id="footer" class="sub_holder">
240
8d491fb3 241 <p>[% IF Repository; Repository.description | html IF Repository.description != "Unnamed repository; edit this file to name it for gitweb." ; END; %]</p>
eab82ed1 242
243 <a title="git homepage" href="http://git-scm.org"><img src="[% c.uri_for('/logo.png') %]" id="git_logo" alt="git" /></a>
244
245 <div id="feeds">
246 [% INCLUDE 'inc/footer_feeds.tt2' %]
247 </div>
82f94bce 248 </div>
eab82ed1 249
2cf1e781 250</div>
251
82f94bce 252
9143f8d4 253
eab82ed1 254<div id="debug_holder">
255 <div id="debug" class="sub_holder">
82f94bce 256
eab82ed1 257 <p>Debug:</p>
258
259 [% USE Dumper %]
260 <pre>
261 [% Repository.path %]
97bdf7bc 262 [%# Dumper.dump(Commit) %]
eab82ed1 263 </pre>
264
265 </div>
266</div>
ed30bf20 267
d3feefcf 268</body>
269</html>
c8a42dd5 270[%- END -%]