Files @ ad49bbd8f984
Branch filter:

Location: kallithea/rhodecode/templates/base/base.html - annotation

Bradley M. Kuhn
changelog - should refer to Mercurial repository logs instead
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
1e757ac98988
41241617a7a3
41241617a7a3
41241617a7a3
41241617a7a3
d561eb3787f5
41241617a7a3
ffd45b185016
05ed7e20bd0f
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
41241617a7a3
41241617a7a3
41241617a7a3
41241617a7a3
41241617a7a3
41241617a7a3
f91d3f9b7230
41241617a7a3
f91d3f9b7230
41241617a7a3
f91d3f9b7230
ffd45b185016
f91d3f9b7230
41241617a7a3
41241617a7a3
f91d3f9b7230
41241617a7a3
1e757ac98988
41241617a7a3
41241617a7a3
ea41c494cc3f
41241617a7a3
41241617a7a3
e61a656b44bd
41241617a7a3
b4f401524060
36f7562a5919
36f7562a5919
36f7562a5919
36f7562a5919
ffd45b185016
cdf10b3df899
ffd45b185016
cdf10b3df899
b4f401524060
41241617a7a3
41241617a7a3
41241617a7a3
16c153cf1759
41241617a7a3
1e757ac98988
41241617a7a3
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
41241617a7a3
41241617a7a3
41241617a7a3
41241617a7a3
1e757ac98988
1e757ac98988
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
1c32b72930fa
ffd45b185016
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
100be6988bb0
1c32b72930fa
100be6988bb0
ffd45b185016
100be6988bb0
7e3d89d9d3a2
ffd45b185016
100be6988bb0
7e3d89d9d3a2
ffd45b185016
7e3d89d9d3a2
1c32b72930fa
1c32b72930fa
1c32b72930fa
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
ceb7fdf4588a
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
9e677f6d34cb
87c97fcea029
8087731920d8
87c97fcea029
87c97fcea029
ffd45b185016
87c97fcea029
ffd45b185016
ffd45b185016
ffd45b185016
1c32b72930fa
ffd45b185016
87c97fcea029
6aa83fecf669
87c97fcea029
87c97fcea029
c65b440540da
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
87c97fcea029
87c97fcea029
ffd45b185016
87c97fcea029
87c97fcea029
ffd45b185016
ffd45b185016
87c97fcea029
ffd45b185016
ffd45b185016
ffd45b185016
87c97fcea029
87c97fcea029
87c97fcea029
9bf927589f7a
87c97fcea029
9bf927589f7a
87c97fcea029
87c97fcea029
e9ac7544c2f6
e9ac7544c2f6
e9ac7544c2f6
e9ac7544c2f6
e9ac7544c2f6
ffd45b185016
ffd45b185016
e9ac7544c2f6
e9ac7544c2f6
ffd45b185016
e9ac7544c2f6
ffd45b185016
e9ac7544c2f6
e9ac7544c2f6
87c97fcea029
87c97fcea029
9bf927589f7a
ffd45b185016
9bf927589f7a
9bf927589f7a
9bf927589f7a
9bf927589f7a
9bf927589f7a
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
87c97fcea029
049bc911b04f
d4bb8de7382f
f01540c62f8a
9bf927589f7a
9bf927589f7a
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
b9de46161c96
f01540c62f8a
049bc911b04f
d4bb8de7382f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
b5ce72167906
049bc911b04f
5fc9c92025c1
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
b5ce72167906
049bc911b04f
5fc9c92025c1
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
ffd45b185016
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
7e73c0f4f335
4ae17f819ee8
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
7e73c0f4f335
ffd45b185016
049bc911b04f
049bc911b04f
049bc911b04f
049bc911b04f
5fc9c92025c1
d4bb8de7382f
d4bb8de7382f
d4bb8de7382f
049bc911b04f
41241617a7a3
1e757ac98988
b4f401524060
b4f401524060
b4f401524060
b4f401524060
b4f401524060
9bf927589f7a
e7600fe19943
eacd33e0c5b3
ffd45b185016
e7600fe19943
ffd45b185016
1c32b72930fa
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
1c32b72930fa
e7600fe19943
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
1c32b72930fa
e7600fe19943
1c32b72930fa
dc4644865e8b
ffd45b185016
ffd45b185016
dc4644865e8b
dc4644865e8b
ffd45b185016
ffd45b185016
dc4644865e8b
ffd45b185016
ffd45b185016
dc4644865e8b
dc4644865e8b
dc4644865e8b
1c32b72930fa
ffd45b185016
ffd45b185016
1c32b72930fa
1c32b72930fa
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
1c32b72930fa
1c32b72930fa
e7600fe19943
100be6988bb0
1c32b72930fa
ffd45b185016
ffd45b185016
1c32b72930fa
100be6988bb0
100be6988bb0
1aee8b0cea70
1c32b72930fa
1c32b72930fa
1c32b72930fa
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
962f753552cd
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
962f753552cd
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
5842d2115a25
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
81bbb8086f03
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
d561eb3787f5
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
## -*- coding: utf-8 -*-
<%inherit file="root.html"/>

