##// END OF EJS Templates
use merge param in compare link for it to work as expected
marcink -
r3613:6bc4b63b beta
parent child Browse files
Show More
@@ -1,341 +1,341 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.html"/>
3 3
4 4 <!-- HEADER -->
5 5 <div id="header-dd"></div>
6 6 <div id="header">
7 7 <div id="header-inner" class="title">
8 8 <div id="logo">
9 9 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
10 10 </div>
11 11 <!-- MENU -->
12 12 ${self.page_nav()}
13 13 <!-- END MENU -->
14 14 ${self.body()}
15 15 </div>
16 16 </div>
17 17 <!-- END HEADER -->
18 18
19 19 <!-- CONTENT -->
20 20 <div id="content">
21 21 <div class="flash_msg">
22 22 <% messages = h.flash.pop_messages() %>
23 23 % if messages:
24 24 <ul id="flash-messages">
25 25 % for message in messages:
26 26 <li class="${message.category}_msg">${message}</li>
27 27 % endfor
28 28 </ul>
29 29 % endif
30 30 </div>
31 31 <div id="main">
32 32 ${next.main()}
33 33 </div>
34 34 </div>
35 35 <!-- END CONTENT -->
36 36
37 37 <!-- FOOTER -->
38 38 <div id="footer">
39 39 <div id="footer-inner" class="title">
40 40 <div>
41 41 <p class="footer-link">
42 42 <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
43 43 </p>
44 44 <p class="footer-link-right">
45 45 <a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a>
46 46 ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
47 47 </p>
48 48 </div>
49 49 </div>
50 50 </div>
51 51 <!-- END FOOTER -->
52 52
53 53 ### MAKO DEFS ###
54 54 <%def name="breadcrumbs()">
55 55 <div class="breadcrumbs">
56 56 ${self.breadcrumbs_links()}
57 57 </div>
58 58 </%def>
59 59
60 60 <%def name="context_bar(current)">
61 61 ${repo_context_bar(current)}
62 62 </%def>
63 63
64 64 <%def name="admin_menu()">
65 65 <ul class="admin_menu">
66 66 <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal ')}</li>
67 67 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
68 68 <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li>
69 69 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
70 70 <li>${h.link_to(_('user groups'),h.url('users_groups'),class_='groups')}</li>
71 71 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
72 72 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
73 73 <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li>
74 74 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
75 75 </ul>
76 76 </%def>
77 77
78 78 <%def name="admin_menu_simple()">
79 79 <ul>
80 80 <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li>
81 81 </ul>
82 82 </%def>
83 83
84 84 <%def name="repo_context_bar(current=None)">
85 85 <%
86 86 def follow_class():
87 87 if c.repository_following:
88 88 return h.literal('following')
89 89 else:
90 90 return h.literal('follow')
91 91 %>
92 92 <%
93 93 def is_current(selected):
94 94 if selected == current:
95 95 return h.literal('class="current"')
96 96 %>
97 97
98 98 <!--- CONTEXT BAR -->
99 99 <div id="context-bar" class="box">
100 100 <div id="breadcrumbs">
101 101 ${h.link_to(_(u'Repositories'),h.url('home'))}
102 102 &raquo;
103 103 ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
104 104 </div>
105 105 <ul id="context-pages" class="horizontal-list">
106 106 <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li>
107 107 <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelog')}</a></li>
108 108 <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li>
109 109 <li ${is_current('switch-to')}>
110 110 <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a>
111 111 <ul id="switch_to_list_2" class="switch_to submenu">
112 112 <li><a href="#">${_('loading...')}</a></li>
113 113 </ul>
114 114 </li>
115 115 <li ${is_current('options')}>
116 116 <a href="#" class="dropdown options"></span>${_('Options')}</a>
117 117 <ul>
118 118 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
119 119 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
120 120 <li>${h.link_to(_('Settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
121 121 %else:
122 122 <li>${h.link_to(_('Settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
123 123 %endif
124 124 %endif
125 125 %if c.rhodecode_db_repo.fork:
126 <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li>
126 <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default', merge=1),class_='compare_request')}</li>
127 127 %endif
128 128 <li>${h.link_to(_('Lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li>
129 129 <li>${h.link_to(_('Search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li>
130 130
131 131 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
132 132 %if c.rhodecode_db_repo.locked[0]:
133 133 <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
134 134 %else:
135 135 <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
136 136 %endif
137 137 %endif
138 138 ## TODO: this check feels wrong, it would be better to have a check for permissions
139 139 ## also it feels like a job for the controller
140 140 %if c.rhodecode_user.username != 'default':
141 141 <li>
142 142 <a class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');">
143 143 <span class="show-follow">${_('Follow')}</span>
144 144 <span class="show-following">${_('Unfollow')}</span>
145 145 </a>
146 146 </li>
147 147 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li>
148 148 %if h.is_hg(c.rhodecode_repo):
149 149 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Create Pull Request')}</a></li>
150 150 %endif
151 151 %endif
152 152 </ul>
153 153 </li>
154 154 <li ${is_current('showpullrequest')}>
155 155 <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">${_('Pull Requests')}
156 156 %if c.repository_pull_requests:
157 157 <span>${c.repository_pull_requests}</span>
158 158 %endif
159 159 </a>
160 160 </li>
161 161 </ul>
162 162 </div>
163 163 <script type="text/javascript">
164 164 YUE.on('branch_tag_switcher_2','mouseover',function(){
165 165 var loaded = YUD.hasClass('branch_tag_switcher_2','loaded');
166 166 if(!loaded){
167 167 YUD.addClass('branch_tag_switcher_2','loaded');
168 168 ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2',
169 169 function(o){},
170 170 function(o){YUD.removeClass('branch_tag_switcher_2','loaded');}
171 171 ,null);
172 172 }
173 173 return false;
174 174 });
175 175 </script>
176 176 <!--- END CONTEXT BAR -->
177 177 </%def>
178 178
179 179 <%def name="usermenu()">
180 180 ## USER MENU
181 181 <li>
182 182 <a class="menu_link childs" id="quick_login_link">
183 183 <span class="icon">
184 184 <img src="${h.gravatar_url(c.rhodecode_user.email,20)}" alt="avatar">
185 185 </span>
186 186 %if c.rhodecode_user.username != 'default':
187 187 <span class="menu_link_user">${c.rhodecode_user.username}</span>
188 188 %if c.unread_notifications != 0:
189 189 <span class="menu_link_notifications">${c.unread_notifications}</span>
190 190 %endif
191 191 %else:
192 192 <span>${_('Not logged in')}</span>
193 193 %endif
194 194 </a>
195 195
196 196 <div class="user-menu">
197 197 <div id="quick_login">
198 198 %if c.rhodecode_user.username == 'default':
199 199 <h4>${_('Login to your account')}</h4>
200 200 ${h.form(h.url('login_home',came_from=h.url.current()))}
201 201 <div class="form">
202 202 <div class="fields">
203 203 <div class="field">
204 204 <div class="label">
205 205 <label for="username">${_('Username')}:</label>
206 206 </div>
207 207 <div class="input">
208 208 ${h.text('username',class_='focus')}
209 209 </div>
210 210
211 211 </div>
212 212 <div class="field">
213 213 <div class="label">
214 214 <label for="password">${_('Password')}:</label>
215 215 </div>
216 216 <div class="input">
217 217 ${h.password('password',class_='focus')}
218 218 </div>
219 219
220 220 </div>
221 221 <div class="buttons">
222 222 <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
223 223 <div class="register">
224 224 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
225 225 ${h.link_to(_("Don't have an account ?"),h.url('register'))}
226 226 %endif
227 227 </div>
228 228 <div class="submit">
229 229 ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")}
230 230 </div>
231 231 </div>
232 232 </div>
233 233 </div>
234 234 ${h.end_form()}
235 235 %else:
236 236 <div class="links_left">
237 237 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
238 238 <div class="email">${c.rhodecode_user.email}</div>
239 239 <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
240 240 ##<div class="notifications"><a href="${h.url('notifications')}">${_('Notifications')}</a></div>
241 241 <div class="unread"><a href="${h.url('notifications')}">${_('Unread notifications')}: ${c.unread_notifications}</a></div>
242 242 </div>
243 243 <div class="links_right">
244 244 <ol class="links">
245 245 ##<li>${h.link_to(_(u'Home'),h.url('home'))}</li>
246 246 <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li>
247 247 <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li>
248 248 <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
249 249 </ol>
250 250 </div>
251 251 %endif
252 252 </div>
253 253 </div>
254 254
255 255 </li>
256 256 </%def>
257 257
258 258 <%def name="menu(current=None)">
259 259 <%
260 260 def is_current(selected):
261 261 if selected == current:
262 262 return h.literal('class="current"')
263 263 %>
264 264 <ul id="quick" class="horizontal-list">
265 265 <!-- repo switcher -->
266 266 <li ${is_current('repositories')}>
267 267 <a class="menu_link repo_switcher childs" id="repo_switcher" title="${_('Switch repository')}" href="${h.url('home')}">
268 268 ${_('Repositories')}
269 269 </a>
270 270 <ul id="repo_switcher_list" class="repo_switcher">
271 271 <li>
272 272 <a href="#">${_('loading...')}</a>
273 273 </li>
274 274 </ul>
275 275 </li>
276 276 ##ROOT MENU
277 277 %if c.rhodecode_user.username != 'default':
278 278 <li ${is_current('journal')}>
279 279 <a class="menu_link journal" title="${_('Show recent activity')}" href="${h.url('journal')}">
280 280 ${_('Journal')}
281 281 </a>
282 282 </li>
283 283 %else:
284 284 <li ${is_current('journal')}>
285 285 <a class="menu_link journal" title="${_('Public journal')}" href="${h.url('public_journal')}">
286 286 ${_('Public journal')}
287 287 </a>
288 288 </li>
289 289 %endif
290 290 <li ${is_current('search')}>
291 291 <a class="menu_link search" title="${_('Search in repositories')}" href="${h.url('search')}">
292 292 ${_('Search')}
293 293 </a>
294 294 </li>
295 295 % if h.HasPermissionAll('hg.admin')('access admin main page'):
296 296 <li ${is_current('admin')}>
297 297 <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}">
298 298 ${_('Admin')}
299 299 </a>
300 300 ${admin_menu()}
301 301 </li>
302 302 % elif c.rhodecode_user.groups_admin:
303 303 <li ${is_current('admin')}>
304 304 <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}">
305 305 ${_('Admin')}
306 306 </a>
307 307 ${admin_menu_simple()}
308 308 </li>
309 309 % endif
310 310 ${usermenu()}
311 311 <script type="text/javascript">
312 312 YUE.on('repo_switcher','mouseover',function(){
313 313 var target = 'q_filter_rs';
314 314 var qfilter_activate = function(){
315 315 var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
316 316 var func = function(node){
317 317 return node.parentNode;
318 318 }
319 319 q_filter(target,nodes,func);
320 320 }
321 321
322 322 var loaded = YUD.hasClass('repo_switcher','loaded');
323 323 if(!loaded){
324 324 YUD.addClass('repo_switcher','loaded');
325 325 ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
326 326 function(o){qfilter_activate();YUD.get(target).focus()},
327 327 function(o){YUD.removeClass('repo_switcher','loaded');}
328 328 ,null);
329 329 }else{
330 330 YUD.get(target).focus();
331 331 }
332 332 return false;
333 333 });
334 334
335 335 YUE.on('header-dd', 'click',function(e){
336 336 YUD.addClass('header-inner', 'hover');
337 337 YUD.addClass('content', 'hover');
338 338 });
339 339
340 340 </script>
341 341 </%def>
General Comments 0
You need to be logged in to leave comments. Login now