##// END OF EJS Templates
foucs on quick login username after activation
marcink -
r1319:57185e93 beta
parent child Browse files
Show More
@@ -1,399 +1,400
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.html"/>
3 3
4 4 <!-- HEADER -->
5 5 <div id="header">
6 6 <!-- user -->
7 7 <ul id="logged-user">
8 8 <li class="first">
9 9
10 10 <div id="quick_login" style="display:none">
11 11 ${h.form(h.url('login_home',came_from=h.url.current()))}
12 12 <div class="form">
13 13 <div class="fields">
14 14 <div class="field">
15 15 <div class="label">
16 16 <label for="username">${_('Username')}:</label>
17 17 </div>
18 18 <div class="input">
19 19 ${h.text('username',class_='focus',size=40)}
20 20 </div>
21 21
22 22 </div>
23 23 <div class="field">
24 24 <div class="label">
25 25 <label for="password">${_('Password')}:</label>
26 26 </div>
27 27 <div class="input">
28 28 ${h.password('password',class_='focus',size=40)}
29 29 </div>
30 30
31 31 </div>
32 32 <div class="buttons">
33 33 ${h.submit('sign_in','Sign In',class_="ui-button")}
34 34 </div>
35 35 </div>
36 36 </div>
37 37 ${h.end_form()}
38 38 <script type="text/javascript">
39 39 YUE.on('quick_login_link','click',function(e){
40 40
41 41 if(YUD.hasClass('quick_login_link','enabled')){
42 42 YUD.setStyle('quick_login','display','none');
43 43 YUD.removeClass('quick_login_link','enabled');
44 44 }
45 45 else{
46 46 YUD.setStyle('quick_login','display','');
47 47 YUD.addClass('quick_login_link','enabled');
48 YUD.get('username').focus();
48 49 }
49 50 //make sure we don't redirect
50 51 YUE.preventDefault(e);
51 52 });
52 53
53 54 </script>
54 55 </div>
55 56
56 57 <div class="gravatar">
57 58 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
58 59 </div>
59 60 <div class="account">
60 61 %if c.rhodecode_user.username == 'default':
61 62 <a href="${h.url('public_journal')}">${_('Public journal')}</a>
62 63 %else:
63 64 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
64 65 %endif
65 66 </div>
66 67 </li>
67 68 <li>
68 69 <a href="${h.url('home')}">${_('Home')}</a>
69 70 </li>
70 71 %if c.rhodecode_user.username != 'default':
71 72 <li>
72 73 <a href="${h.url('journal')}">${_('Journal')}</a>
73 74 ##(${c.unread_journal}
74 75 </li>
75 76 %endif
76 77 %if c.rhodecode_user.username == 'default':
77 78 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'),id='quick_login_link')}</li>
78 79 %else:
79 80 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
80 81 %endif
81 82 </ul>
82 83 <!-- end user -->
83 84 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
84 85 <div id="logo">
85 86 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
86 87 </div>
87 88 <!-- MENU -->
88 89 ${self.page_nav()}
89 90 <!-- END MENU -->
90 91 ${self.body()}
91 92 </div>
92 93 </div>
93 94 <!-- END HEADER -->
94 95
95 96 <!-- CONTENT -->
96 97 <div id="content">
97 98 <div class="flash_msg">
98 99 <% messages = h.flash.pop_messages() %>
99 100 % if messages:
100 101 <ul id="flash-messages">
101 102 % for message in messages:
102 103 <li class="${message.category}_msg">${message}</li>
103 104 % endfor
104 105 </ul>
105 106 % endif
106 107 </div>
107 108 <div id="main">
108 109 ${next.main()}
109 110 </div>
110 111 </div>
111 112 <!-- END CONTENT -->
112 113
113 114 <!-- FOOTER -->
114 115 <div id="footer">
115 116 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
116 117 <div>
117 118 <p class="footer-link">
118 119 <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
119 120 </p>
120 121 <p class="footer-link-right">
121 122 <a href="${h.url('rhodecode_official')}">RhodeCode</a>
122 123 ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
123 124 </p>
124 125 </div>
125 126 </div>
126 127 <script type="text/javascript">
127 128 function tooltip_activate(){
128 129 ${h.tooltip.activate()}
129 130 }
130 131 tooltip_activate();
131 132 </script>
132 133 </div>
133 134 <!-- END FOOTER -->
134 135
135 136 ### MAKO DEFS ###
136 137 <%def name="page_nav()">
137 138 ${self.menu()}
138 139 </%def>
139 140
140 141 <%def name="breadcrumbs()">
141 142 <div class="breadcrumbs">
142 143 ${self.breadcrumbs_links()}
143 144 </div>
144 145 </%def>
145 146
146 147
147 148 <%def name="menu(current=None)">
148 149 <%
149 150 def is_current(selected):
150 151 if selected == current:
151 152 return h.literal('class="current"')
152 153 %>
153 154 %if current not in ['home','admin']:
154 155 ##REGULAR MENU
155 156 <ul id="quick">
156 157 <!-- repo switcher -->
157 158 <li>
158 159 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
159 160 <span class="icon">
160 161 <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" />
161 162 </span>
162 163 <span>&darr;</span>
163 164 </a>
164 165 <ul id="repo_switcher_list" class="repo_switcher">
165 166 <li>
166 167 <a href="#">${_('loading...')}</a>
167 168 </li>
168 169 </ul>
169 170 <script type="text/javascript">
170 171 YUE.on('repo_switcher','mouseover',function(){
171 172 function qfilter(){
172 173 var S = YAHOO.util.Selector;
173 174
174 175 var q_filter = YUD.get('q_filter_rs');
175 176 var F = YAHOO.namespace('q_filter_rs');
176 177
177 178 YUE.on(q_filter,'click',function(){
178 179 q_filter.value = '';
179 180 });
180 181
181 182 F.filterTimeout = null;
182 183
183 184 F.updateFilter = function() {
184 185 // Reset timeout
185 186 F.filterTimeout = null;
186 187
187 188 var obsolete = [];
188 189 var nodes = S.query('ul#repo_switcher_list li a.repo_name');
189 190 var req = YUD.get('q_filter_rs').value;
190 191 for (n in nodes){
191 192 YUD.setStyle(nodes[n].parentNode,'display','')
192 193 }
193 194 if (req){
194 195 for (n in nodes){
195 196 console.log(n);
196 197 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
197 198 obsolete.push(nodes[n]);
198 199 }
199 200 }
200 201 if(obsolete){
201 202 for (n in obsolete){
202 203 YUD.setStyle(obsolete[n].parentNode,'display','none');
203 204 }
204 205 }
205 206 }
206 207 }
207 208
208 209 YUE.on(q_filter,'keyup',function(e){
209 210 clearTimeout(F.filterTimeout);
210 211 setTimeout(F.updateFilter,600);
211 212 });
212 213 }
213 214 var loaded = YUD.hasClass('repo_switcher','loaded');
214 215 if(!loaded){
215 216 YUD.addClass('repo_switcher','loaded');
216 217 YAHOO.util.Connect.asyncRequest('GET',"${h.url('repo_switcher')}",{
217 218 success:function(o){
218 219 YUD.get('repo_switcher_list').innerHTML = o.responseText;
219 220 qfilter();
220 221 },
221 222 failure:function(o){
222 223 YUD.removeClass('repo_switcher','loaded');
223 224 }
224 225 },null);
225 226 }
226 227 return false;
227 228 });
228 229 </script>
229 230 </li>
230 231
231 232 <li ${is_current('summary')}>
232 233 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
233 234 <span class="icon">
234 235 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
235 236 </span>
236 237 <span>${_('Summary')}</span>
237 238 </a>
238 239 </li>
239 240 ##<li ${is_current('shortlog')}>
240 241 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
241 242 ## <span class="icon">
242 243 ## <img src="${h.url("/images/icons/application_view_list.png")}" alt="${_('Shortlog')}" />
243 244 ## </span>
244 245 ## <span>${_('Shortlog')}</span>
245 246 ## </a>
246 247 ##</li>
247 248 <li ${is_current('changelog')}>
248 249 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
249 250 <span class="icon">
250 251 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
251 252 </span>
252 253 <span>${_('Changelog')}</span>
253 254 </a>
254 255 </li>
255 256
256 257 <li ${is_current('switch_to')}>
257 258 <a title="${_('Switch to')}" href="#">
258 259 <span class="icon">
259 260 <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" />
260 261 </span>
261 262 <span>${_('Switch to')}</span>
262 263 </a>
263 264 <ul>
264 265 <li>
265 266 ${h.link_to('%s (%s)' % (_('branches'),len(c.rhodecode_repo.branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
266 267 <ul>
267 268 %if c.rhodecode_repo.branches.values():
268 269 %for cnt,branch in enumerate(c.rhodecode_repo.branches.items()):
269 270 <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>
270 271 %endfor
271 272 %else:
272 273 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
273 274 %endif
274 275 </ul>
275 276 </li>
276 277 <li>
277 278 ${h.link_to('%s (%s)' % (_('tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
278 279 <ul>
279 280 %if c.rhodecode_repo.tags.values():
280 281 %for cnt,tag in enumerate(c.rhodecode_repo.tags.items()):
281 282 <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>
282 283 %endfor
283 284 %else:
284 285 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
285 286 %endif
286 287 </ul>
287 288 </li>
288 289 </ul>
289 290 </li>
290 291 <li ${is_current('files')}>
291 292 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
292 293 <span class="icon">
293 294 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
294 295 </span>
295 296 <span>${_('Files')}</span>
296 297 </a>
297 298 </li>
298 299
299 300 <li ${is_current('options')}>
300 301 <a title="${_('Options')}" href="#">
301 302 <span class="icon">
302 303 <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" />
303 304 </span>
304 305 <span>${_('Options')}</span>
305 306 </a>
306 307 <ul>
307 308 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
308 309 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
309 310 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
310 311 %else:
311 312 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
312 313 %endif
313 314 %endif
314 315 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
315 316 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
316 317
317 318 % if h.HasPermissionAll('hg.admin')('access admin main page'):
318 319 <li>
319 320 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
320 321 <%def name="admin_menu()">
321 322 <ul>
322 323 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
323 324 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
324 325 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
325 326 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
326 327 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
327 328 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
328 329 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
329 330 </ul>
330 331 </%def>
331 332
332 333 ${admin_menu()}
333 334 </li>
334 335 % endif
335 336 </ul>
336 337 </li>
337 338
338 339 <li>
339 340 <a title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
340 341 <span class="icon_short">
341 342 <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" />
342 343 </span>
343 344 <span id="current_followers_count" class="short">${c.repository_followers}</span>
344 345 </a>
345 346 </li>
346 347 <li>
347 348 <a title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}">
348 349 <span class="icon_short">
349 350 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" />
350 351 </span>
351 352 <span class="short">${c.repository_forks}</span>
352 353 </a>
353 354 </li>
354 355
355 356 </ul>
356 357 %else:
357 358 ##ROOT MENU
358 359 <ul id="quick">
359 360 <li>
360 361 <a title="${_('Home')}" href="${h.url('home')}">
361 362 <span class="icon">
362 363 <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" />
363 364 </span>
364 365 <span>${_('Home')}</span>
365 366 </a>
366 367 </li>
367 368 % if c.rhodecode_user.username != 'default':
368 369 <li>
369 370 <a title="${_('Journal')}" href="${h.url('journal')}">
370 371 <span class="icon">
371 372 <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
372 373 </span>
373 374 <span>${_('Journal')}</span>
374 375 </a>
375 376 </li>
376 377 % endif
377 378 <li>
378 379 <a title="${_('Search')}" href="${h.url('search')}">
379 380 <span class="icon">
380 381 <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
381 382 </span>
382 383 <span>${_('Search')}</span>
383 384 </a>
384 385 </li>
385 386
386 387 %if h.HasPermissionAll('hg.admin')('access admin main page'):
387 388 <li ${is_current('admin')}>
388 389 <a title="${_('Admin')}" href="${h.url('admin_home')}">
389 390 <span class="icon">
390 391 <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
391 392 </span>
392 393 <span>${_('Admin')}</span>
393 394 </a>
394 395 ${admin_menu()}
395 396 </li>
396 397 %endif
397 398 </ul>
398 399 %endif
399 400 </%def> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now