<!-- HEADER -->
<div id="header">
    <div id="header-inner" class="title">
        <div id="logo">
            <div class="header">
                <a href="${h.url('home')}"><img src="${h.url('/images/kallithea-logo.png')}" alt="RhodeCode"/></a>
            </div>
            %if c.rhodecode_name:
             <div class="branding">- ${c.rhodecode_name}</div>
            %endif
        </div>
        <!-- MENU -->
        ${self.page_nav()}
        <!-- END MENU -->
        ${self.body()}
    </div>
</div>
<!-- END HEADER -->

<!-- CONTENT -->
<div id="content">
    ${self.flash_msg()}
    <div id="main">
        ${next.main()}
    </div>
</div>
<!-- END CONTENT -->

<!-- FOOTER -->
<div id="footer">
   <div id="footer-inner" class="title">
       <div>
           <p class="footer-link">
               ${_('Server instance: %s') % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}
           </p>
           <p class="footer-link-right">
               RhodeCode
               %if c.visual.show_version:
                   ${c.rhodecode_version}
               %endif
               &copy; 2010-${h.datetime.today().year}, <a href="${h.url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
               %if c.rhodecode_bugtracker:
                   &ndash; <a href="${c.rhodecode_bugtracker}" target="_blank">${_('Support')}</a>
               %endif
           </p>
       </div>
   </div>
</div>

<!-- END FOOTER -->

### MAKO DEFS ###

<%def name="flash_msg()">
    <%include file="/base/flash_msg.html"/>
</%def>

<%def name="breadcrumbs()">
    <div class="breadcrumbs">
    ${self.breadcrumbs_links()}
    </div>
</%def>

<%def name="admin_menu()">
  <ul class="admin_menu">
      <li><a href="${h.url('admin_home')}"><i class="icon-book"></i> ${_('Admin journal')}</a></li>
      <li><a href="${h.url('repos')}"><i class="icon-archive"></i> ${_('Repositories')}</a></li>
      <li><a href="${h.url('repos_groups')}"><i class="icon-folder-close"></i> ${_('Repository groups')}</a></li>
      <li><a href="${h.url('users')}"><i class="icon-user"></i> ${_('Users')}</a></li>
      <li><a href="${h.url('users_groups')}"><i class="icon-group"></i> ${_('User groups')}</a></li>
      <li><a href="${h.url('admin_permissions')}"><i class="icon-ban-circle"></i> ${_('Permissions')}</a></li>
      <li><a href="${h.url('auth_home')}"><i class="icon-key"></i> ${_('Authentication')}</a></li>
      <li><a href="${h.url('defaults')}"><i class="icon-wrench"></i> ${_('Defaults')}</a></li>
      <li class="last"><a href="${h.url('admin_settings')}"><i class="icon-cog"></i> ${_('Settings')}</a></li>
  </ul>

</%def>


