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