##// END OF EJS Templates
permissions: unified looks and buttons on permission pages....
dan -
r2980:5cb2321a default
parent child Browse files
Show More
@@ -1,695 +1,696 b''
1 1 // navigation.less
2 2 // For use in RhodeCode applications;
3 3 // see style guide documentation for guidelines.
4 4
5 5 // HEADER NAVIGATION
6 6
7 7 .horizontal-list {
8 8 float: right;
9 9 display: block;
10 10 margin: 0;
11 11 padding: 0;
12 12 -webkit-padding-start: 0;
13 13 text-align: left;
14 14 font-size: @navigation-fontsize;
15 15 color: @grey6;
16 16 z-index:10;
17 17
18 18 li {
19 19 line-height: 1em;
20 20 list-style-type: none;
21 21
22 22 a {
23 23 padding: 0 .5em;
24 24
25 25 &.menu_link_notifications {
26 26 .pill(7px,@rcblue);
27 27 display: inline;
28 28 margin: 0 7px 0 .7em;
29 29 font-size: @basefontsize;
30 30 color: white;
31 31
32 32 &.empty {
33 33 background-color: @grey4;
34 34 }
35 35
36 36 &:hover {
37 37 background-color: @rcdarkblue;
38 38 }
39 39 }
40 40 }
41 41 .pill_container {
42 42 margin: 1.25em 0px 0px 0px;
43 43 float: right;
44 44 }
45 45
46 46 &#quick_login_li {
47 47 &:hover {
48 48 color: @grey5;
49 49 }
50 50
51 51 a.menu_link_notifications {
52 52 color: white;
53 53 }
54 54
55 55 .user {
56 56 padding-bottom: 10px;
57 57 }
58 58
59 59 &.open {
60 60 .user {
61 61 border-bottom: 5px solid @rcblue;
62 62 }
63 63 }
64 64 }
65 65
66 66 &:before { content: none; }
67 67
68 68 &:last-child {
69 69 .menulabel {
70 70 padding-right: 0;
71 71 border-right: none;
72 72
73 73 .show_more {
74 74 padding-right: 0;
75 75 }
76 76 }
77 77
78 78 &> a {
79 79 border-bottom: none;
80 80 }
81 81 }
82 82
83 83 &.active {
84 84 border-bottom: 5px solid @rcblue;
85 85 }
86 86
87 87 &.open {
88 88
89 89 a {
90 90 color: white;
91 91 }
92 92 }
93 93
94 94 &:focus {
95 95 outline: none;
96 96 }
97 97
98 98 ul li {
99 99 display: block;
100 100
101 101 &:last-child> a {
102 102 border-bottom: none;
103 103 }
104 104
105 105 ul li:last-child a {
106 106 /* we don't expect more then 3 levels of submenu and the third
107 107 level can have different html structure */
108 108 border-bottom: none;
109 109 }
110 110 }
111 111 }
112 112
113 113 > li {
114 114 float: left;
115 115 display: block;
116 116 padding: 0;
117 117
118 118 > a,
119 119 &.has_select2 a {
120 120 display: block;
121 121 padding: 10px 0 2px;
122 122
123 123 .show_more {
124 124 margin-top: -4px;
125 125 padding-right: .5em;
126 126 }
127 127 }
128 128
129 129 .menulabel {
130 130 padding: 0 .5em;
131 131 line-height: 1em;
132 132 // for this specifically we do not use a variable
133 133 border-right: 1px solid @grey4;
134 134 }
135 135
136 136 .pr_notifications {
137 137 padding-left: .5em;
138 138 }
139 139
140 140 .pr_notifications + .menulabel {
141 141 display:inline;
142 142 padding-left: 0;
143 143 }
144 144
145 145 &:hover,
146 146 &.open,
147 147 &.active {
148 148 a {
149 149 color: @grey1;
150 150 }
151 151 }
152 152 }
153 153
154 154 pre {
155 155 margin: 0;
156 156 padding: 0;
157 157 }
158 158
159 159 .select2-container,
160 160 .menulink.childs {
161 161 position: relative;
162 162 }
163 163
164 164 #quick_login {
165 165
166 166 li a {
167 167 padding: .5em 0;
168 168 border-bottom: none;
169 169 color: @grey2;
170 170
171 171 &:hover { color: @grey1; }
172 172 }
173 173
174 174 .show_more {
175 175 padding-left: .5em;
176 176 }
177 177 }
178 178
179 179 #quick_login_link {
180 180 display: inline-block;
181 181
182 182 .gravatar {
183 183 border: 1px solid @grey2;
184 184 }
185 185
186 186 .gravatar-login {
187 187 height: 20px;
188 188 width: 20px;
189 189 margin: -8px 0;
190 190 padding: 0;
191 191 }
192 192
193 193 &:hover .user {
194 194 color: @grey6;
195 195 }
196 196 }
197 197 }
198 198 .header .horizontal-list {
199 199
200 200 li {
201 201
202 202 &#quick_login_li {
203 203 padding-left: .5em;
204 204
205 205 &:hover #quick_login_link {
206 206 color: inherit;
207 207 }
208 208 }
209 209
210 210 &:before { content: none; }
211 211 }
212 212
213 213 > li {
214 214
215 215 a {
216 216 padding: 18px 0 12px 0;
217 217 color: @nav-grey;
218 218
219 219 &.menu_link_notifications {
220 220 padding: 1px 8px;
221 221 }
222 222 }
223 223
224 224 &:hover,
225 225 &.open,
226 226 &.active {
227 227 .pill_container a {
228 228 // don't select text for the pill container, it has it' own
229 229 // hover behaviour
230 230 color: @nav-grey;
231 231 }
232 232 }
233 233
234 234 &:hover,
235 235 &.open,
236 236 &.active {
237 237 a {
238 238 color: @grey6;
239 239 }
240 240 }
241 241
242 242 .select2-dropdown-open a {
243 243 color: @grey6;
244 244 }
245 245
246 246 .repo-switcher {
247 247 padding-left: 0;
248 248
249 249 .menulabel {
250 250 padding-left: 0;
251 251 }
252 252 }
253 253 }
254 254
255 255 li ul li {
256 256 background-color:@grey2;
257 257
258 258 a {
259 259 padding: .5em 0;
260 260 border-bottom: @border-thickness solid @border-default-color;
261 261 color: @grey6;
262 262 }
263 263
264 264 &:last-child a, &.last a{
265 265 border-bottom: none;
266 266 }
267 267
268 268 &:hover {
269 269 background-color: @grey3;
270 270 }
271 271 }
272 272
273 273 .submenu {
274 274 margin-top: 5px;
275 275 }
276 276 }
277 277
278 278 // SUBMENUS
279 279 .navigation .submenu {
280 280 display: none;
281 281 }
282 282
283 283 .navigation li.open {
284 284 .submenu {
285 285 display: block;
286 286 }
287 287 }
288 288
289 289 .navigation li:last-child .submenu {
290 290 right: -20px;
291 291 left: auto;
292 292 }
293 293
294 294 .submenu {
295 295 position: absolute;
296 296 top: 100%;
297 297 left: 0;
298 298 min-width: 150px;
299 299 margin: 6px 0 0;
300 300 padding: 0;
301 301 text-align: left;
302 302 font-family: @text-light;
303 303 border-radius: @border-radius;
304 304 z-index: 20;
305 305
306 306 li {
307 307 display: block;
308 308 margin: 0;
309 309 padding: 0 .5em;
310 310 line-height: 1em;
311 311 color: @grey3;
312 312 background-color: @grey6;
313 313
314 314 &:before { content: none; }
315 315
316 316 a {
317 317 display: block;
318 318 width: 100%;
319 319 padding: .5em 0;
320 320 border-right: none;
321 321 border-bottom: @border-thickness solid white;
322 322 color: @grey3;
323 323 }
324 324
325 325 ul {
326 326 display: none;
327 327 position: absolute;
328 328 top: 0;
329 329 right: 100%;
330 330 padding: 0;
331 331 z-index: 30;
332 332 }
333 333 &:hover {
334 334 background-color: @grey5;
335 335 -webkit-transition: background .3s;
336 336 -moz-transition: background .3s;
337 337 -o-transition: background .3s;
338 338 transition: background .3s;
339 339
340 340 ul {
341 341 display: block;
342 342 }
343 343 }
344 344 }
345 345 }
346 346
347 347
348 348
349 349
350 350 // repo dropdown
351 351 .quick_repo_menu {
352 352 width: 15px;
353 353 text-align: center;
354 354 position: relative;
355 355 cursor: pointer;
356 356
357 357 div {
358 358 overflow: visible !important;
359 359 }
360 360
361 361 &.sorting {
362 362 cursor: auto;
363 363 }
364 364
365 365 &:hover {
366 366 .menu_items_container {
367 367 position: absolute;
368 368 display: block;
369 369 }
370 370 .menu_items {
371 371 display: block;
372 372 }
373 373 }
374 374
375 375 i {
376 376 margin: 0;
377 377 color: @grey4;
378 378 }
379 379
380 380 .menu_items_container {
381 381 position: absolute;
382 382 top: 0;
383 383 left: 100%;
384 384 margin: 0;
385 385 padding: 0;
386 386 list-style: none;
387 387 background-color: @grey6;
388 388 z-index: 999;
389 389 text-align: left;
390 390
391 391 a {
392 392 color: @grey2;
393 393 }
394 394
395 395 ul.menu_items {
396 396 margin: 0;
397 397 padding: 0;
398 398 }
399 399
400 400 li {
401 401 margin: 0;
402 402 padding: 0;
403 403 line-height: 1em;
404 404 list-style-type: none;
405 405
406 406 &:before { content: none; }
407 407
408 408 a {
409 409 display: block;
410 410 height: 16px;
411 411 padding: 8px; //must add up to td height (28px)
412 width: 120px; // set width
412 413
413 414 &:hover {
414 415 background-color: @grey5;
415 416 -webkit-transition: background .3s;
416 417 -moz-transition: background .3s;
417 418 -o-transition: background .3s;
418 419 transition: background .3s;
419 420 }
420 421 }
421 422 }
422 423 }
423 424 }
424 425
425 426 // Header Repository Switcher
426 427 // Select2 Dropdown
427 428 #select2-drop.select2-drop.repo-switcher-dropdown {
428 429 width: auto !important;
429 430 margin-top: 5px;
430 431 padding: 1em 0;
431 432 text-align: left;
432 433 .border-radius-bottom(@border-radius);
433 434 border-color: transparent;
434 435 color: @grey6;
435 436 background-color: @grey2;
436 437
437 438 input {
438 439 min-width: 90%;
439 440 }
440 441
441 442 ul.select2-result-sub {
442 443
443 444 li {
444 445 line-height: 1em;
445 446
446 447 &:hover,
447 448 &.select2-highlighted {
448 449 background-color: @grey3;
449 450 }
450 451 }
451 452
452 453 &:before { content: none; }
453 454 }
454 455
455 456 ul.select2-results {
456 457 min-width: 200px;
457 458 margin: 0;
458 459 padding: 0;
459 460 list-style-type: none;
460 461 overflow-x: visible;
461 462 overflow-y: scroll;
462 463
463 464 li {
464 465 padding: 0 8px;
465 466 line-height: 1em;
466 467 color: @grey6;
467 468
468 469 &:before { content: none; }
469 470
470 471 &>.select2-result-label {
471 472 padding: 8px 0;
472 473 border-bottom: @border-thickness solid @grey3;
473 474 white-space: nowrap;
474 475 color: @grey5;
475 476 cursor: pointer;
476 477 }
477 478
478 479 &.select2-result-with-children {
479 480 margin: 0;
480 481 padding: 0;
481 482 }
482 483
483 484 &.select2-result-unselectable > .select2-result-label {
484 485 margin: 0 8px;
485 486 }
486 487
487 488 }
488 489 }
489 490
490 491 ul.select2-result-sub {
491 492 margin: 0;
492 493 padding: 0;
493 494
494 495 li {
495 496 display: block;
496 497 margin: 0;
497 498 border-right: none;
498 499 line-height: 1em;
499 500 font-family: @text-light;
500 501 color: @grey2;
501 502
502 503 &:before { content: none; }
503 504
504 505 &:hover {
505 506 background-color: @grey3;
506 507 }
507 508 }
508 509 }
509 510 }
510 511
511 512
512 513 #context-bar {
513 514 display: block;
514 515 margin: 0 auto;
515 516 padding: 0 @header-padding;
516 517 background-color: @grey6;
517 518 border-bottom: @border-thickness solid @grey5;
518 519
519 520 .clear {
520 521 clear: both;
521 522 }
522 523 }
523 524
524 525 ul#context-pages {
525 526 li {
526 527 line-height: 1em;
527 528
528 529 &:before { content: none; }
529 530
530 531 a {
531 532 color: @grey3;
532 533 }
533 534
534 535 &.active {
535 536 // special case, non-variable color
536 537 border-bottom: 4px solid @nav-grey;
537 538
538 539 a {
539 540 color: @grey1;
540 541 }
541 542 }
542 543 }
543 544 }
544 545
545 546 // PAGINATION
546 547
547 548 .pagination {
548 549 border: @border-thickness solid @rcblue;
549 550 color: @rcblue;
550 551
551 552 .current {
552 553 color: @grey4;
553 554 }
554 555 }
555 556
556 557 .dataTables_processing {
557 558 text-align: center;
558 559 font-size: 1.1em;
559 560 position: relative;
560 561 top: 95px;
561 562 }
562 563
563 564 .dataTables_paginate, .pagination-wh {
564 565 text-align: left;
565 566 display: inline-block;
566 567 border-left: 1px solid @rcblue;
567 568 float: none;
568 569 overflow: hidden;
569 570
570 571 .paginate_button, .pager_curpage,
571 572 .pager_link, .pg-previous, .pg-next, .pager_dotdot {
572 573 display: inline-block;
573 574 padding: @menupadding/4 @menupadding;
574 575 border: 1px solid @rcblue;
575 576 border-left: 0;
576 577 color: @rcblue;
577 578 cursor: pointer;
578 579 float: left;
579 580 }
580 581
581 582 .pager_curpage, .pager_dotdot,
582 583 .paginate_button.current, .paginate_button.disabled,
583 584 .disabled {
584 585 color: @grey3;
585 586 cursor: default;
586 587 }
587 588
588 589 .ellipsis {
589 590 display: inline-block;
590 591 text-align: left;
591 592 padding: @menupadding/4 @menupadding;
592 593 border: 1px solid @rcblue;
593 594 border-left: 0;
594 595 float: left;
595 596 }
596 597 }
597 598
598 599 // SIDEBAR
599 600
600 601 .sidebar {
601 602 .block-left;
602 603 clear: left;
603 604 max-width: @sidebar-width;
604 605 margin-right: @sidebarpadding;
605 606 padding-right: @sidebarpadding;
606 607 font-family: @text-regular;
607 608 color: @grey1;
608 609
609 610 &#graph_nodes {
610 611 clear:both;
611 612 width: auto;
612 613 margin-left: -100px;
613 614 padding: 0;
614 615 border: none;
615 616 }
616 617
617 618 .nav-pills {
618 619 margin: 0;
619 620 }
620 621
621 622 .nav {
622 623 list-style: none;
623 624 padding: 0;
624 625
625 626 li {
626 627 padding-bottom: @menupadding;
627 628 line-height: 1em;
628 629 color: @grey4;
629 630
630 631 &.active a {
631 632 color: @grey2;
632 633 }
633 634
634 635 a {
635 636 color: @grey4;
636 637 }
637 638
638 639 &:before { content: none; }
639 640 }
640 641
641 642 }
642 643 }
643 644
644 645 .main_filter_help_box {
645 646 padding: 7px 7px;
646 647 border-top: 1px solid @grey4;
647 648 border-right: 1px solid @grey4;
648 649 border-bottom: 1px solid @grey4;
649 650 display: inline-block;
650 651 vertical-align: top;
651 652 margin-left: -5px;
652 653 background: @grey3;
653 654 }
654 655
655 656 .main_filter_input_box {
656 657 display: inline-block;
657 658 }
658 659
659 660 .main_filter_box {
660 661 margin: 9px 0 0 0;
661 662 }
662 663
663 664 #main_filter_help {
664 665 background: @grey3;
665 666 border: 1px solid black;
666 667 position: absolute;
667 668 white-space: pre-wrap;
668 669 z-index: 9999;
669 670 color: @nav-grey;
670 671 margin: 1px 7px;
671 672 padding: 0 2px;
672 673 }
673 674
674 675 .main_filter_input {
675 676 padding: 6px;
676 677 min-width: 220px;
677 678 color: @nav-grey;
678 679 background: @grey3;
679 680 }
680 681
681 682 .main_filter_input::placeholder {
682 683 color: @nav-grey;
683 684 opacity: 1;
684 685 }
685 686
686 687 .notice-box {
687 688 display:block !important;
688 689 padding: 9px 0 !important;
689 690 }
690 691
691 692 .menulabel-notice {
692 693 border: 1px solid @color5;
693 694 padding:7px 10px;
694 695 color: @color5;
695 696 }
@@ -1,189 +1,218 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Repository Group Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th class="td-owner">${_('User/User Group')}</th>
16 <th></th>
17 <th></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.repo_group.permissions():
21 21 ## super admin/owner row
22 22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 23 <tr class="perm_admin_row">
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 28 <td class="td-user">
29 29 ${base.gravatar(_user.email, 16)}
30 30 ${h.link_to_user(_user.username)}
31 31 %if getattr(_user, 'admin_row', None):
32 32 (${_('super admin')})
33 33 %endif
34 34 %if getattr(_user, 'owner_row', None):
35 35 (${_('owner')})
36 36 %endif
37 37 </td>
38 38 <td></td>
39 <td>
39 <td class="quick_repo_menu">
40 40 % if c.rhodecode_user.is_admin:
41 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
41 <i class="icon-more"></i>
42 <div class="menu_items_container" style="display: none;">
43 <ul class="menu_items">
44 <li>
45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
46 </li>
47 </ul>
48 </div>
42 49 % endif
43 50 </td>
44 51 </tr>
45 52 %else:
46 53 <tr>
47 54 ##forbid revoking permission from yourself, except if you're an super admin
48 55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
49 56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
50 57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
51 58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
52 59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
53 60 <td class="td-user">
54 61 ${base.gravatar(_user.email, 16)}
55 62 <span class="user">
56 63 % if _user.username == h.DEFAULT_USER:
57 64 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
58 65 % else:
59 66 ${h.link_to_user(_user.username)}
60 67 %if getattr(_user, 'duplicate_perm', None):
61 68 (${_('inactive duplicate')})
62 69 %endif
63 70 % endif
64 71 </span>
65 72 </td>
66 73 <td class="td-action">
67 74 %if _user.username != h.DEFAULT_USER:
68 75 <span class="btn btn-link btn-danger revoke_perm"
69 76 member="${_user.user_id}" member_type="user">
70 ${_('Revoke')}
77 ${_('Remove')}
71 78 </span>
72 79 %endif
73 80 </td>
74 <td>
81 <td class="quick_repo_menu">
75 82 % if c.rhodecode_user.is_admin:
76 % if _user.username == h.DEFAULT_USER:
77 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
78 % else:
79 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
80 % endif
83 <i class="icon-more"></i>
84 <div class="menu_items_container" style="display: none;">
85 <ul class="menu_items">
86 <li>
87 % if _user.username == h.DEFAULT_USER:
88 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
89 % else:
90 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
91 % endif
92 </li>
93 </ul>
94 </div>
81 95 % endif
82 96 </td>
83 97 %else:
84 98 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
85 99 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
86 100 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
87 101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
88 102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
89 103 <td class="td-user">
90 104 ${base.gravatar(_user.email, 16)}
91 105 <span class="user">
92 106 % if _user.username == h.DEFAULT_USER:
93 107 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
94 108 % else:
95 109 ${h.link_to_user(_user.username)}
96 110 %if getattr(_user, 'duplicate_perm', None):
97 111 (${_('inactive duplicate')})
98 112 %endif
99 113 % endif
100 114 <span class="user-perm-help-text">(${_('delegated admin')})</span>
101 115 </span>
102 116 </td>
103 117 <td></td>
104 <td>
118 <td class="quick_repo_menu">
105 119 % if c.rhodecode_user.is_admin:
106 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
120 <i class="icon-more"></i>
121 <div class="menu_items_container" style="display: none;">
122 <ul class="menu_items">
123 <li>
124 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
125 </li>
126 </ul>
127 </div>
107 128 % endif
108 129 </td>
109 130 %endif
110 131 </tr>
111 132 %endif
112 133 %endfor
113 134
114 135 ## USER GROUPS
115 136 %for _user_group in c.repo_group.permission_user_groups():
116 137 <tr id="id${id(_user_group.users_group_name)}">
117 138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
118 139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
119 140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
120 141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
121 142 <td class="td-componentname">
122 143 <i class="icon-user-group"></i>
123 144 %if h.HasPermissionAny('hg.admin')():
124 145 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
125 146 ${_user_group.users_group_name}
126 147 </a>
127 148 %else:
128 149 ${h.link_to_group(_user_group.users_group_name)}
129 150 %endif
130 151 </td>
131 152 <td class="td-action">
132 153 <span class="btn btn-link btn-danger revoke_perm"
133 154 member="${_user_group.users_group_id}" member_type="user_group">
134 ${_('Revoke')}
155 ${_('Remove')}
135 156 </span>
136 157 </td>
137 <td>
158 <td class="quick_repo_menu">
138 159 % if c.rhodecode_user.is_admin:
139 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
160 <i class="icon-more"></i>
161 <div class="menu_items_container" style="display: none;">
162 <ul class="menu_items">
163 <li>
164 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-groups-permissions'))}
165 </li>
166 </ul>
167 </div>
140 168 % endif
141 169 </td>
142 170 </tr>
143 171 %endfor
144 172
145 173 <tr class="new_members" id="add_perm_input"></tr>
146 174 <tr>
147 175 <td></td>
148 176 <td></td>
149 177 <td></td>
150 178 <td></td>
151 179 <td></td>
152 180 <td>
153 181 <span id="add_perm" class="link">
154 182 ${_('Add user/user group')}
155 183 </span>
156 184 </td>
157 185 <td></td>
158 186 </tr>
159 187 </table>
160 188
161 189 <div class="fields">
162 190 <div class="field">
163 191 <div class="label label-radio">
164 192 ${_('Apply to children')}:
165 193 </div>
166 194 <div class="radios">
167 195 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
168 196 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
169 197 ${h.radio('recursive', 'repos', label=_('Repositories'))}
170 198 ${h.radio('recursive', 'all', label=_('Both'))}
171 199 <span class="help-block">${_('Set or revoke permissions to selected types of children of this group, including non-private repositories and other groups if chosen.')}</span>
172 200 </div>
173 201 </div>
174 202 </div>
175 203 <div class="buttons">
176 204 ${h.submit('save',_('Save'),class_="btn btn-primary")}
177 205 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
178 206 </div>
179 207 ${h.end_form()}
180 208 </div>
181 209 </div>
182 210 <script type="text/javascript">
183 211 $('#add_perm').on('click', function(e){
184 212 addNewPermInput($(this), 'group');
185 213 });
186 214 $('.revoke_perm').on('click', function(e){
187 215 markRevokePermInput($(this), 'group');
188 })
216 });
217 quick_repo_menu();
189 218 </script>
@@ -1,172 +1,201 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('Repository Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th class="td-owner">${_('User/User Group')}</th>
16 <th></th>
17 <th></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.rhodecode_db_repo.permissions():
21 21 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
22 22 <tr class="perm_admin_row">
23 23 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
27 27 <td class="td-user">
28 28 ${base.gravatar(_user.email, 16)}
29 29 ${h.link_to_user(_user.username)}
30 30 %if getattr(_user, 'admin_row', None):
31 31 (${_('super admin')})
32 32 %endif
33 33 %if getattr(_user, 'owner_row', None):
34 34 (${_('owner')})
35 35 %endif
36 36 </td>
37 37 <td></td>
38 <td>
38 <td class="quick_repo_menu">
39 39 % if c.rhodecode_user.is_admin:
40 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
40 <i class="icon-more"></i>
41 <div class="menu_items_container" style="display: none;">
42 <ul class="menu_items">
43 <li>
44 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
45 </li>
46 </ul>
47 </div>
41 48 % endif
42 49 </td>
43 50 </tr>
44 51 %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private:
45 52 <tr>
46 53 <td colspan="4">
47 54 <span class="private_repo_msg">
48 55 <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong>
49 56 </span>
50 57 </td>
51 58 <td class="private_repo_msg">
52 59 ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)}
53 60 ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td>
54 61 <td></td>
55 <td>
62 <td class="quick_repo_menu">
56 63 % if c.rhodecode_user.is_admin:
57 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
64 <i class="icon-more"></i>
65 <div class="menu_items_container" style="display: none;">
66 <ul class="menu_items">
67 <li>
68 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
69 </li>
70 </ul>
71 </div>
58 72 % endif
59 73 </td>
60 74 </tr>
61 75 %else:
62 76 <tr>
63 77 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td>
64 78 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td>
65 79 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
66 80 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
67 81 <td class="td-user">
68 82 ${base.gravatar(_user.email, 16)}
69 83 <span class="user">
70 84 % if _user.username == h.DEFAULT_USER:
71 85 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
72 86 % else:
73 87 ${h.link_to_user(_user.username)}
74 88 %if getattr(_user, 'duplicate_perm', None):
75 89 (${_('inactive duplicate')})
76 90 %endif
77 91 %if getattr(_user, 'branch_rules', None):
78 92 <% used_by_n_rules = len(_user.branch_rules) %>
79 93 % if used_by_n_rules == 1:
80 94 (${_('used by {} branch rule').format(used_by_n_rules)})
81 95 % else:
82 96 (${_('used by {} branch rules').format(used_by_n_rules)})
83 97 % endif
84 98 %endif
85 99 % endif
86 100 </span>
87 101 </td>
88 102 <td class="td-action">
89 103 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
90 104 <span class="btn btn-link btn-danger revoke_perm"
91 105 member="${_user.user_id}" member_type="user">
92 ${_('Revoke')}
106 ${_('Remove')}
93 107 </span>
94 108 %endif
95 109 </td>
96 <td>
110 <td class="quick_repo_menu">
97 111 % if c.rhodecode_user.is_admin:
98 % if _user.username == h.DEFAULT_USER:
99 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
100 % else:
101 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
102 % endif
112 <i class="icon-more"></i>
113 <div class="menu_items_container" style="display: none;">
114 <ul class="menu_items">
115 <li>
116 % if _user.username == h.DEFAULT_USER:
117 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
118 % else:
119 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
120 % endif
121 </li>
122 </ul>
123 </div>
103 124 % endif
104 125 </td>
105 126 </tr>
106 127 %endif
107 128 %endfor
108 129
109 130 ## USER GROUPS
110 131 %for _user_group in c.rhodecode_db_repo.permission_user_groups():
111 132 <tr>
112 133 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
113 134 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
114 135 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td>
115 136 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td>
116 137 <td class="td-componentname">
117 138 <i class="icon-user-group"></i>
118 139 %if h.HasPermissionAny('hg.admin')():
119 140 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
120 141 ${_user_group.users_group_name}
121 142 </a>
122 143 %else:
123 144 ${h.link_to_group(_user_group.users_group_name)}
124 145 %endif
125 146 </td>
126 147 <td class="td-action">
127 148 <span class="btn btn-link btn-danger revoke_perm"
128 149 member="${_user_group.users_group_id}" member_type="user_group">
129 ${_('Revoke')}
150 ${_('Remove')}
130 151 </span>
131 152 </td>
132 <td>
153 <td class="quick_repo_menu">
133 154 % if c.rhodecode_user.is_admin:
134 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
155 <i class="icon-more"></i>
156 <div class="menu_items_container" style="display: none;">
157 <ul class="menu_items">
158 <li>
159 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
160 </li>
161 </ul>
162 </div>
135 163 % endif
136 164 </td>
137 165 </tr>
138 166 %endfor
139 167 <tr class="new_members" id="add_perm_input"></tr>
140 168
141 169 <tr>
142 170 <td></td>
143 171 <td></td>
144 172 <td></td>
145 173 <td></td>
146 174 <td></td>
147 175 <td>
148 176 <span id="add_perm" class="link">
149 177 ${_('Add user/user group')}
150 178 </span>
151 179 </td>
152 180 <td></td>
153 181 </tr>
154 182
155 183 </table>
156 184
157 185 <div class="buttons">
158 186 ${h.submit('save',_('Save'),class_="btn btn-primary")}
159 187 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
160 188 </div>
161 189 ${h.end_form()}
162 190 </div>
163 191 </div>
164 192
165 193 <script type="text/javascript">
166 194 $('#add_perm').on('click', function(e){
167 195 addNewPermInput($(this), 'repository');
168 196 });
169 197 $('.revoke_perm').on('click', function(e){
170 198 markRevokePermInput($(this), 'repository');
171 199 });
200 quick_repo_menu();
172 201 </script>
@@ -1,177 +1,206 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <div class="panel panel-default">
4 4 <div class="panel-heading">
5 5 <h3 class="panel-title">${_('User Group Permissions')}</h3>
6 6 </div>
7 7 <div class="panel-body">
8 8 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), request=request)}
9 9 <table id="permissions_manage" class="rctable permissions">
10 10 <tr>
11 11 <th class="td-radio">${_('None')}</th>
12 12 <th class="td-radio">${_('Read')}</th>
13 13 <th class="td-radio">${_('Write')}</th>
14 14 <th class="td-radio">${_('Admin')}</th>
15 15 <th>${_('User/User Group')}</th>
16 <th></th>
17 <th></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
18 18 </tr>
19 19 ## USERS
20 20 %for _user in c.user_group.permissions():
21 21 ## super admin/owner row
22 22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 23 <tr class="perm_admin_row">
24 24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 28 <td class="td-user">
29 29 ${base.gravatar(_user.email, 16)}
30 30 <span class="user">
31 31 ${h.link_to_user(_user.username)}
32 32 %if getattr(_user, 'admin_row', None):
33 33 (${_('super admin')})
34 34 %endif
35 35 %if getattr(_user, 'owner_row', None):
36 36 (${_('owner')})
37 37 %endif
38 38 </span>
39 39 </td>
40 40 <td></td>
41 <td>
41 <td class="quick_repo_menu">
42 42 % if c.rhodecode_user.is_admin:
43 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
43 <i class="icon-more"></i>
44 <div class="menu_items_container" style="display: none;">
45 <ul class="menu_items">
46 <li>
47 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
48 </li>
49 </ul>
50 </div>
44 51 % endif
45 52 </td>
46 53 </tr>
47 54 %else:
48 55 ##forbid revoking permission from yourself, except if you're an super admin
49 56 <tr>
50 57 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
51 58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
52 59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
53 60 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
54 61 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
55 62 <td class="td-user">
56 63 ${base.gravatar(_user.email, 16)}
57 64 <span class="user">
58 65 % if _user.username == h.DEFAULT_USER:
59 66 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
60 67 % else:
61 68 ${h.link_to_user(_user.username)}
62 69 %if getattr(_user, 'duplicate_perm', None):
63 70 (${_('inactive duplicate')})
64 71 %endif
65 72 % endif
66 73 </span>
67 74 </td>
68 75 <td class="td-action">
69 76 %if _user.username != h.DEFAULT_USER:
70 77 <span class="btn btn-link btn-danger revoke_perm"
71 78 member="${_user.user_id}" member_type="user">
72 ${_('Revoke')}
79 ${_('Remove')}
73 80 </span>
74 81 %endif
75 82 </td>
76 <td>
83 <td class="quick_repo_menu">
77 84 % if c.rhodecode_user.is_admin:
78 % if _user.username == h.DEFAULT_USER:
79 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
80 % else:
81 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
82 % endif
85 <i class="icon-more"></i>
86 <div class="menu_items_container" style="display: none;">
87 <ul class="menu_items">
88 <li>
89 % if _user.username == h.DEFAULT_USER:
90 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
91 % else:
92 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
93 % endif
94 </li>
95 </ul>
96 </div>
83 97 % endif
84 98 </td>
85 99 %else:
86 100 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
87 101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
88 102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
89 103 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
90 104 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
91 105 <td class="td-user">
92 106 ${base.gravatar(_user.email, 16)}
93 107 <span class="user">
94 108 % if _user.username == h.DEFAULT_USER:
95 109 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
96 110 % else:
97 111 ${h.link_to_user(_user.username)}
98 112 %if getattr(_user, 'duplicate_perm', None):
99 113 (${_('inactive duplicate')})
100 114 %endif
101 115 % endif
102 116 <span class="user-perm-help-text">(${_('delegated admin')})</span>
103 117 </span>
104 118 </td>
105 119 <td></td>
106 <td>
120 <td class="quick_repo_menu">
107 121 % if c.rhodecode_user.is_admin:
108 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
122 <i class="icon-more"></i>
123 <div class="menu_items_container" style="display: none;">
124 <ul class="menu_items">
125 <li>
126 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
127 </li>
128 </ul>
129 </div>
109 130 % endif
110 131 </td>
111 132 %endif
112 133 </tr>
113 134 %endif
114 135 %endfor
115 136
116 137 ## USER GROUPS
117 138 %for _user_group in c.user_group.permission_user_groups():
118 139 <tr>
119 140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
120 141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
121 142 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
122 143 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
123 144 <td class="td-user">
124 145 <i class="icon-user-group"></i>
125 146 %if h.HasPermissionAny('hg.admin')():
126 147 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
127 148 ${_user_group.users_group_name}
128 149 </a>
129 150 %else:
130 151 ${h.link_to_group(_user_group.users_group_name)}
131 152 %endif
132 153 </td>
133 154 <td class="td-action">
134 155 <span class="btn btn-link btn-danger revoke_perm"
135 156 member="${_user_group.users_group_id}" member_type="user_group">
136 ${_('Revoke')}
157 ${_('Remove')}
137 158 </span>
138 159 </td>
139 <td>
160 <td class="quick_repo_menu">
140 161 % if c.rhodecode_user.is_admin:
141 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
162 <i class="icon-more"></i>
163 <div class="menu_items_container" style="display: none;">
164 <ul class="menu_items">
165 <li>
166 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='user-groups-permissions'))}
167 </li>
168 </ul>
169 </div>
142 170 % endif
143 171 </td>
144 172 </tr>
145 173 %endfor
146 174 <tr class="new_members" id="add_perm_input"></tr>
147 175 <tr>
148 176 <td></td>
149 177 <td></td>
150 178 <td></td>
151 179 <td></td>
152 180 <td></td>
153 181 <td>
154 182 <span id="add_perm" class="link">
155 183 ${_('Add user/user group')}
156 184 </span>
157 185 </td>
158 186 <td></td>
159 187 </tr>
160 188 </table>
161 189
162 190 <div class="buttons">
163 191 ${h.submit('save',_('Save'),class_="btn btn-primary")}
164 192 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
165 193 </div>
166 194 ${h.end_form()}
167 195 </div>
168 196 </div>
169 197
170 198 <script type="text/javascript">
171 199 $('#add_perm').on('click', function(e){
172 200 addNewPermInput($(this), 'usergroup');
173 201 });
174 202 $('.revoke_perm').on('click', function(e){
175 203 markRevokePermInput($(this), 'usergroup');
176 204 });
205 quick_repo_menu()
177 206 </script>
General Comments 0
You need to be logged in to leave comments. Login now