##// END OF EJS Templates
when logged in as admin the repo settings will point to admin settings.
marcink -
r916:41532107 beta
parent child Browse files
Show More
@@ -1,381 +1,385
1 1 ## -*- coding: utf-8 -*-
2 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
4 4 <head>
5 5 <title>${next.title()}</title>
6 6 <link rel="icon" href="/images/icons/database_gear.png" type="image/png" />
7 7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8 <meta name="robots" content="index, nofollow"/>
9 9 <!-- stylesheets -->
10 10 ${self.css()}
11 11 <!-- scripts -->
12 12 ${self.js()}
13 13 %if c.ga_code:
14 14 <script type="text/javascript">
15 15
16 16 var _gaq = _gaq || [];
17 17 _gaq.push(['_setAccount', '${c.ga_code}']);
18 18 _gaq.push(['_trackPageview']);
19 19
20 20 (function() {
21 21 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
22 22 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
23 23 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
24 24 })();
25 25
26 26
27 27 </script>
28 28 %endif
29 29 </head>
30 30 <body>
31 31 <!-- header -->
32 32 <div id="header">
33 33 <!-- user -->
34 34 <ul id="logged-user">
35 35 <li class="first">
36 36 <div class="gravatar">
37 37 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
38 38 </div>
39 39 <div class="account">
40 40 %if c.rhodecode_user.username == 'default':
41 41 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
42 42 ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
43 43 %else:
44 44 ${h.link_to('anonymous',h.url('#'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
45 45 %endif
46 46
47 47 %else:
48 48 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
49 49 %endif
50 50 </div>
51 51 </li>
52 52 <li>
53 53 <a href="${h.url('home')}">${_('Home')}</a>
54 54 </li>
55 55 %if c.rhodecode_user.username != 'default':
56 56 <li>
57 57 <a href="${h.url('journal')}">${_('Journal')}</a>
58 58 ##(${c.unread_journal})</a>
59 59 </li>
60 60 %endif
61 61 %if c.rhodecode_user.username == 'default':
62 62 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
63 63 %else:
64 64 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
65 65 %endif
66 66 </ul>
67 67 <!-- end user -->
68 68 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
69 69 <!-- logo -->
70 70 <div id="logo">
71 71 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
72 72 </div>
73 73 <!-- end logo -->
74 74 <!-- menu -->
75 75 ${self.page_nav()}
76 76 <!-- quick -->
77 77 </div>
78 78 </div>
79 79 <!-- end header -->
80 80
81 81 <!-- CONTENT -->
82 82 <div id="content">
83 83 <div class="flash_msg">
84 84 <% messages = h.flash.pop_messages() %>
85 85 % if messages:
86 86 <ul id="flash-messages">
87 87 % for message in messages:
88 88 <li class="${message.category}_msg">${message}</li>
89 89 % endfor
90 90 </ul>
91 91 % endif
92 92 </div>
93 93 <div id="main">
94 94 ${next.main()}
95 95 </div>
96 96 </div>
97 97 <!-- END CONTENT -->
98 98
99 99 <!-- footer -->
100 100 <div id="footer">
101 101 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
102 102 <div>
103 103 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
104 104 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
105 105 <p>RhodeCode ${c.rhodecode_version} &copy; 2010 by Marcin Kuzminski</p>
106 106 </div>
107 107 </div>
108 108 <script type="text/javascript">${h.tooltip.activate()}</script>
109 109 </div>
110 110 <!-- end footer -->
111 111 </body>
112 112
113 113 </html>
114 114
115 115 ### MAKO DEFS ###
116 116 <%def name="page_nav()">
117 117 ${self.menu()}
118 118 </%def>
119 119
120 120 <%def name="menu(current=None)">
121 121 <%
122 122 def is_current(selected):
123 123 if selected == current:
124 124 return h.literal('class="current"')
125 125 %>
126 126 %if current not in ['home','admin']:
127 127 ##REGULAR MENU
128 128 <ul id="quick">
129 129 <!-- repo switcher -->
130 130 <li>
131 131 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
132 132 <span class="icon">
133 133 <img src="/images/icons/database.png" alt="${_('Products')}" />
134 134 </span>
135 135 <span>&darr;</span>
136 136 </a>
137 137 <ul class="repo_switcher">
138 138 %for repo in c.cached_repo_list:
139 139
140 140 %if repo['repo'].dbrepo.private:
141 141 <li><img src="/images/icons/lock.png" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
142 142 %else:
143 143 <li><img src="/images/icons/lock_open.png" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
144 144 %endif
145 145 %endfor
146 146 </ul>
147 147 </li>
148 148
149 149 <li ${is_current('summary')}>
150 150 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
151 151 <span class="icon">
152 152 <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" />
153 153 </span>
154 154 <span>${_('Summary')}</span>
155 155 </a>
156 156 </li>
157 157 ##<li ${is_current('shortlog')}>
158 158 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
159 159 ## <span class="icon">
160 160 ## <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" />
161 161 ## </span>
162 162 ## <span>${_('Shortlog')}</span>
163 163 ## </a>
164 164 ##</li>
165 165 <li ${is_current('changelog')}>
166 166 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
167 167 <span class="icon">
168 168 <img src="/images/icons/time.png" alt="${_('Changelog')}" />
169 169 </span>
170 170 <span>${_('Changelog')}</span>
171 171 </a>
172 172 </li>
173 173
174 174 <li ${is_current('switch_to')}>
175 175 <a title="${_('Switch to')}" href="#">
176 176 <span class="icon">
177 177 <img src="/images/icons/arrow_switch.png" alt="${_('Switch to')}" />
178 178 </span>
179 179 <span>${_('Switch to')}</span>
180 180 </a>
181 181 <ul>
182 182 <li>
183 183 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
184 184 <ul>
185 185 %if c.repository_branches.values():
186 186 %for cnt,branch in enumerate(c.repository_branches.items()):
187 187 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
188 188 %endfor
189 189 %else:
190 190 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
191 191 %endif
192 192 </ul>
193 193 </li>
194 194 <li>
195 195 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
196 196 <ul>
197 197 %if c.repository_tags.values():
198 198 %for cnt,tag in enumerate(c.repository_tags.items()):
199 199 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
200 200 %endfor
201 201 %else:
202 202 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
203 203 %endif
204 204 </ul>
205 205 </li>
206 206 </ul>
207 207 </li>
208 208 <li ${is_current('files')}>
209 209 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
210 210 <span class="icon">
211 211 <img src="/images/icons/file.png" alt="${_('Files')}" />
212 212 </span>
213 213 <span>${_('Files')}</span>
214 214 </a>
215 215 </li>
216 216
217 217 <li ${is_current('options')}>
218 218 <a title="${_('Options')}" href="#">
219 219 <span class="icon">
220 220 <img src="/images/icons/table_gear.png" alt="${_('Admin')}" />
221 221 </span>
222 222 <span>${_('Options')}</span>
223 223 </a>
224 224 <ul>
225 225 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
226 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
226 %if h.HasPermissionAll('hg.admin')('access admin main page'):
227 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
228 %else:
229 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
230 %endif
227 231 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
228 232 %endif
229 233 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
230 234
231 235 %if h.HasPermissionAll('hg.admin')('access admin main page'):
232 236 <li>
233 237 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
234 238 <%def name="admin_menu()">
235 239 <ul>
236 240 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
237 241 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
238 242 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
239 243 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
240 244 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
241 245 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
242 246 </ul>
243 247 </%def>
244 248
245 249 ${admin_menu()}
246 250 </li>
247 251 %endif
248 252
249 253 </ul>
250 254 </li>
251 255
252 256 <li>
253 257 <a title="${_('Followers')}" href="#">
254 258 <span class="icon_short">
255 259 <img src="/images/icons/heart.png" alt="${_('Followers')}" />
256 260 </span>
257 261 <span class="short">${c.repository_followers}</span>
258 262 </a>
259 263 </li>
260 264 <li>
261 265 <a title="${_('Forks')}" href="#">
262 266 <span class="icon_short">
263 267 <img src="/images/icons/arrow_divide.png" alt="${_('Forks')}" />
264 268 </span>
265 269 <span class="short">${c.repository_forks}</span>
266 270 </a>
267 271 </li>
268 272
269 273
270 274
271 275 </ul>
272 276 %else:
273 277 ##ROOT MENU
274 278 <ul id="quick">
275 279 <li>
276 280 <a title="${_('Home')}" href="${h.url('home')}">
277 281 <span class="icon">
278 282 <img src="/images/icons/home_16.png" alt="${_('Home')}" />
279 283 </span>
280 284 <span>${_('Home')}</span>
281 285 </a>
282 286 </li>
283 287 %if c.rhodecode_user.username != 'default':
284 288 <li>
285 289 <a title="${_('Journal')}" href="${h.url('journal')}">
286 290 <span class="icon">
287 291 <img src="/images/icons/book.png" alt="${_('Journal')}" />
288 292 </span>
289 293 <span>${_('Journal')}</span>
290 294 </a>
291 295 </li>
292 296 %endif
293 297 <li>
294 298 <a title="${_('Search')}" href="${h.url('search')}">
295 299 <span class="icon">
296 300 <img src="/images/icons/search_16.png" alt="${_('Search')}" />
297 301 </span>
298 302 <span>${_('Search')}</span>
299 303 </a>
300 304 </li>
301 305
302 306 %if h.HasPermissionAll('hg.admin')('access admin main page'):
303 307 <li ${is_current('admin')}>
304 308 <a title="${_('Admin')}" href="${h.url('admin_home')}">
305 309 <span class="icon">
306 310 <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" />
307 311 </span>
308 312 <span>${_('Admin')}</span>
309 313 </a>
310 314 ${admin_menu()}
311 315 </li>
312 316 %endif
313 317 </ul>
314 318 %endif
315 319 </%def>
316 320
317 321
318 322 <%def name="css()">
319 323 <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
320 324 <link rel="stylesheet" type="text/css" href="/css/pygments.css" />
321 325 <link rel="stylesheet" type="text/css" href="/css/diff.css" />
322 326 </%def>
323 327
324 328 <%def name="js()">
325 329 ##<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
326 330 ##<script type="text/javascript" src="/js/yui/container/container.js"></script>
327 331 ##<script type="text/javascript" src="/js/yui/datasource/datasource.js"></script>
328 332 ##<script type="text/javascript" src="/js/yui/autocomplete/autocomplete.js"></script>
329 333 ##<script type="text/javascript" src="/js/yui/selector/selector-min.js"></script>
330 334
331 335 <script type="text/javascript" src="/js/yui2a.js"></script>
332 336 <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
333 337 <script type="text/javascript" src="/js/yui.flot.js"></script>
334 338
335 339 <script type="text/javascript">
336 340 var base_url ='/_admin/toggle_following';
337 341 var YUC = YAHOO.util.Connect;
338 342 var YUD = YAHOO.util.Dom;
339 343 var YUE = YAHOO.util.Event;
340 344
341 345 function onSuccess(){
342 346
343 347 var f = YUD.get('follow_toggle');
344 348 if(f.getAttribute('class')=='follow'){
345 349 f.setAttribute('class','following');
346 350 f.setAttribute('title',"${_('Stop following this repository')}");
347 351 }
348 352 else{
349 353 f.setAttribute('class','follow');
350 354 f.setAttribute('title',"${_('Start following this repository')}");
351 355 }
352 356 }
353 357
354 358 function toggleFollowingUser(fallows_user_id,token){
355 359 args = 'follows_user_id='+fallows_user_id;
356 360 args+= '&amp;auth_token='+token;
357 361 YUC.asyncRequest('POST',base_url,{
358 362 success:function(o){
359 363 onSuccess();
360 364 }
361 365 },args); return false;
362 366 }
363 367
364 368 function toggleFollowingRepo(fallows_repo_id,token){
365 369 args = 'follows_repo_id='+fallows_repo_id;
366 370 args+= '&amp;auth_token='+token;
367 371 YUC.asyncRequest('POST',base_url,{
368 372 success:function(o){
369 373 onSuccess();
370 374 }
371 375 },args); return false;
372 376 }
373 377 </script>
374 378
375 379 </%def>
376 380
377 381 <%def name="breadcrumbs()">
378 382 <div class="breadcrumbs">
379 383 ${self.breadcrumbs_links()}
380 384 </div>
381 385 </%def> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now