##// END OF EJS Templates
ui: added search icon and spinner when search is performing.
marcink -
r4095:e030f9fa default
parent child Browse files
Show More
@@ -1,822 +1,825 b''
1 // navigation.less
1 // navigation.less
2 // For use in RhodeCode applications;
2 // For use in RhodeCode applications;
3 // see style guide documentation for guidelines.
3 // see style guide documentation for guidelines.
4
4
5 // TOP MAIN DARK NAVIGATION
5 // TOP MAIN DARK NAVIGATION
6
6
7 .header .main_nav.horizontal-list {
7 .header .main_nav.horizontal-list {
8 float: right;
8 float: right;
9 color: @grey4;
9 color: @grey4;
10 > li {
10 > li {
11 a {
11 a {
12 color: @grey4;
12 color: @grey4;
13 }
13 }
14 }
14 }
15 }
15 }
16
16
17 // HEADER NAVIGATION
17 // HEADER NAVIGATION
18
18
19 .horizontal-list {
19 .horizontal-list {
20 display: block;
20 display: block;
21 margin: 0;
21 margin: 0;
22 padding: 0;
22 padding: 0;
23 -webkit-padding-start: 0;
23 -webkit-padding-start: 0;
24 text-align: left;
24 text-align: left;
25 font-size: @navigation-fontsize;
25 font-size: @navigation-fontsize;
26 color: @grey6;
26 color: @grey6;
27 z-index:10;
27 z-index:10;
28
28
29 li {
29 li {
30 line-height: 1em;
30 line-height: 1em;
31 list-style-type: none;
31 list-style-type: none;
32 margin: 0 20px 0 0;
32 margin: 0 20px 0 0;
33
33
34 a {
34 a {
35 padding: 0 .5em;
35 padding: 0 .5em;
36
36
37 &.menu_link_notifications {
37 &.menu_link_notifications {
38 .pill(7px,@rcblue);
38 .pill(7px,@rcblue);
39 display: inline;
39 display: inline;
40 margin: 0 7px 0 .7em;
40 margin: 0 7px 0 .7em;
41 font-size: @basefontsize;
41 font-size: @basefontsize;
42 color: white;
42 color: white;
43
43
44 &.empty {
44 &.empty {
45 background-color: @grey4;
45 background-color: @grey4;
46 }
46 }
47
47
48 &:hover {
48 &:hover {
49 background-color: @rcdarkblue;
49 background-color: @rcdarkblue;
50 }
50 }
51 }
51 }
52 }
52 }
53 .pill_container {
53 .pill_container {
54 margin: 1.25em 0px 0px 0px;
54 margin: 1.25em 0px 0px 0px;
55 float: right;
55 float: right;
56 }
56 }
57
57
58 &#quick_login_li {
58 &#quick_login_li {
59 &:hover {
59 &:hover {
60 color: @grey5;
60 color: @grey5;
61 }
61 }
62
62
63 a.menu_link_notifications {
63 a.menu_link_notifications {
64 color: white;
64 color: white;
65 }
65 }
66
66
67 .user {
67 .user {
68 padding-bottom: 10px;
68 padding-bottom: 10px;
69 }
69 }
70 }
70 }
71
71
72 &:before { content: none; }
72 &:before { content: none; }
73
73
74 &:last-child {
74 &:last-child {
75 .menulabel {
75 .menulabel {
76 padding-right: 0;
76 padding-right: 0;
77 border-right: none;
77 border-right: none;
78
78
79 .show_more {
79 .show_more {
80 padding-right: 0;
80 padding-right: 0;
81 }
81 }
82 }
82 }
83
83
84 &> a {
84 &> a {
85 border-bottom: none;
85 border-bottom: none;
86 }
86 }
87 }
87 }
88
88
89 &.open {
89 &.open {
90
90
91 a {
91 a {
92 color: white;
92 color: white;
93 }
93 }
94 }
94 }
95
95
96 &:focus {
96 &:focus {
97 outline: none;
97 outline: none;
98 }
98 }
99
99
100 ul li {
100 ul li {
101 display: block;
101 display: block;
102
102
103 &:last-child> a {
103 &:last-child> a {
104 border-bottom: none;
104 border-bottom: none;
105 }
105 }
106
106
107 ul li:last-child a {
107 ul li:last-child a {
108 /* we don't expect more then 3 levels of submenu and the third
108 /* we don't expect more then 3 levels of submenu and the third
109 level can have different html structure */
109 level can have different html structure */
110 border-bottom: none;
110 border-bottom: none;
111 }
111 }
112 }
112 }
113 }
113 }
114
114
115 > li {
115 > li {
116 float: left;
116 float: left;
117 display: block;
117 display: block;
118 padding: 0;
118 padding: 0;
119
119
120 > a,
120 > a,
121 &.has_select2 a {
121 &.has_select2 a {
122 display: block;
122 display: block;
123 padding: 10px 0;
123 padding: 10px 0;
124 }
124 }
125
125
126 .menulabel {
126 .menulabel {
127 line-height: 1em;
127 line-height: 1em;
128 // for this specifically we do not use a variable
128 // for this specifically we do not use a variable
129 }
129 }
130
130
131 .menulink-counter {
131 .menulink-counter {
132 border: 1px solid @grey2;
132 border: 1px solid @grey2;
133 border-radius: @border-radius;
133 border-radius: @border-radius;
134 background: @grey7;
134 background: @grey7;
135 display: inline-block;
135 display: inline-block;
136 padding: 0px 4px;
136 padding: 0px 4px;
137 text-align: center;
137 text-align: center;
138 font-size: 12px;
138 font-size: 12px;
139 }
139 }
140
140
141 .pr_notifications {
141 .pr_notifications {
142 padding-left: .5em;
142 padding-left: .5em;
143 }
143 }
144
144
145 .pr_notifications + .menulabel {
145 .pr_notifications + .menulabel {
146 display:inline;
146 display:inline;
147 padding-left: 0;
147 padding-left: 0;
148 }
148 }
149
149
150 &:hover,
150 &:hover,
151 &.open,
151 &.open,
152 &.active {
152 &.active {
153 a {
153 a {
154 color: @rcblue;
154 color: @rcblue;
155 }
155 }
156 }
156 }
157 }
157 }
158
158
159 pre {
159 pre {
160 margin: 0;
160 margin: 0;
161 padding: 0;
161 padding: 0;
162 }
162 }
163
163
164 .select2-container,
164 .select2-container,
165 .menulink.childs {
165 .menulink.childs {
166 position: relative;
166 position: relative;
167 }
167 }
168
168
169 .menulink {
169 .menulink {
170 &.disabled {
170 &.disabled {
171 color: @grey3;
171 color: @grey3;
172 cursor: default;
172 cursor: default;
173 opacity: 0.5;
173 opacity: 0.5;
174 }
174 }
175 }
175 }
176
176
177 #quick_login {
177 #quick_login {
178
178
179 li a {
179 li a {
180 padding: .5em 0;
180 padding: .5em 0;
181 border-bottom: none;
181 border-bottom: none;
182 color: @grey2;
182 color: @grey2;
183
183
184 &:hover { color: @rcblue; }
184 &:hover { color: @rcblue; }
185 }
185 }
186 }
186 }
187
187
188 #quick_login_link {
188 #quick_login_link {
189 display: inline-block;
189 display: inline-block;
190
190
191 .gravatar {
191 .gravatar {
192 border: 1px solid @grey5;
192 border: 1px solid @grey5;
193 }
193 }
194
194
195 .gravatar-login {
195 .gravatar-login {
196 height: 20px;
196 height: 20px;
197 width: 20px;
197 width: 20px;
198 margin: -8px 0;
198 margin: -8px 0;
199 padding: 0;
199 padding: 0;
200 }
200 }
201
201
202 &:hover .user {
202 &:hover .user {
203 color: @grey6;
203 color: @grey6;
204 }
204 }
205 }
205 }
206 }
206 }
207 .header .horizontal-list {
207 .header .horizontal-list {
208
208
209 li {
209 li {
210
210
211 &#quick_login_li {
211 &#quick_login_li {
212 padding-left: .5em;
212 padding-left: .5em;
213 margin-right: 0px;
213 margin-right: 0px;
214
214
215 &:hover #quick_login_link {
215 &:hover #quick_login_link {
216 color: inherit;
216 color: inherit;
217 }
217 }
218
218
219 .menu_link_user {
219 .menu_link_user {
220 padding: 0 2px;
220 padding: 0 2px;
221 }
221 }
222 }
222 }
223 list-style-type: none;
223 list-style-type: none;
224 }
224 }
225
225
226 > li {
226 > li {
227
227
228 a {
228 a {
229 padding: 18px 0 12px 0;
229 padding: 18px 0 12px 0;
230 color: @nav-grey;
230 color: @nav-grey;
231
231
232 &.menu_link_notifications {
232 &.menu_link_notifications {
233 padding: 1px 8px;
233 padding: 1px 8px;
234 }
234 }
235 }
235 }
236
236
237 &:hover,
237 &:hover,
238 &.open,
238 &.open,
239 &.active {
239 &.active {
240 .pill_container a {
240 .pill_container a {
241 // don't select text for the pill container, it has it' own
241 // don't select text for the pill container, it has it' own
242 // hover behaviour
242 // hover behaviour
243 color: @nav-grey;
243 color: @nav-grey;
244 }
244 }
245 }
245 }
246
246
247 &:hover,
247 &:hover,
248 &.open,
248 &.open,
249 &.active {
249 &.active {
250 a {
250 a {
251 color: @grey6;
251 color: @grey6;
252 }
252 }
253 }
253 }
254
254
255 .select2-dropdown-open a {
255 .select2-dropdown-open a {
256 color: @grey6;
256 color: @grey6;
257 }
257 }
258
258
259 .repo-switcher {
259 .repo-switcher {
260 padding-left: 0;
260 padding-left: 0;
261
261
262 .menulabel {
262 .menulabel {
263 padding-left: 0;
263 padding-left: 0;
264 }
264 }
265 }
265 }
266 }
266 }
267
267
268 li ul li {
268 li ul li {
269 background-color:@grey2;
269 background-color:@grey2;
270
270
271 a {
271 a {
272 padding: .5em 0;
272 padding: .5em 0;
273 border-bottom: @border-thickness solid @border-default-color;
273 border-bottom: @border-thickness solid @border-default-color;
274 color: @grey6;
274 color: @grey6;
275 }
275 }
276
276
277 &:last-child a, &.last a{
277 &:last-child a, &.last a{
278 border-bottom: none;
278 border-bottom: none;
279 }
279 }
280
280
281 &:hover {
281 &:hover {
282 background-color: @grey3;
282 background-color: @grey3;
283 }
283 }
284 }
284 }
285
285
286 .submenu {
286 .submenu {
287 margin-top: 5px;
287 margin-top: 5px;
288 }
288 }
289 }
289 }
290
290
291 // SUBMENUS
291 // SUBMENUS
292 .navigation .submenu {
292 .navigation .submenu {
293 display: none;
293 display: none;
294 }
294 }
295
295
296 .navigation li.open {
296 .navigation li.open {
297 .submenu {
297 .submenu {
298 display: block;
298 display: block;
299 }
299 }
300 }
300 }
301
301
302 .navigation li:last-child .submenu {
302 .navigation li:last-child .submenu {
303 right: auto;
303 right: auto;
304 left: 0;
304 left: 0;
305 border: 1px solid @grey5;
305 border: 1px solid @grey5;
306 background: @white;
306 background: @white;
307 box-shadow: @dropdown-shadow;
307 box-shadow: @dropdown-shadow;
308 }
308 }
309
309
310 .submenu {
310 .submenu {
311 position: absolute;
311 position: absolute;
312 top: 100%;
312 top: 100%;
313 left: 0;
313 left: 0;
314 min-width: 180px;
314 min-width: 180px;
315 margin: 2px 0 0;
315 margin: 2px 0 0;
316 padding: 0;
316 padding: 0;
317 text-align: left;
317 text-align: left;
318 font-family: @text-light;
318 font-family: @text-light;
319 border-radius: @border-radius;
319 border-radius: @border-radius;
320 z-index: 20;
320 z-index: 20;
321
321
322 li {
322 li {
323 display: block;
323 display: block;
324 margin: 0;
324 margin: 0;
325 padding: 0 .5em;
325 padding: 0 .5em;
326 line-height: 1em;
326 line-height: 1em;
327 color: @grey3;
327 color: @grey3;
328 background-color: @white;
328 background-color: @white;
329 list-style-type: none;
329 list-style-type: none;
330
330
331 a {
331 a {
332 display: block;
332 display: block;
333 width: 100%;
333 width: 100%;
334 padding: .5em 0;
334 padding: .5em 0;
335 border-right: none;
335 border-right: none;
336 border-bottom: @border-thickness solid white;
336 border-bottom: @border-thickness solid white;
337 color: @grey3;
337 color: @grey3;
338 }
338 }
339
339
340 ul {
340 ul {
341 display: none;
341 display: none;
342 position: absolute;
342 position: absolute;
343 top: 0;
343 top: 0;
344 right: 100%;
344 right: 100%;
345 padding: 0;
345 padding: 0;
346 z-index: 30;
346 z-index: 30;
347 }
347 }
348 &:hover {
348 &:hover {
349 background-color: @grey7;
349 background-color: @grey7;
350 -webkit-transition: background .3s;
350 -webkit-transition: background .3s;
351 -moz-transition: background .3s;
351 -moz-transition: background .3s;
352 -o-transition: background .3s;
352 -o-transition: background .3s;
353 transition: background .3s;
353 transition: background .3s;
354
354
355 ul {
355 ul {
356 display: block;
356 display: block;
357 }
357 }
358 }
358 }
359 }
359 }
360
360
361 }
361 }
362
362
363
363
364
364
365
365
366 // repo dropdown
366 // repo dropdown
367 .quick_repo_menu {
367 .quick_repo_menu {
368 width: 15px;
368 width: 15px;
369 text-align: center;
369 text-align: center;
370 position: relative;
370 position: relative;
371 cursor: pointer;
371 cursor: pointer;
372
372
373 div {
373 div {
374 overflow: visible !important;
374 overflow: visible !important;
375 }
375 }
376
376
377 &.sorting {
377 &.sorting {
378 cursor: auto;
378 cursor: auto;
379 }
379 }
380
380
381 &:hover {
381 &:hover {
382 .menu_items_container {
382 .menu_items_container {
383 position: absolute;
383 position: absolute;
384 display: block;
384 display: block;
385 }
385 }
386 .menu_items {
386 .menu_items {
387 display: block;
387 display: block;
388 }
388 }
389 }
389 }
390
390
391 i {
391 i {
392 margin: 0;
392 margin: 0;
393 color: @grey4;
393 color: @grey4;
394 }
394 }
395
395
396 .menu_items_container {
396 .menu_items_container {
397 position: absolute;
397 position: absolute;
398 top: 0;
398 top: 0;
399 left: 100%;
399 left: 100%;
400 margin: 0;
400 margin: 0;
401 padding: 0;
401 padding: 0;
402 list-style: none;
402 list-style: none;
403 background-color: @grey6;
403 background-color: @grey6;
404 z-index: 999;
404 z-index: 999;
405 text-align: left;
405 text-align: left;
406
406
407 a {
407 a {
408 color: @grey2;
408 color: @grey2;
409 }
409 }
410
410
411 ul.menu_items {
411 ul.menu_items {
412 margin: 0;
412 margin: 0;
413 padding: 0;
413 padding: 0;
414 }
414 }
415
415
416 li {
416 li {
417 margin: 0;
417 margin: 0;
418 padding: 0;
418 padding: 0;
419 line-height: 1em;
419 line-height: 1em;
420 list-style-type: none;
420 list-style-type: none;
421
421
422 a {
422 a {
423 display: block;
423 display: block;
424 height: 16px;
424 height: 16px;
425 padding: 8px; //must add up to td height (28px)
425 padding: 8px; //must add up to td height (28px)
426 width: 120px; // set width
426 width: 120px; // set width
427
427
428 &:hover {
428 &:hover {
429 background-color: @grey5;
429 background-color: @grey5;
430 -webkit-transition: background .3s;
430 -webkit-transition: background .3s;
431 -moz-transition: background .3s;
431 -moz-transition: background .3s;
432 -o-transition: background .3s;
432 -o-transition: background .3s;
433 transition: background .3s;
433 transition: background .3s;
434 }
434 }
435 }
435 }
436 }
436 }
437 }
437 }
438 }
438 }
439
439
440
440
441 // new objects main action
441 // new objects main action
442 .action-menu {
442 .action-menu {
443 left: auto;
443 left: auto;
444 right: 0;
444 right: 0;
445 padding: 12px;
445 padding: 12px;
446 z-index: 999;
446 z-index: 999;
447 overflow: hidden;
447 overflow: hidden;
448 background-color: #fff;
448 background-color: #fff;
449 border: 1px solid @grey5;
449 border: 1px solid @grey5;
450 color: @grey2;
450 color: @grey2;
451 box-shadow: @dropdown-shadow;
451 box-shadow: @dropdown-shadow;
452
452
453 .submenu-title {
453 .submenu-title {
454 font-weight: bold;
454 font-weight: bold;
455 }
455 }
456
456
457 .submenu-title:not(:first-of-type) {
457 .submenu-title:not(:first-of-type) {
458 padding-top: 10px;
458 padding-top: 10px;
459 }
459 }
460
460
461 &.submenu {
461 &.submenu {
462 min-width: 200px;
462 min-width: 200px;
463
463
464 ol {
464 ol {
465 padding:0;
465 padding:0;
466 }
466 }
467
467
468 li {
468 li {
469 display: block;
469 display: block;
470 margin: 0;
470 margin: 0;
471 padding: .2em .5em;
471 padding: .2em .5em;
472 line-height: 1em;
472 line-height: 1em;
473
473
474 background-color: #fff;
474 background-color: #fff;
475 list-style-type: none;
475 list-style-type: none;
476
476
477 a {
477 a {
478 padding: 4px;
478 padding: 4px;
479 color: @grey4 !important;
479 color: @grey4 !important;
480 border-bottom: none;
480 border-bottom: none;
481 }
481 }
482 }
482 }
483 li:not(.submenu-title) a:hover{
483 li:not(.submenu-title) a:hover{
484 color: @grey2 !important;
484 color: @grey2 !important;
485 }
485 }
486 }
486 }
487 }
487 }
488
488
489
489
490 // Header Repository Switcher
490 // Header Repository Switcher
491 // Select2 Dropdown
491 // Select2 Dropdown
492 #select2-drop.select2-drop.repo-switcher-dropdown {
492 #select2-drop.select2-drop.repo-switcher-dropdown {
493 width: auto !important;
493 width: auto !important;
494 margin-top: 5px;
494 margin-top: 5px;
495 padding: 1em 0;
495 padding: 1em 0;
496 text-align: left;
496 text-align: left;
497 .border-radius-bottom(@border-radius);
497 .border-radius-bottom(@border-radius);
498 border-color: transparent;
498 border-color: transparent;
499 color: @grey6;
499 color: @grey6;
500 background-color: @grey2;
500 background-color: @grey2;
501
501
502 input {
502 input {
503 min-width: 90%;
503 min-width: 90%;
504 }
504 }
505
505
506 ul.select2-result-sub {
506 ul.select2-result-sub {
507
507
508 li {
508 li {
509 line-height: 1em;
509 line-height: 1em;
510
510
511 &:hover,
511 &:hover,
512 &.select2-highlighted {
512 &.select2-highlighted {
513 background-color: @grey3;
513 background-color: @grey3;
514 }
514 }
515 }
515 }
516
516
517 &:before { content: none; }
517 &:before { content: none; }
518 }
518 }
519
519
520 ul.select2-results {
520 ul.select2-results {
521 min-width: 200px;
521 min-width: 200px;
522 margin: 0;
522 margin: 0;
523 padding: 0;
523 padding: 0;
524 list-style-type: none;
524 list-style-type: none;
525 overflow-x: visible;
525 overflow-x: visible;
526 overflow-y: scroll;
526 overflow-y: scroll;
527
527
528 li {
528 li {
529 padding: 0 8px;
529 padding: 0 8px;
530 line-height: 1em;
530 line-height: 1em;
531 color: @grey6;
531 color: @grey6;
532
532
533 &>.select2-result-label {
533 &>.select2-result-label {
534 padding: 8px 0;
534 padding: 8px 0;
535 border-bottom: @border-thickness solid @grey3;
535 border-bottom: @border-thickness solid @grey3;
536 white-space: nowrap;
536 white-space: nowrap;
537 color: @grey5;
537 color: @grey5;
538 cursor: pointer;
538 cursor: pointer;
539 }
539 }
540
540
541 &.select2-result-with-children {
541 &.select2-result-with-children {
542 margin: 0;
542 margin: 0;
543 padding: 0;
543 padding: 0;
544 }
544 }
545
545
546 &.select2-result-unselectable > .select2-result-label {
546 &.select2-result-unselectable > .select2-result-label {
547 margin: 0 8px;
547 margin: 0 8px;
548 }
548 }
549
549
550 }
550 }
551 }
551 }
552
552
553 ul.select2-result-sub {
553 ul.select2-result-sub {
554 margin: 0;
554 margin: 0;
555 padding: 0;
555 padding: 0;
556
556
557 li {
557 li {
558 display: block;
558 display: block;
559 margin: 0;
559 margin: 0;
560 border-right: none;
560 border-right: none;
561 line-height: 1em;
561 line-height: 1em;
562 font-family: @text-light;
562 font-family: @text-light;
563 color: @grey2;
563 color: @grey2;
564 list-style-type: none;
564 list-style-type: none;
565
565
566 &:hover {
566 &:hover {
567 background-color: @grey3;
567 background-color: @grey3;
568 }
568 }
569 }
569 }
570 }
570 }
571 }
571 }
572
572
573
573
574 #context-bar {
574 #context-bar {
575 display: block;
575 display: block;
576 margin: 0 auto 20px 0;
576 margin: 0 auto 20px 0;
577 padding: 0 @header-padding;
577 padding: 0 @header-padding;
578 background-color: @grey7;
578 background-color: @grey7;
579 border-bottom: 1px solid @grey5;
579 border-bottom: 1px solid @grey5;
580
580
581 .clear {
581 .clear {
582 clear: both;
582 clear: both;
583 }
583 }
584 }
584 }
585
585
586 ul#context-pages {
586 ul#context-pages {
587 li {
587 li {
588 list-style-type: none;
588 list-style-type: none;
589
589
590 a {
590 a {
591 color: @grey2;
591 color: @grey2;
592
592
593 &:hover {
593 &:hover {
594 color: @grey1;
594 color: @grey1;
595 }
595 }
596 }
596 }
597
597
598 &.active {
598 &.active {
599 // special case, non-variable color
599 // special case, non-variable color
600 border-bottom: 2px solid @rcblue;
600 border-bottom: 2px solid @rcblue;
601
601
602 a {
602 a {
603 color: @rcblue;
603 color: @rcblue;
604 }
604 }
605 }
605 }
606 }
606 }
607 }
607 }
608
608
609 // PAGINATION
609 // PAGINATION
610
610
611 .pagination {
611 .pagination {
612 border: @border-thickness solid @grey5;
612 border: @border-thickness solid @grey5;
613 color: @grey2;
613 color: @grey2;
614 box-shadow: @button-shadow;
614 box-shadow: @button-shadow;
615
615
616 .current {
616 .current {
617 color: @grey4;
617 color: @grey4;
618 }
618 }
619 }
619 }
620
620
621 .dataTables_processing {
621 .dataTables_processing {
622 text-align: center;
622 text-align: center;
623 font-size: 1.1em;
623 font-size: 1.1em;
624 position: relative;
624 position: relative;
625 top: 95px;
625 top: 95px;
626 }
626 }
627
627
628 .dataTables_paginate,
628 .dataTables_paginate,
629 .pagination-wh {
629 .pagination-wh {
630 text-align: center;
630 text-align: center;
631 display: inline-block;
631 display: inline-block;
632 border-left: 1px solid @grey5;
632 border-left: 1px solid @grey5;
633 float: none;
633 float: none;
634 overflow: hidden;
634 overflow: hidden;
635 box-shadow: @button-shadow;
635 box-shadow: @button-shadow;
636
636
637 .paginate_button, .pager_curpage,
637 .paginate_button, .pager_curpage,
638 .pager_link, .pg-previous, .pg-next, .pager_dotdot {
638 .pager_link, .pg-previous, .pg-next, .pager_dotdot {
639 display: inline-block;
639 display: inline-block;
640 padding: @menupadding/4 @menupadding;
640 padding: @menupadding/4 @menupadding;
641 border: 1px solid @grey5;
641 border: 1px solid @grey5;
642 margin-left: -1px;
642 margin-left: -1px;
643 color: @grey2;
643 color: @grey2;
644 cursor: pointer;
644 cursor: pointer;
645 float: left;
645 float: left;
646 font-weight: 600;
646 font-weight: 600;
647 white-space: nowrap;
647 white-space: nowrap;
648 vertical-align: middle;
648 vertical-align: middle;
649 user-select: none;
649 user-select: none;
650 min-width: 15px;
650 min-width: 15px;
651
651
652 &:hover {
652 &:hover {
653 color: @rcdarkblue;
653 color: @rcdarkblue;
654 }
654 }
655 }
655 }
656
656
657 .paginate_button.disabled,
657 .paginate_button.disabled,
658 .disabled {
658 .disabled {
659 color: @grey3;
659 color: @grey3;
660 cursor: default;
660 cursor: default;
661 opacity: 0.5;
661 opacity: 0.5;
662 }
662 }
663
663
664 .paginate_button.current, .pager_curpage {
664 .paginate_button.current, .pager_curpage {
665 background: @rcblue;
665 background: @rcblue;
666 border-color: @rcblue;
666 border-color: @rcblue;
667 color: @white;
667 color: @white;
668 }
668 }
669
669
670 .ellipsis {
670 .ellipsis {
671 display: inline-block;
671 display: inline-block;
672 text-align: left;
672 text-align: left;
673 padding: @menupadding/4 @menupadding;
673 padding: @menupadding/4 @menupadding;
674 border: 1px solid @grey5;
674 border: 1px solid @grey5;
675 border-left: 0;
675 border-left: 0;
676 float: left;
676 float: left;
677 }
677 }
678 }
678 }
679
679
680 // SIDEBAR
680 // SIDEBAR
681
681
682 .sidebar {
682 .sidebar {
683 .block-left;
683 .block-left;
684 clear: left;
684 clear: left;
685 max-width: @sidebar-width;
685 max-width: @sidebar-width;
686 margin-right: @sidebarpadding;
686 margin-right: @sidebarpadding;
687 padding-right: @sidebarpadding;
687 padding-right: @sidebarpadding;
688 font-family: @text-regular;
688 font-family: @text-regular;
689 color: @grey1;
689 color: @grey1;
690
690
691 .nav-pills {
691 .nav-pills {
692 margin: 0;
692 margin: 0;
693 }
693 }
694
694
695 .nav {
695 .nav {
696 list-style: none;
696 list-style: none;
697 padding: 0;
697 padding: 0;
698
698
699 li {
699 li {
700 padding-bottom: @menupadding;
700 padding-bottom: @menupadding;
701 line-height: 1em;
701 line-height: 1em;
702 color: @grey4;
702 color: @grey4;
703 list-style-type: none;
703 list-style-type: none;
704
704
705 &.active a {
705 &.active a {
706 color: @grey2;
706 color: @grey2;
707 }
707 }
708
708
709 a {
709 a {
710 color: @grey4;
710 color: @grey4;
711 }
711 }
712 }
712 }
713
713
714 }
714 }
715 }
715 }
716
716
717 .main_filter_help_box {
717 .main_filter_help_box {
718 padding: 7px 7px;
718 padding: 7px 7px;
719 display: inline-block;
719 display: inline-block;
720 vertical-align: top;
720 vertical-align: top;
721 background: inherit;
721 background: inherit;
722 position: absolute;
722 position: absolute;
723 right: 0;
723 right: 0;
724 top: 9px;
724 top: 9px;
725 }
725 }
726
726
727 .main_filter_input_box {
727 .main_filter_input_box {
728 display: inline-block;
728 display: inline-block;
729
729
730 .searchItems {
730 .searchItems {
731 display:flex;
731 display:flex;
732 background: @black;
732 background: @black;
733 padding: 0px;
733 padding: 0px;
734 border-radius: 3px;
734 border-radius: 3px;
735 border: 1px solid @black;
735 border: 1px solid @black;
736
736
737 a {
737 a {
738 border: none !important;
738 border: none !important;
739 }
739 }
740 }
740 }
741
741
742 .searchTag {
742 .searchTag {
743 line-height: 28px;
743 line-height: 28px;
744 padding: 0 5px;
744 padding: 0 5px;
745
745
746 .tag {
746 .tag {
747 color: @grey5;
747 color: @grey5;
748 border-color: @grey2;
748 border-color: @grey2;
749 background: @grey1;
749 background: @grey1;
750 }
750 }
751 }
751 }
752
752
753 .searchTagFilter {
753 .searchTagFilter {
754 background-color: @black !important;
754 background-color: @black !important;
755 margin-right: 0;
755 margin-right: 0;
756 }
756 }
757
757 .searchTagIcon {
758 margin: 0;
759 background: @black !important;
760 }
758 .searchTagHelp {
761 .searchTagHelp {
759 background-color: @grey1 !important;
762 background-color: @grey1 !important;
760 margin: 0;
763 margin: 0;
761 }
764 }
762 .searchTagHelp:hover {
765 .searchTagHelp:hover {
763 background-color: @grey1 !important;
766 background-color: @grey1 !important;
764 }
767 }
765 .searchTagInput {
768 .searchTagInput {
766 background-color: @grey1 !important;
769 background-color: @grey1 !important;
767 margin-right: 0;
770 margin-right: 0;
768 }
771 }
769 }
772 }
770
773
771 .main_filter_box {
774 .main_filter_box {
772 margin: 9px 0 0 0;
775 margin: 9px 0 0 0;
773 }
776 }
774
777
775 #main_filter_help {
778 #main_filter_help {
776 background: @grey1;
779 background: @grey1;
777 border: 1px solid black;
780 border: 1px solid black;
778 position: absolute;
781 position: absolute;
779 white-space: pre;
782 white-space: pre;
780 z-index: 9999;
783 z-index: 9999;
781 color: @nav-grey;
784 color: @nav-grey;
782 padding: 0 10px;
785 padding: 0 10px;
783 }
786 }
784
787
785 input {
788 input {
786
789
787 &.main_filter_input {
790 &.main_filter_input {
788 padding: 5px 10px;
791 padding: 5px 10px;
789 min-width: 340px;
792 min-width: 340px;
790 color: @grey7;
793 color: @grey7;
791 background: @black;
794 background: @black;
792 min-height: 18px;
795 min-height: 18px;
793 border: 0;
796 border: 0;
794
797
795 &:active {
798 &:active {
796 color: @grey2 !important;
799 color: @grey2 !important;
797 background: white !important;
800 background: white !important;
798 }
801 }
799 &:focus {
802 &:focus {
800 color: @grey2 !important;
803 color: @grey2 !important;
801 background: white !important;
804 background: white !important;
802 }
805 }
803 }
806 }
804 }
807 }
805
808
806
809
807
810
808 .main_filter_input::placeholder {
811 .main_filter_input::placeholder {
809 color: @nav-grey;
812 color: @nav-grey;
810 opacity: 1;
813 opacity: 1;
811 }
814 }
812
815
813 .notice-box {
816 .notice-box {
814 display:block !important;
817 display:block !important;
815 padding: 9px 0 !important;
818 padding: 9px 0 !important;
816 }
819 }
817
820
818 .menulabel-notice {
821 .menulabel-notice {
819 border: 1px solid @color5;
822 border: 1px solid @color5;
820 padding:7px 10px;
823 padding:7px 10px;
821 color: @color5;
824 color: @color5;
822 }
825 }
@@ -1,1123 +1,1133 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 <%!
3 <%!
4 ## base64 filter e.g ${ example | base64 }
4 ## base64 filter e.g ${ example | base64 }
5 def base64(text):
5 def base64(text):
6 import base64
6 import base64
7 from rhodecode.lib.helpers import safe_str
7 from rhodecode.lib.helpers import safe_str
8 return base64.encodestring(safe_str(text))
8 return base64.encodestring(safe_str(text))
9 %>
9 %>
10
10
11 <%inherit file="root.mako"/>
11 <%inherit file="root.mako"/>
12
12
13 <%include file="/ejs_templates/templates.html"/>
13 <%include file="/ejs_templates/templates.html"/>
14
14
15 <div class="outerwrapper">
15 <div class="outerwrapper">
16 <!-- HEADER -->
16 <!-- HEADER -->
17 <div class="header">
17 <div class="header">
18 <div id="header-inner" class="wrapper">
18 <div id="header-inner" class="wrapper">
19 <div id="logo">
19 <div id="logo">
20 <div class="logo-wrapper">
20 <div class="logo-wrapper">
21 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
21 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
22 </div>
22 </div>
23 % if c.rhodecode_name:
23 % if c.rhodecode_name:
24 <div class="branding">
24 <div class="branding">
25 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
25 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
26 </div>
26 </div>
27 % endif
27 % endif
28 </div>
28 </div>
29 <!-- MENU BAR NAV -->
29 <!-- MENU BAR NAV -->
30 ${self.menu_bar_nav()}
30 ${self.menu_bar_nav()}
31 <!-- END MENU BAR NAV -->
31 <!-- END MENU BAR NAV -->
32 </div>
32 </div>
33 </div>
33 </div>
34 ${self.menu_bar_subnav()}
34 ${self.menu_bar_subnav()}
35 <!-- END HEADER -->
35 <!-- END HEADER -->
36
36
37 <!-- CONTENT -->
37 <!-- CONTENT -->
38 <div id="content" class="wrapper">
38 <div id="content" class="wrapper">
39
39
40 <rhodecode-toast id="notifications"></rhodecode-toast>
40 <rhodecode-toast id="notifications"></rhodecode-toast>
41
41
42 <div class="main">
42 <div class="main">
43 ${next.main()}
43 ${next.main()}
44 </div>
44 </div>
45 </div>
45 </div>
46 <!-- END CONTENT -->
46 <!-- END CONTENT -->
47
47
48 </div>
48 </div>
49 <!-- FOOTER -->
49 <!-- FOOTER -->
50 <div id="footer">
50 <div id="footer">
51 <div id="footer-inner" class="title wrapper">
51 <div id="footer-inner" class="title wrapper">
52 <div>
52 <div>
53 <p class="footer-link-right">
53 <p class="footer-link-right">
54 % if c.visual.show_version:
54 % if c.visual.show_version:
55 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
55 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
56 % endif
56 % endif
57 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
57 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
58 % if c.visual.rhodecode_support_url:
58 % if c.visual.rhodecode_support_url:
59 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
59 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
60 % endif
60 % endif
61 </p>
61 </p>
62 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
62 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
63 <p class="server-instance" style="display:${sid}">
63 <p class="server-instance" style="display:${sid}">
64 ## display hidden instance ID if specially defined
64 ## display hidden instance ID if specially defined
65 % if c.rhodecode_instanceid:
65 % if c.rhodecode_instanceid:
66 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
66 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
67 % endif
67 % endif
68 </p>
68 </p>
69 </div>
69 </div>
70 </div>
70 </div>
71 </div>
71 </div>
72
72
73 <!-- END FOOTER -->
73 <!-- END FOOTER -->
74
74
75 ### MAKO DEFS ###
75 ### MAKO DEFS ###
76
76
77 <%def name="menu_bar_subnav()">
77 <%def name="menu_bar_subnav()">
78 </%def>
78 </%def>
79
79
80 <%def name="breadcrumbs(class_='breadcrumbs')">
80 <%def name="breadcrumbs(class_='breadcrumbs')">
81 <div class="${class_}">
81 <div class="${class_}">
82 ${self.breadcrumbs_links()}
82 ${self.breadcrumbs_links()}
83 </div>
83 </div>
84 </%def>
84 </%def>
85
85
86 <%def name="admin_menu(active=None)">
86 <%def name="admin_menu(active=None)">
87
87
88 <div id="context-bar">
88 <div id="context-bar">
89 <div class="wrapper">
89 <div class="wrapper">
90 <div class="title">
90 <div class="title">
91 <div class="title-content">
91 <div class="title-content">
92 <div class="title-main">
92 <div class="title-main">
93 % if c.is_super_admin:
93 % if c.is_super_admin:
94 ${_('Super Admin Panel')}
94 ${_('Super Admin Panel')}
95 % else:
95 % else:
96 ${_('Delegated Admin Panel')}
96 ${_('Delegated Admin Panel')}
97 % endif
97 % endif
98 </div>
98 </div>
99 </div>
99 </div>
100 </div>
100 </div>
101
101
102 <ul id="context-pages" class="navigation horizontal-list">
102 <ul id="context-pages" class="navigation horizontal-list">
103
103
104 ## super admin case
104 ## super admin case
105 % if c.is_super_admin:
105 % if c.is_super_admin:
106 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
106 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
107 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
107 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
108 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
108 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
109 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
109 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
110 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
110 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
111 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
111 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
112 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
112 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
113 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
113 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
114 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
114 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
115 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
115 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
116
116
117 ## delegated admin
117 ## delegated admin
118 % elif c.is_delegated_admin:
118 % elif c.is_delegated_admin:
119 <%
119 <%
120 repositories=c.auth_user.repositories_admin or c.can_create_repo
120 repositories=c.auth_user.repositories_admin or c.can_create_repo
121 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
121 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
122 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
122 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
123 %>
123 %>
124
124
125 %if repositories:
125 %if repositories:
126 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
126 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
127 %endif
127 %endif
128 %if repository_groups:
128 %if repository_groups:
129 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
129 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
130 %endif
130 %endif
131 %if user_groups:
131 %if user_groups:
132 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
132 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
133 %endif
133 %endif
134 % endif
134 % endif
135 </ul>
135 </ul>
136
136
137 </div>
137 </div>
138 <div class="clear"></div>
138 <div class="clear"></div>
139 </div>
139 </div>
140 </%def>
140 </%def>
141
141
142 <%def name="dt_info_panel(elements)">
142 <%def name="dt_info_panel(elements)">
143 <dl class="dl-horizontal">
143 <dl class="dl-horizontal">
144 %for dt, dd, title, show_items in elements:
144 %for dt, dd, title, show_items in elements:
145 <dt>${dt}:</dt>
145 <dt>${dt}:</dt>
146 <dd title="${h.tooltip(title)}">
146 <dd title="${h.tooltip(title)}">
147 %if callable(dd):
147 %if callable(dd):
148 ## allow lazy evaluation of elements
148 ## allow lazy evaluation of elements
149 ${dd()}
149 ${dd()}
150 %else:
150 %else:
151 ${dd}
151 ${dd}
152 %endif
152 %endif
153 %if show_items:
153 %if show_items:
154 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
154 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
155 %endif
155 %endif
156 </dd>
156 </dd>
157
157
158 %if show_items:
158 %if show_items:
159 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
159 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
160 %for item in show_items:
160 %for item in show_items:
161 <dt></dt>
161 <dt></dt>
162 <dd>${item}</dd>
162 <dd>${item}</dd>
163 %endfor
163 %endfor
164 </div>
164 </div>
165 %endif
165 %endif
166
166
167 %endfor
167 %endfor
168 </dl>
168 </dl>
169 </%def>
169 </%def>
170
170
171 <%def name="tr_info_entry(element)">
171 <%def name="tr_info_entry(element)">
172 <% key, val, title, show_items = element %>
172 <% key, val, title, show_items = element %>
173
173
174 <tr>
174 <tr>
175 <td style="vertical-align: top">${key}</td>
175 <td style="vertical-align: top">${key}</td>
176 <td title="${h.tooltip(title)}">
176 <td title="${h.tooltip(title)}">
177 %if callable(val):
177 %if callable(val):
178 ## allow lazy evaluation of elements
178 ## allow lazy evaluation of elements
179 ${val()}
179 ${val()}
180 %else:
180 %else:
181 ${val}
181 ${val}
182 %endif
182 %endif
183 %if show_items:
183 %if show_items:
184 <div class="collapsable-content" data-toggle="item-${h.md5_safe(val)[:6]}-details" style="display: none">
184 <div class="collapsable-content" data-toggle="item-${h.md5_safe(val)[:6]}-details" style="display: none">
185 % for item in show_items:
185 % for item in show_items:
186 <dt></dt>
186 <dt></dt>
187 <dd>${item}</dd>
187 <dd>${item}</dd>
188 % endfor
188 % endfor
189 </div>
189 </div>
190 %endif
190 %endif
191 </td>
191 </td>
192 <td style="vertical-align: top">
192 <td style="vertical-align: top">
193 %if show_items:
193 %if show_items:
194 <span class="btn-collapse" data-toggle="item-${h.md5_safe(val)[:6]}-details">${_('Show More')} </span>
194 <span class="btn-collapse" data-toggle="item-${h.md5_safe(val)[:6]}-details">${_('Show More')} </span>
195 %endif
195 %endif
196 </td>
196 </td>
197 </tr>
197 </tr>
198
198
199 </%def>
199 </%def>
200
200
201 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None)">
201 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None)">
202 <%
202 <%
203 if size > 16:
203 if size > 16:
204 gravatar_class = ['gravatar','gravatar-large']
204 gravatar_class = ['gravatar','gravatar-large']
205 else:
205 else:
206 gravatar_class = ['gravatar']
206 gravatar_class = ['gravatar']
207
207
208 data_hovercard_url = ''
208 data_hovercard_url = ''
209 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
209 data_hovercard_alt = tooltip_alt.replace('<', '&lt;').replace('>', '&gt;') if tooltip_alt else ''
210
210
211 if tooltip:
211 if tooltip:
212 gravatar_class += ['tooltip-hovercard']
212 gravatar_class += ['tooltip-hovercard']
213
213
214 if tooltip and user:
214 if tooltip and user:
215 if user.username == h.DEFAULT_USER:
215 if user.username == h.DEFAULT_USER:
216 gravatar_class.pop(-1)
216 gravatar_class.pop(-1)
217 else:
217 else:
218 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
218 data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', ''))
219 gravatar_class = ' '.join(gravatar_class)
219 gravatar_class = ' '.join(gravatar_class)
220
220
221 %>
221 %>
222 <%doc>
222 <%doc>
223 TODO: johbo: For now we serve double size images to make it smooth
223 TODO: johbo: For now we serve double size images to make it smooth
224 for retina. This is how it worked until now. Should be replaced
224 for retina. This is how it worked until now. Should be replaced
225 with a better solution at some point.
225 with a better solution at some point.
226 </%doc>
226 </%doc>
227
227
228 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2)}" />
228 <img class="${gravatar_class}" height="${size}" width="${size}" data-hovercard-url="${data_hovercard_url}" data-hovercard-alt="${data_hovercard_alt}" src="${h.gravatar_url(email, size * 2)}" />
229 </%def>
229 </%def>
230
230
231
231
232 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False)">
232 <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False)">
233 <%
233 <%
234 email = h.email_or_none(contact)
234 email = h.email_or_none(contact)
235 rc_user = h.discover_user(contact)
235 rc_user = h.discover_user(contact)
236 %>
236 %>
237
237
238 <div class="rc-user">
238 <div class="rc-user">
239 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
239 ${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)}
240 <span class="${('user user-disabled' if show_disabled else 'user')}"> ${h.link_to_user(rc_user or contact)}</span>
240 <span class="${('user user-disabled' if show_disabled else 'user')}"> ${h.link_to_user(rc_user or contact)}</span>
241 </div>
241 </div>
242 </%def>
242 </%def>
243
243
244
244
245 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
245 <%def name="user_group_icon(user_group=None, size=16, tooltip=False)">
246 <%
246 <%
247 if (size > 16):
247 if (size > 16):
248 gravatar_class = 'icon-user-group-alt'
248 gravatar_class = 'icon-user-group-alt'
249 else:
249 else:
250 gravatar_class = 'icon-user-group-alt'
250 gravatar_class = 'icon-user-group-alt'
251
251
252 if tooltip:
252 if tooltip:
253 gravatar_class += ' tooltip-hovercard'
253 gravatar_class += ' tooltip-hovercard'
254
254
255 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
255 data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id)
256 %>
256 %>
257 <%doc>
257 <%doc>
258 TODO: johbo: For now we serve double size images to make it smooth
258 TODO: johbo: For now we serve double size images to make it smooth
259 for retina. This is how it worked until now. Should be replaced
259 for retina. This is how it worked until now. Should be replaced
260 with a better solution at some point.
260 with a better solution at some point.
261 </%doc>
261 </%doc>
262
262
263 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
263 <i style="font-size: ${size}px" class="${gravatar_class} x-icon-size-${size}" data-hovercard-url="${data_hovercard_url}"></i>
264 </%def>
264 </%def>
265
265
266 <%def name="repo_page_title(repo_instance)">
266 <%def name="repo_page_title(repo_instance)">
267 <div class="title-content repo-title">
267 <div class="title-content repo-title">
268
268
269 <div class="title-main">
269 <div class="title-main">
270 ## SVN/HG/GIT icons
270 ## SVN/HG/GIT icons
271 %if h.is_hg(repo_instance):
271 %if h.is_hg(repo_instance):
272 <i class="icon-hg"></i>
272 <i class="icon-hg"></i>
273 %endif
273 %endif
274 %if h.is_git(repo_instance):
274 %if h.is_git(repo_instance):
275 <i class="icon-git"></i>
275 <i class="icon-git"></i>
276 %endif
276 %endif
277 %if h.is_svn(repo_instance):
277 %if h.is_svn(repo_instance):
278 <i class="icon-svn"></i>
278 <i class="icon-svn"></i>
279 %endif
279 %endif
280
280
281 ## public/private
281 ## public/private
282 %if repo_instance.private:
282 %if repo_instance.private:
283 <i class="icon-repo-private"></i>
283 <i class="icon-repo-private"></i>
284 %else:
284 %else:
285 <i class="icon-repo-public"></i>
285 <i class="icon-repo-public"></i>
286 %endif
286 %endif
287
287
288 ## repo name with group name
288 ## repo name with group name
289 ${h.breadcrumb_repo_link(repo_instance)}
289 ${h.breadcrumb_repo_link(repo_instance)}
290
290
291 ## Context Actions
291 ## Context Actions
292 <div class="pull-right">
292 <div class="pull-right">
293 %if c.rhodecode_user.username != h.DEFAULT_USER:
293 %if c.rhodecode_user.username != h.DEFAULT_USER:
294 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
294 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
295
295
296 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
296 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
297 % if c.repository_is_user_following:
297 % if c.repository_is_user_following:
298 <i class="icon-eye-off"></i>${_('Unwatch')}
298 <i class="icon-eye-off"></i>${_('Unwatch')}
299 % else:
299 % else:
300 <i class="icon-eye"></i>${_('Watch')}
300 <i class="icon-eye"></i>${_('Watch')}
301 % endif
301 % endif
302
302
303 </a>
303 </a>
304 %else:
304 %else:
305 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
305 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_uid)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
306 %endif
306 %endif
307 </div>
307 </div>
308
308
309 </div>
309 </div>
310
310
311 ## FORKED
311 ## FORKED
312 %if repo_instance.fork:
312 %if repo_instance.fork:
313 <p class="discreet">
313 <p class="discreet">
314 <i class="icon-code-fork"></i> ${_('Fork of')}
314 <i class="icon-code-fork"></i> ${_('Fork of')}
315 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
315 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
316 </p>
316 </p>
317 %endif
317 %endif
318
318
319 ## IMPORTED FROM REMOTE
319 ## IMPORTED FROM REMOTE
320 %if repo_instance.clone_uri:
320 %if repo_instance.clone_uri:
321 <p class="discreet">
321 <p class="discreet">
322 <i class="icon-code-fork"></i> ${_('Clone from')}
322 <i class="icon-code-fork"></i> ${_('Clone from')}
323 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
323 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
324 </p>
324 </p>
325 %endif
325 %endif
326
326
327 ## LOCKING STATUS
327 ## LOCKING STATUS
328 %if repo_instance.locked[0]:
328 %if repo_instance.locked[0]:
329 <p class="locking_locked discreet">
329 <p class="locking_locked discreet">
330 <i class="icon-repo-lock"></i>
330 <i class="icon-repo-lock"></i>
331 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
331 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
332 </p>
332 </p>
333 %elif repo_instance.enable_locking:
333 %elif repo_instance.enable_locking:
334 <p class="locking_unlocked discreet">
334 <p class="locking_unlocked discreet">
335 <i class="icon-repo-unlock"></i>
335 <i class="icon-repo-unlock"></i>
336 ${_('Repository not locked. Pull repository to lock it.')}
336 ${_('Repository not locked. Pull repository to lock it.')}
337 </p>
337 </p>
338 %endif
338 %endif
339
339
340 </div>
340 </div>
341 </%def>
341 </%def>
342
342
343 <%def name="repo_menu(active=None)">
343 <%def name="repo_menu(active=None)">
344 <%
344 <%
345 ## determine if we have "any" option available
345 ## determine if we have "any" option available
346 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
346 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
347 has_actions = can_lock
347 has_actions = can_lock
348
348
349 %>
349 %>
350 % if c.rhodecode_db_repo.archived:
350 % if c.rhodecode_db_repo.archived:
351 <div class="alert alert-warning text-center">
351 <div class="alert alert-warning text-center">
352 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
352 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
353 </div>
353 </div>
354 % endif
354 % endif
355
355
356 <!--- REPO CONTEXT BAR -->
356 <!--- REPO CONTEXT BAR -->
357 <div id="context-bar">
357 <div id="context-bar">
358 <div class="wrapper">
358 <div class="wrapper">
359
359
360 <div class="title">
360 <div class="title">
361 ${self.repo_page_title(c.rhodecode_db_repo)}
361 ${self.repo_page_title(c.rhodecode_db_repo)}
362 </div>
362 </div>
363
363
364 <ul id="context-pages" class="navigation horizontal-list">
364 <ul id="context-pages" class="navigation horizontal-list">
365 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
365 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
366 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
366 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
367 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
367 <li class="${h.is_active('files', active)}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
368 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
368 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
369
369
370 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
370 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
371 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
371 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
372 <li class="${h.is_active('showpullrequest', active)}">
372 <li class="${h.is_active('showpullrequest', active)}">
373 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
373 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
374 <div class="menulabel">
374 <div class="menulabel">
375 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
375 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
376 </div>
376 </div>
377 </a>
377 </a>
378 </li>
378 </li>
379 %endif
379 %endif
380
380
381 <li class="${h.is_active('artifacts', active)}">
381 <li class="${h.is_active('artifacts', active)}">
382 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
382 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
383 <div class="menulabel">
383 <div class="menulabel">
384 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
384 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
385 </div>
385 </div>
386 </a>
386 </a>
387 </li>
387 </li>
388
388
389 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
389 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
390 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
390 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
391 %endif
391 %endif
392
392
393 <li class="${h.is_active('options', active)}">
393 <li class="${h.is_active('options', active)}">
394 % if has_actions:
394 % if has_actions:
395 <a class="menulink dropdown">
395 <a class="menulink dropdown">
396 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
396 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
397 </a>
397 </a>
398 <ul class="submenu">
398 <ul class="submenu">
399 %if can_lock:
399 %if can_lock:
400 %if c.rhodecode_db_repo.locked[0]:
400 %if c.rhodecode_db_repo.locked[0]:
401 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
401 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
402 %else:
402 %else:
403 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
403 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
404 %endif
404 %endif
405 %endif
405 %endif
406 </ul>
406 </ul>
407 % else:
407 % else:
408 <a class="menulink disabled">
408 <a class="menulink disabled">
409 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
409 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
410 </a>
410 </a>
411 % endif
411 % endif
412 </li>
412 </li>
413
413
414 </ul>
414 </ul>
415 </div>
415 </div>
416 <div class="clear"></div>
416 <div class="clear"></div>
417 </div>
417 </div>
418
418
419 <!--- REPO END CONTEXT BAR -->
419 <!--- REPO END CONTEXT BAR -->
420
420
421 </%def>
421 </%def>
422
422
423 <%def name="repo_group_page_title(repo_group_instance)">
423 <%def name="repo_group_page_title(repo_group_instance)">
424 <div class="title-content">
424 <div class="title-content">
425 <div class="title-main">
425 <div class="title-main">
426 ## Repository Group icon
426 ## Repository Group icon
427 <i class="icon-repo-group"></i>
427 <i class="icon-repo-group"></i>
428
428
429 ## repo name with group name
429 ## repo name with group name
430 ${h.breadcrumb_repo_group_link(repo_group_instance)}
430 ${h.breadcrumb_repo_group_link(repo_group_instance)}
431 </div>
431 </div>
432
432
433 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
433 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
434 <div class="repo-group-desc discreet">
434 <div class="repo-group-desc discreet">
435 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
435 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
436 </div>
436 </div>
437
437
438 </div>
438 </div>
439 </%def>
439 </%def>
440
440
441
441
442 <%def name="repo_group_menu(active=None)">
442 <%def name="repo_group_menu(active=None)">
443 <%
443 <%
444 gr_name = c.repo_group.group_name if c.repo_group else None
444 gr_name = c.repo_group.group_name if c.repo_group else None
445 # create repositories with write permission on group is set to true
445 # create repositories with write permission on group is set to true
446 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
446 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
447
447
448 %>
448 %>
449
449
450
450
451 <!--- REPO GROUP CONTEXT BAR -->
451 <!--- REPO GROUP CONTEXT BAR -->
452 <div id="context-bar">
452 <div id="context-bar">
453 <div class="wrapper">
453 <div class="wrapper">
454 <div class="title">
454 <div class="title">
455 ${self.repo_group_page_title(c.repo_group)}
455 ${self.repo_group_page_title(c.repo_group)}
456 </div>
456 </div>
457
457
458 <ul id="context-pages" class="navigation horizontal-list">
458 <ul id="context-pages" class="navigation horizontal-list">
459 <li class="${h.is_active('home', active)}">
459 <li class="${h.is_active('home', active)}">
460 <a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a>
460 <a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a>
461 </li>
461 </li>
462 % if c.is_super_admin or group_admin:
462 % if c.is_super_admin or group_admin:
463 <li class="${h.is_active('settings', active)}">
463 <li class="${h.is_active('settings', active)}">
464 <a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a>
464 <a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a>
465 </li>
465 </li>
466 % endif
466 % endif
467
467
468 </ul>
468 </ul>
469 </div>
469 </div>
470 <div class="clear"></div>
470 <div class="clear"></div>
471 </div>
471 </div>
472
472
473 <!--- REPO GROUP CONTEXT BAR -->
473 <!--- REPO GROUP CONTEXT BAR -->
474
474
475 </%def>
475 </%def>
476
476
477
477
478 <%def name="usermenu(active=False)">
478 <%def name="usermenu(active=False)">
479 <%
479 <%
480 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
480 not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER
481
481
482 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
482 gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None
483 # create repositories with write permission on group is set to true
483 # create repositories with write permission on group is set to true
484
484
485 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
485 can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')()
486 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
486 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
487 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
487 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
488 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
488 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
489
489
490 can_create_repos = c.is_super_admin or c.can_create_repo
490 can_create_repos = c.is_super_admin or c.can_create_repo
491 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
491 can_create_repo_groups = c.is_super_admin or c.can_create_repo_group
492
492
493 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
493 can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write)
494 can_create_repo_groups_in_group = c.is_super_admin or group_admin
494 can_create_repo_groups_in_group = c.is_super_admin or group_admin
495 %>
495 %>
496
496
497 % if not_anonymous:
497 % if not_anonymous:
498 <%
498 <%
499 default_target_group = dict()
499 default_target_group = dict()
500 if c.rhodecode_user.personal_repo_group:
500 if c.rhodecode_user.personal_repo_group:
501 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
501 default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id)
502 %>
502 %>
503
503
504 ## create action
504 ## create action
505 <li>
505 <li>
506 <a href="#create-actions" onclick="return false;" class="menulink childs">
506 <a href="#create-actions" onclick="return false;" class="menulink childs">
507 <i class="tooltip icon-plus-circled" title="${_('Create')}"></i>
507 <i class="tooltip icon-plus-circled" title="${_('Create')}"></i>
508 </a>
508 </a>
509
509
510 <div class="action-menu submenu">
510 <div class="action-menu submenu">
511
511
512 <ol>
512 <ol>
513 ## scope of within a repository
513 ## scope of within a repository
514 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
514 % if hasattr(c, 'rhodecode_db_repo') and c.rhodecode_db_repo:
515 <li class="submenu-title">${_('This Repository')}</li>
515 <li class="submenu-title">${_('This Repository')}</li>
516 <li>
516 <li>
517 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
517 <a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a>
518 </li>
518 </li>
519 % if can_fork:
519 % if can_fork:
520 <li>
520 <li>
521 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
521 <a href="${h.route_path('repo_fork_new',repo_name=c.repo_name,_query=default_target_group)}">${_('Fork this repository')}</a>
522 </li>
522 </li>
523 % endif
523 % endif
524 % endif
524 % endif
525
525
526 ## scope of within repository groups
526 ## scope of within repository groups
527 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
527 % if hasattr(c, 'repo_group') and c.repo_group and (can_create_repos_in_group or can_create_repo_groups_in_group):
528 <li class="submenu-title">${_('This Repository Group')}</li>
528 <li class="submenu-title">${_('This Repository Group')}</li>
529
529
530 % if can_create_repos_in_group:
530 % if can_create_repos_in_group:
531 <li>
531 <li>
532 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
532 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('New Repository')}</a>
533 </li>
533 </li>
534 % endif
534 % endif
535
535
536 % if can_create_repo_groups_in_group:
536 % if can_create_repo_groups_in_group:
537 <li>
537 <li>
538 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'New Repository Group')}</a>
538 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'New Repository Group')}</a>
539 </li>
539 </li>
540 % endif
540 % endif
541 % endif
541 % endif
542
542
543 ## personal group
543 ## personal group
544 % if c.rhodecode_user.personal_repo_group:
544 % if c.rhodecode_user.personal_repo_group:
545 <li class="submenu-title">Personal Group</li>
545 <li class="submenu-title">Personal Group</li>
546
546
547 <li>
547 <li>
548 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
548 <a href="${h.route_path('repo_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}" >${_('New Repository')} </a>
549 </li>
549 </li>
550
550
551 <li>
551 <li>
552 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
552 <a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.rhodecode_user.personal_repo_group.group_id))}">${_('New Repository Group')} </a>
553 </li>
553 </li>
554 % endif
554 % endif
555
555
556 ## Global actions
556 ## Global actions
557 <li class="submenu-title">RhodeCode</li>
557 <li class="submenu-title">RhodeCode</li>
558 % if can_create_repos:
558 % if can_create_repos:
559 <li>
559 <li>
560 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
560 <a href="${h.route_path('repo_new')}" >${_('New Repository')}</a>
561 </li>
561 </li>
562 % endif
562 % endif
563
563
564 % if can_create_repo_groups:
564 % if can_create_repo_groups:
565 <li>
565 <li>
566 <a href="${h.route_path('repo_group_new')}" >${_(u'New Repository Group')}</a>
566 <a href="${h.route_path('repo_group_new')}" >${_(u'New Repository Group')}</a>
567 </li>
567 </li>
568 % endif
568 % endif
569
569
570 <li>
570 <li>
571 <a href="${h.route_path('gists_new')}">${_(u'New Gist')}</a>
571 <a href="${h.route_path('gists_new')}">${_(u'New Gist')}</a>
572 </li>
572 </li>
573
573
574 </ol>
574 </ol>
575
575
576 </div>
576 </div>
577 </li>
577 </li>
578
578
579 ## notifications
579 ## notifications
580 <li>
580 <li>
581 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
581 <a class="${('empty' if c.unread_notifications == 0 else '')}" href="${h.route_path('notifications_show_all')}">
582 ${c.unread_notifications}
582 ${c.unread_notifications}
583 </a>
583 </a>
584 </li>
584 </li>
585 % endif
585 % endif
586
586
587 ## USER MENU
587 ## USER MENU
588 <li id="quick_login_li" class="${'active' if active else ''}">
588 <li id="quick_login_li" class="${'active' if active else ''}">
589 % if c.rhodecode_user.username == h.DEFAULT_USER:
589 % if c.rhodecode_user.username == h.DEFAULT_USER:
590 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
590 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
591 ${gravatar(c.rhodecode_user.email, 20)}
591 ${gravatar(c.rhodecode_user.email, 20)}
592 <span class="user">
592 <span class="user">
593 <span>${_('Sign in')}</span>
593 <span>${_('Sign in')}</span>
594 </span>
594 </span>
595 </a>
595 </a>
596 % else:
596 % else:
597 ## logged in user
597 ## logged in user
598 <a id="quick_login_link" class="menulink childs">
598 <a id="quick_login_link" class="menulink childs">
599 ${gravatar(c.rhodecode_user.email, 20)}
599 ${gravatar(c.rhodecode_user.email, 20)}
600 <span class="user">
600 <span class="user">
601 <span class="menu_link_user">${c.rhodecode_user.username}</span>
601 <span class="menu_link_user">${c.rhodecode_user.username}</span>
602 <div class="show_more"></div>
602 <div class="show_more"></div>
603 </span>
603 </span>
604 </a>
604 </a>
605 ## subnav with menu for logged in user
605 ## subnav with menu for logged in user
606 <div class="user-menu submenu">
606 <div class="user-menu submenu">
607 <div id="quick_login">
607 <div id="quick_login">
608 %if c.rhodecode_user.username != h.DEFAULT_USER:
608 %if c.rhodecode_user.username != h.DEFAULT_USER:
609 <div class="">
609 <div class="">
610 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
610 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
611 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
611 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
612 <div class="email">${c.rhodecode_user.email}</div>
612 <div class="email">${c.rhodecode_user.email}</div>
613 </div>
613 </div>
614 <div class="">
614 <div class="">
615 <ol class="links">
615 <ol class="links">
616 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
616 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
617 % if c.rhodecode_user.personal_repo_group:
617 % if c.rhodecode_user.personal_repo_group:
618 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
618 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
619 % endif
619 % endif
620 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
620 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
621
621
622 % if c.debug_style:
622 % if c.debug_style:
623 <li>
623 <li>
624 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
624 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
625 <div class="menulabel">${_('[Style]')}</div>
625 <div class="menulabel">${_('[Style]')}</div>
626 </a>
626 </a>
627 </li>
627 </li>
628 % endif
628 % endif
629
629
630 ## bookmark-items
630 ## bookmark-items
631 <li class="bookmark-items">
631 <li class="bookmark-items">
632 ${_('Bookmarks')}
632 ${_('Bookmarks')}
633 <div class="pull-right">
633 <div class="pull-right">
634 <a href="${h.route_path('my_account_bookmarks')}">
634 <a href="${h.route_path('my_account_bookmarks')}">
635
635
636 <i class="icon-cog"></i>
636 <i class="icon-cog"></i>
637 </a>
637 </a>
638 </div>
638 </div>
639 </li>
639 </li>
640 % if not c.bookmark_items:
640 % if not c.bookmark_items:
641 <li>
641 <li>
642 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
642 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
643 </li>
643 </li>
644 % endif
644 % endif
645 % for item in c.bookmark_items:
645 % for item in c.bookmark_items:
646 <li>
646 <li>
647 % if item.repository:
647 % if item.repository:
648 <div>
648 <div>
649 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
649 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
650 <code>${item.position}</code>
650 <code>${item.position}</code>
651 % if item.repository.repo_type == 'hg':
651 % if item.repository.repo_type == 'hg':
652 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
652 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
653 % elif item.repository.repo_type == 'git':
653 % elif item.repository.repo_type == 'git':
654 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
654 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
655 % elif item.repository.repo_type == 'svn':
655 % elif item.repository.repo_type == 'svn':
656 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
656 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
657 % endif
657 % endif
658 ${(item.title or h.shorter(item.repository.repo_name, 30))}
658 ${(item.title or h.shorter(item.repository.repo_name, 30))}
659 </a>
659 </a>
660 </div>
660 </div>
661 % elif item.repository_group:
661 % elif item.repository_group:
662 <div>
662 <div>
663 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
663 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
664 <code>${item.position}</code>
664 <code>${item.position}</code>
665 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
665 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
666 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
666 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
667 </a>
667 </a>
668 </div>
668 </div>
669 % else:
669 % else:
670 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
670 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
671 <code>${item.position}</code>
671 <code>${item.position}</code>
672 ${item.title}
672 ${item.title}
673 </a>
673 </a>
674 % endif
674 % endif
675 </li>
675 </li>
676 % endfor
676 % endfor
677
677
678 <li class="logout">
678 <li class="logout">
679 ${h.secure_form(h.route_path('logout'), request=request)}
679 ${h.secure_form(h.route_path('logout'), request=request)}
680 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
680 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
681 ${h.end_form()}
681 ${h.end_form()}
682 </li>
682 </li>
683 </ol>
683 </ol>
684 </div>
684 </div>
685 %endif
685 %endif
686 </div>
686 </div>
687 </div>
687 </div>
688
688
689 % endif
689 % endif
690 </li>
690 </li>
691 </%def>
691 </%def>
692
692
693 <%def name="menu_items(active=None)">
693 <%def name="menu_items(active=None)">
694
694
695 <ul id="quick" class="main_nav navigation horizontal-list">
695 <ul id="quick" class="main_nav navigation horizontal-list">
696 ## notice box for important system messages
696 ## notice box for important system messages
697 <li style="display: none">
697 <li style="display: none">
698 <a class="notice-box" href="#openNotice" onclick="return false">
698 <a class="notice-box" href="#openNotice" onclick="return false">
699 <div class="menulabel-notice" >
699 <div class="menulabel-notice" >
700 0
700 0
701 </div>
701 </div>
702 </a>
702 </a>
703 </li>
703 </li>
704
704
705 ## Main filter
705 ## Main filter
706 <li>
706 <li>
707 <div class="menulabel main_filter_box">
707 <div class="menulabel main_filter_box">
708 <div class="main_filter_input_box">
708 <div class="main_filter_input_box">
709 <ul class="searchItems">
709 <ul class="searchItems">
710
710
711 <li class="searchTag searchTagIcon">
712 <i class="icon-search"></i>
713 </li>
714
711 % if c.template_context['search_context']['repo_id']:
715 % if c.template_context['search_context']['repo_id']:
712 <li class="searchTag searchTagFilter searchTagHidable" >
716 <li class="searchTag searchTagFilter searchTagHidable" >
713 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
717 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
714 <span class="tag">
718 <span class="tag">
715 This repo
719 This repo
716 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
720 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
717 </span>
721 </span>
718 ##</a>
722 ##</a>
719 </li>
723 </li>
720 % elif c.template_context['search_context']['repo_group_id']:
724 % elif c.template_context['search_context']['repo_group_id']:
721 <li class="searchTag searchTagFilter searchTagHidable">
725 <li class="searchTag searchTagFilter searchTagHidable">
722 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
726 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
723 <span class="tag">
727 <span class="tag">
724 This group
728 This group
725 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
729 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
726 </span>
730 </span>
727 ##</a>
731 ##</a>
728 </li>
732 </li>
729 % endif
733 % endif
730
734
731 <li class="searchTagInput">
735 <li class="searchTagInput">
732 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
736 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
733 </li>
737 </li>
734 <li class="searchTag searchTagHelp">
738 <li class="searchTag searchTagHelp">
735 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
739 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
736 </li>
740 </li>
737 </ul>
741 </ul>
738 </div>
742 </div>
739 </div>
743 </div>
740
744
741 <div id="main_filter_help" style="display: none">
745 <div id="main_filter_help" style="display: none">
742 - Use '/' key to quickly access this field.
746 - Use '/' key to quickly access this field.
743
747
744 - Enter a name of repository, or repository group for quick search.
748 - Enter a name of repository, or repository group for quick search.
745
749
746 - Prefix query to allow special search:
750 - Prefix query to allow special search:
747
751
748 user:admin, to search for usernames, always global
752 user:admin, to search for usernames, always global
749
753
750 user_group:devops, to search for user groups, always global
754 user_group:devops, to search for user groups, always global
751
755
752 commit:efced4, to search for commits, scoped to repositories or groups
756 commit:efced4, to search for commits, scoped to repositories or groups
753
757
754 file:models.py, to search for file paths, scoped to repositories or groups
758 file:models.py, to search for file paths, scoped to repositories or groups
755
759
756 % if c.template_context['search_context']['repo_id']:
760 % if c.template_context['search_context']['repo_id']:
757 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
761 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
758 % elif c.template_context['search_context']['repo_group_id']:
762 % elif c.template_context['search_context']['repo_group_id']:
759 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
763 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
760 % else:
764 % else:
761 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
765 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
762 % endif
766 % endif
763 </div>
767 </div>
764 </li>
768 </li>
765
769
766 ## ROOT MENU
770 ## ROOT MENU
767 <li class="${h.is_active('home', active)}">
771 <li class="${h.is_active('home', active)}">
768 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
772 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
769 <div class="menulabel">${_('Home')}</div>
773 <div class="menulabel">${_('Home')}</div>
770 </a>
774 </a>
771 </li>
775 </li>
772
776
773 %if c.rhodecode_user.username != h.DEFAULT_USER:
777 %if c.rhodecode_user.username != h.DEFAULT_USER:
774 <li class="${h.is_active('journal', active)}">
778 <li class="${h.is_active('journal', active)}">
775 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
779 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
776 <div class="menulabel">${_('Journal')}</div>
780 <div class="menulabel">${_('Journal')}</div>
777 </a>
781 </a>
778 </li>
782 </li>
779 %else:
783 %else:
780 <li class="${h.is_active('journal', active)}">
784 <li class="${h.is_active('journal', active)}">
781 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
785 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
782 <div class="menulabel">${_('Public journal')}</div>
786 <div class="menulabel">${_('Public journal')}</div>
783 </a>
787 </a>
784 </li>
788 </li>
785 %endif
789 %endif
786
790
787 <li class="${h.is_active('gists', active)}">
791 <li class="${h.is_active('gists', active)}">
788 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
792 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
789 <div class="menulabel">${_('Gists')}</div>
793 <div class="menulabel">${_('Gists')}</div>
790 </a>
794 </a>
791 </li>
795 </li>
792
796
793 % if c.is_super_admin or c.is_delegated_admin:
797 % if c.is_super_admin or c.is_delegated_admin:
794 <li class="${h.is_active('admin', active)}">
798 <li class="${h.is_active('admin', active)}">
795 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
799 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
796 <div class="menulabel">${_('Admin')} </div>
800 <div class="menulabel">${_('Admin')} </div>
797 </a>
801 </a>
798 </li>
802 </li>
799 % endif
803 % endif
800
804
801 ## render extra user menu
805 ## render extra user menu
802 ${usermenu(active=(active=='my_account'))}
806 ${usermenu(active=(active=='my_account'))}
803
807
804 </ul>
808 </ul>
805
809
806 <script type="text/javascript">
810 <script type="text/javascript">
807 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
811 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
808
812
809 var formatRepoResult = function(result, container, query, escapeMarkup) {
813 var formatRepoResult = function(result, container, query, escapeMarkup) {
810 return function(data, escapeMarkup) {
814 return function(data, escapeMarkup) {
811 if (!data.repo_id){
815 if (!data.repo_id){
812 return data.text; // optgroup text Repositories
816 return data.text; // optgroup text Repositories
813 }
817 }
814
818
815 var tmpl = '';
819 var tmpl = '';
816 var repoType = data['repo_type'];
820 var repoType = data['repo_type'];
817 var repoName = data['text'];
821 var repoName = data['text'];
818
822
819 if(data && data.type == 'repo'){
823 if(data && data.type == 'repo'){
820 if(repoType === 'hg'){
824 if(repoType === 'hg'){
821 tmpl += '<i class="icon-hg"></i> ';
825 tmpl += '<i class="icon-hg"></i> ';
822 }
826 }
823 else if(repoType === 'git'){
827 else if(repoType === 'git'){
824 tmpl += '<i class="icon-git"></i> ';
828 tmpl += '<i class="icon-git"></i> ';
825 }
829 }
826 else if(repoType === 'svn'){
830 else if(repoType === 'svn'){
827 tmpl += '<i class="icon-svn"></i> ';
831 tmpl += '<i class="icon-svn"></i> ';
828 }
832 }
829 if(data['private']){
833 if(data['private']){
830 tmpl += '<i class="icon-lock" ></i> ';
834 tmpl += '<i class="icon-lock" ></i> ';
831 }
835 }
832 else if(visualShowPublicIcon){
836 else if(visualShowPublicIcon){
833 tmpl += '<i class="icon-unlock-alt"></i> ';
837 tmpl += '<i class="icon-unlock-alt"></i> ';
834 }
838 }
835 }
839 }
836 tmpl += escapeMarkup(repoName);
840 tmpl += escapeMarkup(repoName);
837 return tmpl;
841 return tmpl;
838
842
839 }(result, escapeMarkup);
843 }(result, escapeMarkup);
840 };
844 };
841
845
842 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
846 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
843 return function(data, escapeMarkup) {
847 return function(data, escapeMarkup) {
844 if (!data.repo_group_id){
848 if (!data.repo_group_id){
845 return data.text; // optgroup text Repositories
849 return data.text; // optgroup text Repositories
846 }
850 }
847
851
848 var tmpl = '';
852 var tmpl = '';
849 var repoGroupName = data['text'];
853 var repoGroupName = data['text'];
850
854
851 if(data){
855 if(data){
852
856
853 tmpl += '<i class="icon-repo-group"></i> ';
857 tmpl += '<i class="icon-repo-group"></i> ';
854
858
855 }
859 }
856 tmpl += escapeMarkup(repoGroupName);
860 tmpl += escapeMarkup(repoGroupName);
857 return tmpl;
861 return tmpl;
858
862
859 }(result, escapeMarkup);
863 }(result, escapeMarkup);
860 };
864 };
861
865
862 var escapeRegExChars = function (value) {
866 var escapeRegExChars = function (value) {
863 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
867 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
864 };
868 };
865
869
866 var getRepoIcon = function(repo_type) {
870 var getRepoIcon = function(repo_type) {
867 if (repo_type === 'hg') {
871 if (repo_type === 'hg') {
868 return '<i class="icon-hg"></i> ';
872 return '<i class="icon-hg"></i> ';
869 }
873 }
870 else if (repo_type === 'git') {
874 else if (repo_type === 'git') {
871 return '<i class="icon-git"></i> ';
875 return '<i class="icon-git"></i> ';
872 }
876 }
873 else if (repo_type === 'svn') {
877 else if (repo_type === 'svn') {
874 return '<i class="icon-svn"></i> ';
878 return '<i class="icon-svn"></i> ';
875 }
879 }
876 return ''
880 return ''
877 };
881 };
878
882
879 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
883 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
880
884
881 if (value.split(':').length === 2) {
885 if (value.split(':').length === 2) {
882 value = value.split(':')[1]
886 value = value.split(':')[1]
883 }
887 }
884
888
885 var searchType = data['type'];
889 var searchType = data['type'];
886 var searchSubType = data['subtype'];
890 var searchSubType = data['subtype'];
887 var valueDisplay = data['value_display'];
891 var valueDisplay = data['value_display'];
888
892
889 var pattern = '(' + escapeRegExChars(value) + ')';
893 var pattern = '(' + escapeRegExChars(value) + ')';
890
894
891 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
895 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
892
896
893 // highlight match
897 // highlight match
894 if (searchType != 'text') {
898 if (searchType != 'text') {
895 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
899 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
896 }
900 }
897
901
898 var icon = '';
902 var icon = '';
899
903
900 if (searchType === 'hint') {
904 if (searchType === 'hint') {
901 icon += '<i class="icon-repo-group"></i> ';
905 icon += '<i class="icon-repo-group"></i> ';
902 }
906 }
903 // full text search/hints
907 // full text search/hints
904 else if (searchType === 'search') {
908 else if (searchType === 'search') {
905 icon += '<i class="icon-more"></i> ';
909 icon += '<i class="icon-more"></i> ';
906 if (searchSubType !== undefined && searchSubType == 'repo') {
910 if (searchSubType !== undefined && searchSubType == 'repo') {
907 valueDisplay += '<div class="pull-right tag">repository</div>';
911 valueDisplay += '<div class="pull-right tag">repository</div>';
908 }
912 }
909 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
913 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
910 valueDisplay += '<div class="pull-right tag">repo group</div>';
914 valueDisplay += '<div class="pull-right tag">repo group</div>';
911 }
915 }
912 }
916 }
913 // repository
917 // repository
914 else if (searchType === 'repo') {
918 else if (searchType === 'repo') {
915
919
916 var repoIcon = getRepoIcon(data['repo_type']);
920 var repoIcon = getRepoIcon(data['repo_type']);
917 icon += repoIcon;
921 icon += repoIcon;
918
922
919 if (data['private']) {
923 if (data['private']) {
920 icon += '<i class="icon-lock" ></i> ';
924 icon += '<i class="icon-lock" ></i> ';
921 }
925 }
922 else if (visualShowPublicIcon) {
926 else if (visualShowPublicIcon) {
923 icon += '<i class="icon-unlock-alt"></i> ';
927 icon += '<i class="icon-unlock-alt"></i> ';
924 }
928 }
925 }
929 }
926 // repository groups
930 // repository groups
927 else if (searchType === 'repo_group') {
931 else if (searchType === 'repo_group') {
928 icon += '<i class="icon-repo-group"></i> ';
932 icon += '<i class="icon-repo-group"></i> ';
929 }
933 }
930 // user group
934 // user group
931 else if (searchType === 'user_group') {
935 else if (searchType === 'user_group') {
932 icon += '<i class="icon-group"></i> ';
936 icon += '<i class="icon-group"></i> ';
933 }
937 }
934 // user
938 // user
935 else if (searchType === 'user') {
939 else if (searchType === 'user') {
936 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
940 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
937 }
941 }
938 // commit
942 // commit
939 else if (searchType === 'commit') {
943 else if (searchType === 'commit') {
940 var repo_data = data['repo_data'];
944 var repo_data = data['repo_data'];
941 var repoIcon = getRepoIcon(repo_data['repository_type']);
945 var repoIcon = getRepoIcon(repo_data['repository_type']);
942 if (repoIcon) {
946 if (repoIcon) {
943 icon += repoIcon;
947 icon += repoIcon;
944 } else {
948 } else {
945 icon += '<i class="icon-tag"></i>';
949 icon += '<i class="icon-tag"></i>';
946 }
950 }
947 }
951 }
948 // file
952 // file
949 else if (searchType === 'file') {
953 else if (searchType === 'file') {
950 var repo_data = data['repo_data'];
954 var repo_data = data['repo_data'];
951 var repoIcon = getRepoIcon(repo_data['repository_type']);
955 var repoIcon = getRepoIcon(repo_data['repository_type']);
952 if (repoIcon) {
956 if (repoIcon) {
953 icon += repoIcon;
957 icon += repoIcon;
954 } else {
958 } else {
955 icon += '<i class="icon-tag"></i>';
959 icon += '<i class="icon-tag"></i>';
956 }
960 }
957 }
961 }
958 // generic text
962 // generic text
959 else if (searchType === 'text') {
963 else if (searchType === 'text') {
960 icon = '';
964 icon = '';
961 }
965 }
962
966
963 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
967 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
964 return tmpl.format(icon, valueDisplay);
968 return tmpl.format(icon, valueDisplay);
965 };
969 };
966
970
967 var handleSelect = function(element, suggestion) {
971 var handleSelect = function(element, suggestion) {
968 if (suggestion.type === "hint") {
972 if (suggestion.type === "hint") {
969 // we skip action
973 // we skip action
970 $('#main_filter').focus();
974 $('#main_filter').focus();
971 }
975 }
972 else if (suggestion.type === "text") {
976 else if (suggestion.type === "text") {
973 // we skip action
977 // we skip action
974 $('#main_filter').focus();
978 $('#main_filter').focus();
975
979
976 } else {
980 } else {
977 window.location = suggestion['url'];
981 window.location = suggestion['url'];
978 }
982 }
979 };
983 };
980
984
981 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
985 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
982 if (queryLowerCase.split(':').length === 2) {
986 if (queryLowerCase.split(':').length === 2) {
983 queryLowerCase = queryLowerCase.split(':')[1]
987 queryLowerCase = queryLowerCase.split(':')[1]
984 }
988 }
985 if (suggestion.type === "text") {
989 if (suggestion.type === "text") {
986 // special case we don't want to "skip" display for
990 // special case we don't want to "skip" display for
987 return true
991 return true
988 }
992 }
989 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
993 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
990 };
994 };
991
995
992 var cleanContext = {
996 var cleanContext = {
993 repo_view_type: null,
997 repo_view_type: null,
994
998
995 repo_id: null,
999 repo_id: null,
996 repo_name: "",
1000 repo_name: "",
997
1001
998 repo_group_id: null,
1002 repo_group_id: null,
999 repo_group_name: null
1003 repo_group_name: null
1000 };
1004 };
1001 var removeGoToFilter = function () {
1005 var removeGoToFilter = function () {
1002 $('.searchTagHidable').hide();
1006 $('.searchTagHidable').hide();
1003 $('#main_filter').autocomplete(
1007 $('#main_filter').autocomplete(
1004 'setOptions', {params:{search_context: cleanContext}});
1008 'setOptions', {params:{search_context: cleanContext}});
1005 };
1009 };
1006
1010
1007 $('#main_filter').autocomplete({
1011 $('#main_filter').autocomplete({
1008 serviceUrl: pyroutes.url('goto_switcher_data'),
1012 serviceUrl: pyroutes.url('goto_switcher_data'),
1009 params: {
1013 params: {
1010 "search_context": templateContext.search_context
1014 "search_context": templateContext.search_context
1011 },
1015 },
1012 minChars:2,
1016 minChars:2,
1013 maxHeight:400,
1017 maxHeight:400,
1014 deferRequestBy: 300, //miliseconds
1018 deferRequestBy: 300, //miliseconds
1015 tabDisabled: true,
1019 tabDisabled: true,
1016 autoSelectFirst: false,
1020 autoSelectFirst: false,
1017 containerClass: 'autocomplete-qfilter-suggestions',
1021 containerClass: 'autocomplete-qfilter-suggestions',
1018 formatResult: autocompleteMainFilterFormatResult,
1022 formatResult: autocompleteMainFilterFormatResult,
1019 lookupFilter: autocompleteMainFilterResult,
1023 lookupFilter: autocompleteMainFilterResult,
1020 onSelect: function (element, suggestion) {
1024 onSelect: function (element, suggestion) {
1021 handleSelect(element, suggestion);
1025 handleSelect(element, suggestion);
1022 return false;
1026 return false;
1023 },
1027 },
1024 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1028 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
1025 if (jqXHR !== 'abort') {
1029 if (jqXHR !== 'abort') {
1026 alert("Error during search.\nError code: {0}".format(textStatus));
1030 alert("Error during search.\nError code: {0}".format(textStatus));
1027 window.location = '';
1031 window.location = '';
1028 }
1032 }
1029 }
1033 },
1034 onSearchStart: function (params) {
1035 $('.searchTag.searchTagIcon').html('<i class="icon-spin animate-spin"></i>')
1036 },
1037 onSearchComplete: function (query, suggestions) {
1038 $('.searchTag.searchTagIcon').html('<i class="icon-search"></i>')
1039 },
1030 });
1040 });
1031
1041
1032 showMainFilterBox = function () {
1042 showMainFilterBox = function () {
1033 $('#main_filter_help').toggle();
1043 $('#main_filter_help').toggle();
1034 };
1044 };
1035
1045
1036 $('#main_filter').on('keydown.autocomplete', function (e) {
1046 $('#main_filter').on('keydown.autocomplete', function (e) {
1037
1047
1038 var BACKSPACE = 8;
1048 var BACKSPACE = 8;
1039 var el = $(e.currentTarget);
1049 var el = $(e.currentTarget);
1040 if(e.which === BACKSPACE){
1050 if(e.which === BACKSPACE){
1041 var inputVal = el.val();
1051 var inputVal = el.val();
1042 if (inputVal === ""){
1052 if (inputVal === ""){
1043 removeGoToFilter()
1053 removeGoToFilter()
1044 }
1054 }
1045 }
1055 }
1046 });
1056 });
1047
1057
1048 </script>
1058 </script>
1049 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1059 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
1050 </%def>
1060 </%def>
1051
1061
1052 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1062 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
1053 <div class="modal-dialog">
1063 <div class="modal-dialog">
1054 <div class="modal-content">
1064 <div class="modal-content">
1055 <div class="modal-header">
1065 <div class="modal-header">
1056 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1066 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1057 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1067 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
1058 </div>
1068 </div>
1059 <div class="modal-body">
1069 <div class="modal-body">
1060 <div class="block-left">
1070 <div class="block-left">
1061 <table class="keyboard-mappings">
1071 <table class="keyboard-mappings">
1062 <tbody>
1072 <tbody>
1063 <tr>
1073 <tr>
1064 <th></th>
1074 <th></th>
1065 <th>${_('Site-wide shortcuts')}</th>
1075 <th>${_('Site-wide shortcuts')}</th>
1066 </tr>
1076 </tr>
1067 <%
1077 <%
1068 elems = [
1078 elems = [
1069 ('/', 'Use quick search box'),
1079 ('/', 'Use quick search box'),
1070 ('g h', 'Goto home page'),
1080 ('g h', 'Goto home page'),
1071 ('g g', 'Goto my private gists page'),
1081 ('g g', 'Goto my private gists page'),
1072 ('g G', 'Goto my public gists page'),
1082 ('g G', 'Goto my public gists page'),
1073 ('g 0-9', 'Goto bookmarked items from 0-9'),
1083 ('g 0-9', 'Goto bookmarked items from 0-9'),
1074 ('n r', 'New repository page'),
1084 ('n r', 'New repository page'),
1075 ('n g', 'New gist page'),
1085 ('n g', 'New gist page'),
1076 ]
1086 ]
1077 %>
1087 %>
1078 %for key, desc in elems:
1088 %for key, desc in elems:
1079 <tr>
1089 <tr>
1080 <td class="keys">
1090 <td class="keys">
1081 <span class="key tag">${key}</span>
1091 <span class="key tag">${key}</span>
1082 </td>
1092 </td>
1083 <td>${desc}</td>
1093 <td>${desc}</td>
1084 </tr>
1094 </tr>
1085 %endfor
1095 %endfor
1086 </tbody>
1096 </tbody>
1087 </table>
1097 </table>
1088 </div>
1098 </div>
1089 <div class="block-left">
1099 <div class="block-left">
1090 <table class="keyboard-mappings">
1100 <table class="keyboard-mappings">
1091 <tbody>
1101 <tbody>
1092 <tr>
1102 <tr>
1093 <th></th>
1103 <th></th>
1094 <th>${_('Repositories')}</th>
1104 <th>${_('Repositories')}</th>
1095 </tr>
1105 </tr>
1096 <%
1106 <%
1097 elems = [
1107 elems = [
1098 ('g s', 'Goto summary page'),
1108 ('g s', 'Goto summary page'),
1099 ('g c', 'Goto changelog page'),
1109 ('g c', 'Goto changelog page'),
1100 ('g f', 'Goto files page'),
1110 ('g f', 'Goto files page'),
1101 ('g F', 'Goto files page with file search activated'),
1111 ('g F', 'Goto files page with file search activated'),
1102 ('g p', 'Goto pull requests page'),
1112 ('g p', 'Goto pull requests page'),
1103 ('g o', 'Goto repository settings'),
1113 ('g o', 'Goto repository settings'),
1104 ('g O', 'Goto repository access permissions settings'),
1114 ('g O', 'Goto repository access permissions settings'),
1105 ]
1115 ]
1106 %>
1116 %>
1107 %for key, desc in elems:
1117 %for key, desc in elems:
1108 <tr>
1118 <tr>
1109 <td class="keys">
1119 <td class="keys">
1110 <span class="key tag">${key}</span>
1120 <span class="key tag">${key}</span>
1111 </td>
1121 </td>
1112 <td>${desc}</td>
1122 <td>${desc}</td>
1113 </tr>
1123 </tr>
1114 %endfor
1124 %endfor
1115 </tbody>
1125 </tbody>
1116 </table>
1126 </table>
1117 </div>
1127 </div>
1118 </div>
1128 </div>
1119 <div class="modal-footer">
1129 <div class="modal-footer">
1120 </div>
1130 </div>
1121 </div><!-- /.modal-content -->
1131 </div><!-- /.modal-content -->
1122 </div><!-- /.modal-dialog -->
1132 </div><!-- /.modal-dialog -->
1123 </div><!-- /.modal -->
1133 </div><!-- /.modal -->
General Comments 0
You need to be logged in to leave comments. Login now