## admin menu used for people that have some admin resources
<%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
  <ul>
   %if repositories:
      <li><a href="${h.url('repos')}"><i class="icon-archive"></i> ${_('Repositories')}</a></li>
   %endif
   %if repository_groups:
      <li><a href="${h.url('repos_groups')}"><i class="icon-folder-close"></i> ${_('Repository groups')}</a></li>
   %endif
   %if user_groups:
      <li><a href="${h.url('users_groups')}"><i class="icon-group"></i> ${_('User groups')}</a></li>
   %endif
  </ul>
</%def>

<%def name="repo_context_bar(current=None)">
  <%
      def follow_class():
          if c.repository_following:
              return h.literal('following')
          else:
              return h.literal('follow')
  %>
  <%
    def is_current(selected):
        if selected == current:
            return h.literal('class="current"')
    %>

  <!--- CONTEXT BAR -->
  <div id="context-bar" class="box">
      <h2>
        %if h.is_hg(c.rhodecode_db_repo):
          <i class="icon-hg" style="color: #316293; font-size: 24px"></i>
        %endif
        %if h.is_git(c.rhodecode_db_repo):
          <i class="icon-git" style="color: #e85634; font-size: 24px"></i>
        %endif

        ## public/private
        %if c.rhodecode_db_repo.private:
          <i class="icon-lock"></i>
        %else:
          <i class="icon-unlock-alt"></i>
        %endif
        ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}

        %if current == 'createfork':
         - ${_('Create fork')}
        %endif
      </h2>
      <!--
      <div id="breadcrumbs">
        ${h.link_to(_(u'Repositories'),h.url('home'))}
        &raquo;
        ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
      </div>
      -->
      <ul id="context-pages" class="horizontal-list">
        <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-file-text"></i> ${_('Summary')}</a></li>
        <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}"><i class="icon-time"></i> ${_('Changelog')}</a></li>
        <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}"><i class="icon-file"></i> ${_('Files')}</a></li>
        <li ${is_current('switch-to')}>
          <a href="#" id="branch_tag_switcher_2" class="dropdown"><i class="icon-random"></i> ${_('Switch To')}</a>
          <ul id="switch_to_list_2" class="switch_to submenu">
            <li><a href="#">${_('Loading...')}</a></li>
          </ul>
        </li>
        <li ${is_current('options')}>
             %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
               <a href="${h.url('edit_repo',repo_name=c.repo_name)}" class="dropdown"><i class="icon-cogs"></i> ${_('Options')}</a>
             %else:
               <a href="#" class="dropdown"><i class="icon-cogs"></i> ${_('Options')}</a>
             %endif
          <ul>
             %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
                   <li><a href="${h.url('edit_repo',repo_name=c.repo_name)}"><i class="icon-cog"></i> ${_('Settings')}</a></li>
             %endif
              %if c.rhodecode_db_repo.fork:
               <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type=c.rhodecode_db_repo.landing_rev[0],org_ref=c.rhodecode_db_repo.landing_rev[1], other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],other_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}">
                   <i class="icon-loop"></i> ${_('Compare fork')}</a></li>
              %endif
              <li><a href="${h.url('compare_home',repo_name=c.repo_name)}"><i class="icon-loop"></i> ${_('Compare')}</a></li>

              <li><a href="${h.url('search_repo',repo_name=c.repo_name)}"><i class="icon-search"></i> ${_('Search')}</a></li>

              %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
                %if c.rhodecode_db_repo.locked[0]:
                  <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
                %else:
                  <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
                %endif
              %endif
              ## TODO: this check feels wrong, it would be better to have a check for permissions
              ## also it feels like a job for the controller
              %if c.rhodecode_user.username != 'default':
                  <li>
                   <a class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');">
                    <span class="show-follow"><i class="icon-heart-empty"></i> ${_('Follow')}</span>
                    <span class="show-following"><i class="icon-heart"></i> ${_('Unfollow')}</span>
                  </a>
                  </li>
                  <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-code-fork"></i> ${_('Fork')}</a></li>
                  %if h.is_hg(c.rhodecode_repo):
                  <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-code-fork"></i> ${_('Create Pull Request')}</a></li>
                  %endif
              %endif
             </ul>
        </li>
        <li ${is_current('showpullrequest')}>
          <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}"> <i class="icon-code-fork"></i> ${_('Pull Requests')}
            %if c.repository_pull_requests:
              <span>${c.repository_pull_requests}</span>
            %endif
          </a>
        </li>
      </ul>
  </div>
  <script type="text/javascript">
      YUE.on('branch_tag_switcher_2','mouseover',function(){
         var loaded = YUD.hasClass('branch_tag_switcher_2','loaded');
         if(!loaded){
             YUD.addClass('branch_tag_switcher_2','loaded');
             ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2',
                 function(o){},
                 function(o){YUD.removeClass('branch_tag_switcher_2','loaded');}
                 ,null);
         }
         return false;
      });
  </script>
  <!--- END CONTEXT BAR -->
