Commit | Line | Data |
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') %]" /> |
82f94bce |
23 | <link rel="shortcut icon" href="[% c.uri_for('/static/git-favicon.png') %]" 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 | } |
47 | document.location.href = "[% c.uri_for("/") %]" + repo + "/"+ sha1 + "/diff/" + sha2 + "/" + path; |
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"> |
b6867aab |
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"> |
149 | [%# FIXME: convert to c.uri_for_action #%] |
150 | |
151 | Branches |
152 | <select onchange="document.location.href='/[% Repository.name %]/'+this.options[this.selectedIndex].text + '/shortlog';"> |
153 | <option value="">HEAD</option> |
154 | |
155 | [% FOREACH branch_head IN Repository.heads %] |
156 | <option [% "selected" IF c.req.path.search(branch_head.name) %]>[% branch_head.name %]</option> |
157 | [% END %] |
158 | |
159 | </select> |
160 | </li> |
161 | |
82f94bce |
162 | </ul> |
163 | </div> |
164 | |
165 | <h1> |
166 | <a href="[% c.uri_for('/') %]">Home</a> |
167 | |
168 | [%- IF Repository %] |
169 | / <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/shortlog">[% Repository.name %]</a> |
170 | [%- END %] |
171 | / |
9143f8d4 |
172 | [%- IF Repository %] |
173 | [%# FIXME: output branch name in a nicer way!!! #%] |
174 | [% FOREACH branch_head IN Repository.heads %] |
175 | [% IF c.req.path.search(branch_head.name) %] |
176 | <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/[% branch_head.name %]/shortlog">[% branch_head.name %]</a> / |
177 | [% END %] |
178 | [% END %] |
179 | [%- END %] |
82f94bce |
180 | |
066e05d3 |
181 | |
9143f8d4 |
182 | [%- |
0aa355fb |
183 | SET actions_list = { |
184 | "blob" => 1, |
185 | "raw" => 1, |
186 | "blame" => 1, |
187 | "history" => 1, |
188 | }; |
189 | |
066e05d3 |
190 | SET action_name = c.action.name |
191 | .replace("_"," ") |
192 | .replace("log", " log") |
193 | .replace("fancy","") |
194 | .replace("index","Repositories"); |
195 | action_name_ucfirst = action_name FILTER ucfirst; |
0aa355fb |
196 | IF actions_list.$action_name; |
197 | '<a href="#" id="actions_nav_link"><span>' _ action_name_ucfirst _ '</span></a>'; |
198 | ELSE; |
199 | action_name_ucfirst; |
200 | END; |
066e05d3 |
201 | |
9143f8d4 |
202 | -%] |
066e05d3 |
203 | |
82f94bce |
204 | </h1> |
205 | |
066e05d3 |
206 | [%- |
066e05d3 |
207 | IF actions_list.$action_name; |
208 | '<ul id="actions_nav_list">'; |
209 | FOREACH action IN actions_list; |
210 | action_output = action.key FILTER ucfirst; |
211 | NEXT IF action_output == action_name_ucfirst; |
212 | action = action.key; |
213 | '<li><a href="/' _ c.req.path.replace(action_name, action) _ '">' _ action_output _ '</a></li>'; |
214 | END; |
215 | '</ul>'; |
216 | END; |
217 | -%] |
218 | |
82f94bce |
219 | </div> |
220 | </div> |
221 | |
066e05d3 |
222 | |
82f94bce |
223 | <div id="content_holder"> |
224 | <div id="content" class="sub_holder"> |
225 | <div id="content_inner"> |
1fd8159c |
226 | |
82f94bce |
227 | |
d3feefcf |
228 | |
10938267 |
229 | [% content %] |
10938267 |
230 | |
82f94bce |
231 | |
82f94bce |
232 | </div> |
233 | </div> |
234 | </div> |
69421cb7 |
235 | |
eab82ed1 |
236 | <div id="footer_holder"> |
237 | <div id="footer" class="sub_holder"> |
238 | |
8d491fb3 |
239 | <p>[% IF Repository; Repository.description | html IF Repository.description != "Unnamed repository; edit this file to name it for gitweb." ; END; %]</p> |
eab82ed1 |
240 | |
241 | <a title="git homepage" href="http://git-scm.org"><img src="[% c.uri_for('/logo.png') %]" id="git_logo" alt="git" /></a> |
242 | |
243 | <div id="feeds"> |
244 | [% INCLUDE 'inc/footer_feeds.tt2' %] |
245 | </div> |
82f94bce |
246 | </div> |
eab82ed1 |
247 | |
2cf1e781 |
248 | </div> |
249 | |
82f94bce |
250 | |
9143f8d4 |
251 | |
eab82ed1 |
252 | <div id="debug_holder"> |
253 | <div id="debug" class="sub_holder"> |
82f94bce |
254 | |
eab82ed1 |
255 | <p>Debug:</p> |
256 | |
257 | [% USE Dumper %] |
258 | <pre> |
259 | [% Repository.path %] |
066e05d3 |
260 | [%# Dumper.dump(c.req.path) %] |
eab82ed1 |
261 | </pre> |
262 | |
263 | </div> |
264 | </div> |
ed30bf20 |
265 | |
d3feefcf |
266 | </body> |
267 | </html> |
c8a42dd5 |
268 | [%- END -%] |