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