</%def>

<%def name="usermenu()">
    ## USER MENU
    <li>
      <a class="menu_link childs" id="quick_login_link">
          <span class="icon">
             <img src="${h.gravatar_url(c.rhodecode_user.email,20)}" alt="avatar">
          </span>
          %if c.rhodecode_user.username != 'default':
            <span class="menu_link_user">${c.rhodecode_user.username}</span>
            %if c.unread_notifications != 0:
              <span class="menu_link_notifications">${c.unread_notifications}</span>
            %endif
          %else:
              <span>${_('Not logged in')}</span>
          %endif
      </a>

  <div class="user-menu">
      <div id="quick_login">
        %if c.rhodecode_user.username == 'default':
            <h4>${_('Login to your account')}</h4>
            ${h.form(h.url('login_home',came_from=h.url.current()))}
            <div class="form">
                <div class="fields">
                    <div class="field">
                        <div class="label">
                            <label for="username">${_('Username')}:</label>
                        </div>
                        <div class="input">
                            ${h.text('username',class_='focus')}
                        </div>

                    </div>
                    <div class="field">
                        <div class="label">
                            <label for="password">${_('Password')}:</label>
                        </div>
                        <div class="input">
                            ${h.password('password',class_='focus')}
                        </div>

                    </div>
                    <div class="buttons">
                        <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
                        <div class="register">
                        %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
                         ${h.link_to(_("Don't have an account ?"),h.url('register'))}
                        %endif
                        </div>
                        <div class="submit">
                            ${h.submit('sign_in',_('Log In'),class_="btn btn-mini")}
                        </div>
                    </div>
                </div>
            </div>
            ${h.end_form()}
        %else:
            <div class="links_left">
                <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
                <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
                <div class="email">${c.rhodecode_user.email}</div>
            </div>
            <div class="links_right">
            <ol class="links">
              <li><a href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a></li>
              <li>${h.link_to(_(u'My account'),h.url('my_account'))}</li>
              <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
            </ol>
            </div>
        %endif
      </div>
  </div>

    </li>
</%def>

