1e35105c63eafdca701233ba33c1e8764684ddca
[catagits/Gitalist.git] / root / wrapper.tt2
1 [%- IF no_wrapper || template.name.match('\.(css|js|txt)'); content; ELSE; -%]
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">
5 <head>
6   <!-- git core binaries version [% git_version %] -->
7   <meta charset="utf-8" />
8   <meta name="generator" content="gitweb/[% version %] git/[% git_version %]" />
9   <meta name="robots" content="index, nofollow" />
10   <title>[%# FIXME - MING %][%-
11     title = BLOCK;
12       c.config.sitename;
13       IF Repository; ' - ' _ Repository.name | html; END;
14       IF c.action;   ' / ' _ c.action; END;
15       IF filename;   ' - ' _ filename | html; END;
16       IF c.action && c.action == 'tree'; '/'; END;
17     END;
18     title;
19   -%] (Gitalist)</title>
20   [% INCLUDE '_header_feeds.tt2' %]
21    
22         <link rel="stylesheet" type="text/css" href="[% c.uri_for('/core.css') %]" />
23         <link rel="shortcut icon" href="[% c.uri_for('/static/favicon.ico') %]" />
24         <script src="[% c.uri_for('/static/js/jquery-min.js') %]"></script>
25         <script src="[% c.uri_for('/static/js/site.js') %]"></script>
26 </head>
27
28 <body>
29
30 <div id="header_holder">
31         <div class="sub_holder">
32                 <div id="header">
33                         <a href="[% c.uri_for('/') %]" id="logo"><img src="[% c.uri_for('/static/i/logo.png') %]" alt="Gitalist" /></a>
34
35                         <div class="search">
36                         [% IF Repository; INCLUDE 'nav/search.tt2'; ELSE; %]
37                         
38                         <!--
39                         [%# FIXME - Search submits to blank(ish) page %]
40                         <form method="get" action="[% c.uri_for_action('/search') %]" enctype="application/x-www-form-urlencoded">
41                            <p class="projsearch">Search:
42                             <input type="text" name="s" value="[% search_text %]" />
43                            </p>
44                         </form>
45                         -->
46                         [% END %]
47                         </div>
48                 </div>
49                 
50                 
51                 <div id="nav_logs" [% 'style="visibility:hidden"' IF c.action.name == "index" %]>
52                 
53                         [% IF c.req.captures.size == 1; SET path = 'repository'; ELSE; SET path = 'ref'; END %]
54                         
55                         <ul>
56                                 <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>
57
58                                 <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>
59                                 
60                                 <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>
61
62                                 
63                                 <li id="branch_selector">
64                                         Branches 
65                                         <select id='branch-list'>
66                                                 <option value="">HEAD</option>
67                                         [% FOREACH branch IN Repository.heads %]
68                                                 <option value="[% branch.name %]">[% branch.name %]</option>
69                                         [% END %]
70                                         
71                                         </select>
72                                 </li>
73                                 
74                         </ul>
75                 </div>
76         
77                 <h1>
78                         <a href="[% c.uri_for('/') %]">Home</a>
79                 
80                         [%- IF Repository %]
81                 / <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/shortlog">[% Repository.name %]</a>
82                         [%- END %]
83                         /
84                         [%- IF Repository %]
85                                 [%# FIXME: output branch name in a nicer way!!!  #%]
86                                 [% FOREACH branch_head IN Repository.heads %]
87                                         [% IF c.req.path.search(branch_head.name) %]
88                                 <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]/[% branch_head.name %]/shortlog">[% branch_head.name %]</a> /
89                                         [% END %]
90                                 [% END %]
91                         [%- END %]
92                         
93                         
94                         [%- 
95                                 
96                                 #FIXME on a history view of a folder, don't show extra actions in dropdown
97                                 SET on_file_page = 1;
98                                 
99                                 SET actions_list = {
100                                                 "blob"          => 1,
101                                                 "raw"           => 1,
102                                                 "blame"         => 1,
103                                                 "history"       => 1,
104                                         };
105                                         
106                                 SET action_name = c.action.name
107                                                                         .replace("_"," ")
108                                                                         .replace("log", " log")
109                                                                         .replace("fancy","")
110                                                                         .replace("index","Repositories");
111                                 action_name_ucfirst = action_name FILTER ucfirst;
112                                 IF actions_list.$action_name && on_file_page;
113                                         '<a href="#" id="actions_nav_link"><span>' _ action_name_ucfirst _ '</span></a>';
114                                 ELSE;
115                                         action_name_ucfirst;
116                                 END;
117                                 
118                         -%]
119
120                         </h1>
121         
122                         [%- 
123                                 IF actions_list.$action_name;
124                                 '<ul id="actions_nav_list">';
125                                         FOREACH action IN actions_list;
126                                                 action_output = action.key FILTER ucfirst;
127                                                 NEXT IF action_output == action_name_ucfirst;   
128                                                 action = action.key;
129                                                 '<li><a href="' _ c.uri_for("/")  _ c.req.path.replace(action_name, action) _ '">' _ action_output _ '</a></li>';
130                                         END;                    
131                                 '</ul>';
132                                 END;
133                         -%]
134                 
135         </div>
136 </div>
137
138         
139 <div id="content_holder">
140         <div id="content" class="sub_holder">
141                 <div id="content_inner">
142
143         
144
145  [% content %]
146
147  
148                 </div>
149         </div>
150 </div>
151
152 <div id="footer_holder">
153         <div id="footer" class="sub_holder">
154                 
155                 <p>[% IF Repository; Repository.description | html IF Repository.description != "Unnamed repository; edit this file to name it for gitweb." ; END; %]</p>
156         
157                 <a title="git homepage" href="http://git-scm.org"><img src="[% c.uri_for('/logo.png') %]" id="git_logo" alt="git" /></a>
158                 
159                 <div id="feeds">
160                 [% INCLUDE 'inc/footer_feeds.tt2' %]
161                 </div>
162         </div>
163
164 </div>
165
166
167
168 <div id="debug_holder">
169         <div id="debug" class="sub_holder">
170
171         <p>Debug:</p>
172         
173         [% USE Dumper %]
174         <pre>
175         [% Repository.path %]
176         [% Dumper.dump(c.req.args) %]
177         </pre>
178         
179         </div>
180 </div>
181
182 <span id="current-uri" class="js-data">[%
183       # A bit of smoke and mirrors to get the /repository/shortlog URIs working
184       cur_act = '' _ c.action;
185       cur_uri = cur_act.match("log") || cur_act.match("^ref")
186               ? '/ref/' _ cur_act.replace("^(repository|ref)/", '')
187               : cur_act;
188       # XXX I just want lists!
189       IF c.req.args.size > 0;
190           c.uri_for_action(cur_uri, [Repository.name, 'HEAD'], c.req.args.0);
191       ELSE;
192           c.uri_for_action(cur_uri, [Repository.name, 'HEAD']);
193       END;
194 %]</span>
195
196 </body>
197 </html>
198 [%- END -%]