<%def name="menu(current=None)">
        <%
        def is_current(selected):
            if selected == current:
                return h.literal('class="current"')
        %>
        <ul id="quick" class="horizontal-list">
          <!-- repo switcher -->
          <li ${is_current('repositories')}>
            <input id="repo_switcher" name="repo_switcher" type="hidden">
          </li>

          ##ROOT MENU
          %if c.rhodecode_user.username != 'default':
            <li ${is_current('journal')}>
              <a class="menu_link" title="${_('Show recent activity')}"  href="${h.url('journal')}">
                <i class="icon-book"></i> ${_('Journal')}
              </a>
            </li>
          %else:
            <li ${is_current('journal')}>
              <a class="menu_link" title="${_('Public journal')}"  href="${h.url('public_journal')}">
                <i class="icon-book"></i> ${_('Public journal')}
              </a>
            </li>
          %endif
            <li ${is_current('gists')}>
              <a class="menu_link childs" title="${_('Show public gists')}"  href="${h.url('gists')}">
                <i class="icon-file-2"></i> ${_('Gists')}
              </a>
                <ul class="admin_menu">
                  <li><a href="${h.url('new_gist', public=1)}"><i class="icon-file-alt"></i> ${_('Create new gist')}</a></li>
                  <li><a href="${h.url('gists')}"><i class="icon-copy"></i> ${_('All public gists')}</a></li>
                  %if c.rhodecode_user.username != 'default':
                    <li><a href="${h.url('gists', public=1)}"><i class="icon-copy"></i> ${_('My public gists')}</a></li>
                    <li><a href="${h.url('gists', private=1)}"><i class="icon-file-text"></i> ${_('My private gists')}</a></li>
                  %endif
                </ul>
            </li>
          <li ${is_current('search')}>
              <a class="menu_link" title="${_('Search in repositories')}"  href="${h.url('search')}">
                <i class="icon-search"></i> ${_('Search')}
              </a>
          </li>
          % if h.HasPermissionAll('hg.admin')('access admin main page'):
            <li ${is_current('admin')}>
              <a class="menu_link childs" title="${_('Admin')}" href="${h.url('admin_home')}">
                <i class="icon-cog"></i> ${_('Admin')}
              </a>
              ${admin_menu()}
            </li>
          % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
          <li ${is_current('admin')}>
              <a class="menu_link childs" title="${_('Admin')}">
                <i class="icon-cog"></i> ${_('Admin')}
              </a>
              ${admin_menu_simple(c.rhodecode_user.repositories_admin,
                                  c.rhodecode_user.repository_groups_admin,
                                  c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
          </li>
          % endif
          ${usermenu()}

    <script type="text/javascript">
        var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
        var cache = {}
        /*format the look of items in the list*/
        var format = function(state){
            if (!state.id){
              return state.text; // optgroup
            }
            var obj_dict = state.obj;
            var tmpl = '';

            if(obj_dict && state.type == 'repo'){
                tmpl += '<span class="repo-icons">';
                if(obj_dict['repo_type'] === 'hg'){
                    tmpl += '<i class="icon-hg"></i> ';
                }
                else if(obj_dict['repo_type'] === 'git'){
                    tmpl += '<i class="icon-git"></i> ';
                }
                if(obj_dict['private']){
                    tmpl += '<i class="icon-lock" style="color: #e85634;"></i> ';
                }
                else if(visual_show_public_icon){
                    tmpl += '<i class="icon-unlock-alt"></i> ';
                }
                tmpl += '</span>';
            }
            if(obj_dict && state.type == 'group'){
                    tmpl += '<i class="icon-folder-close"></i> ';
            }
            tmpl += state.text;
            return tmpl;
        }

        $("#repo_switcher").select2({
            placeholder: '<i class="icon-archive"></i> ${_('Repositories')}',
            dropdownAutoWidth: true,
            formatResult: format,
            formatSelection: format,
            formatNoMatches: function(term){
                return "${_('No matches found')}";
            },
            containerCssClass: "repo-switcher",
            dropdownCssClass: "repo-switcher-dropdown",
            escapeMarkup: function(m){
                // don't escape our custom placeholder
                if(m.substr(0,28) == '<i class="icon-archive"></i>'){
                    return m;
                }

                return Select2.util.escapeMarkup(m);
            },
            query: function(query){
              var key = 'cache';
              var cached = cache[key] ;
              if(cached) {
                var data = {results: []};
                //filter results
                $.each(cached.results, function(){
                    var section = this.text;
                    var children = [];
                    $.each(this.children, function(){
                        if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
                            children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj})
                        }
                    })
                    if(children.length !== 0){
                        data.results.push({'text': section, 'children': children})
                    }

                });
                query.callback(data);
              }else{
                  $.ajax({
                    url: "${h.url('repo_switcher_data')}",
                    data: {},
                    dataType: 'json',
                    type: 'GET',
                    success: function(data) {
                      cache[key] = data;
                      query.callback({results: data.results});
                    }
                  })
              }
            },
        });

        $("#repo_switcher").on('select2-selecting', function(e){
            e.preventDefault();
            window.location = pyroutes.url('summary_home', {'repo_name': e.val})
        })

        ## Global mouse bindings ##

        // general help "?"
        Mousetrap.bind(['?'], function(e) {
            $('#help_kb').modal({})
        });

        // / open the quick filter
        Mousetrap.bind(['/'], function(e) {
            $("#repo_switcher").select2("open");

            // return false to prevent default browser behavior
            // and stop event from bubbling
            return false;
        });

        // ctrl/command+b, show the the main bar
        Mousetrap.bind(['command+b', 'ctrl+b'], function(e) {
            if($('#header-inner').hasClass('hover') && $('#content').hasClass('hover')){
                $('#header-inner').removeClass('hover');
                $('#content').removeClass('hover');
            }
            else{
                $('#header-inner').addClass('hover');
                $('#content').addClass('hover');
            }
            return false;
        });

        // general nav g + action
        Mousetrap.bind(['g h'], function(e) {
            window.location = pyroutes.url('home');
        });
        Mousetrap.bind(['g g'], function(e) {
            window.location = pyroutes.url('gists', {'private':1});
        });
        Mousetrap.bind(['g G'], function(e) {
            window.location = pyroutes.url('gists', {'public':1});
        });
        Mousetrap.bind(['n g'], function(e) {
            window.location = pyroutes.url('new_gist');
        });
        Mousetrap.bind(['n r'], function(e) {
            window.location = pyroutes.url('new_repo');
        });

        % if hasattr(c, 'repo_name') and hasattr(c, 'rhodecode_db_repo'):
            // nav in repo context
            Mousetrap.bind(['g s'], function(e) {
                window.location = pyroutes.url('summary_home', {'repo_name': REPO_NAME});
            });
            Mousetrap.bind(['g c'], function(e) {
                window.location = pyroutes.url('changelog_home', {'repo_name': REPO_NAME});
            });
            Mousetrap.bind(['g F'], function(e) {
                window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.rhodecode_db_repo.landing_rev[1]}', 'f_path': '', 'search': '1'});
            });
            Mousetrap.bind(['g f'], function(e) {
                window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.rhodecode_db_repo.landing_rev[1]}', 'f_path': ''});
            });
            Mousetrap.bind(['g o'], function(e) {
                window.location = pyroutes.url('edit_repo', {'repo_name': REPO_NAME});
            });
            Mousetrap.bind(['g O'], function(e) {
                window.location = pyroutes.url('edit_repo_perms', {'repo_name': REPO_NAME});
            });
        % endif

    </script>
</%def>

<div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">${_('Keyboard shortcuts')}</h4>
        </div>
        <div class="modal-body">
           <div class="row">
              <div class="col-md-5">
                <table class="keyboard-mappings">
                    <tbody>
                  <tr>
                    <th></th>
                    <th>${_('Site-wide shortcuts')}</th>
                  </tr>
                  <%
                     elems = [
                         ('/', 'Open quick search box'),
                         ('ctrl/cmd+b', 'Show main settings bar'),
                         ('g h', 'Goto home page'),
                         ('g g', 'Goto my private gists page'),
                         ('g G', 'Goto my public gists page'),
                         ('n r', 'New repository page'),
                         ('n g', 'New gist page'),
                     ]
                  %>
                  %for key, desc in elems:
                  <tr>
                    <td class="keys">
                      <span class="key">${key}</span>
                    </td>
                    <td>${desc}</td>
                  </tr>
                %endfor
                </tbody>
                  </table>
              </div>
              <div class="col-md-offset-5">
                <table class="keyboard-mappings">
                <tbody>
                  <tr>
                    <th></th>
                    <th>${_('Repositories')}</th>
                  </tr>
                  <%
                     elems = [
                         ('g s', 'Goto summary page'),
                         ('g c', 'Goto changelog page'),
                         ('g f', 'Goto files page'),
                         ('g F', 'Goto files page with file search activated'),
                         ('g o', 'Goto repository settings'),
                         ('g O', 'Goto repository permissions settings'),
                     ]
                  %>
                  %for key, desc in elems:
                  <tr>
                    <td class="keys">
                      <span class="key">${key}</span>
                    </td>
                    <td>${desc}</td>
                  </tr>
                %endfor
                </tbody>
            </table>
              </div>
            </div>
        </div>
        <div class="modal-footer">
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->