##// END OF EJS Templates
permissions: explain better what is inactive duplicate in permissions, sort them to last positions, and make them less visible.
dan -
r4417:524f9e6a default
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,560 +1,566 b''
1
1
2 // tables.less
2 // tables.less
3 // For use in RhodeCode application tables;
3 // For use in RhodeCode application tables;
4 // see style guide documentation for guidelines.
4 // see style guide documentation for guidelines.
5
5
6 // TABLES
6 // TABLES
7
7
8 .rctable,
8 .rctable,
9 table.rctable,
9 table.rctable,
10 table.dataTable {
10 table.dataTable {
11 clear:both;
11 clear:both;
12 width: 100%;
12 width: 100%;
13 margin: 0 auto @padding;
13 margin: 0 auto @padding;
14 padding: 0;
14 padding: 0;
15 vertical-align: baseline;
15 vertical-align: baseline;
16 line-height:1.5em;
16 line-height:1.5em;
17 border: none;
17 border: none;
18 outline: none;
18 outline: none;
19 border-collapse: collapse;
19 border-collapse: collapse;
20 border-spacing: 0;
20 border-spacing: 0;
21 color: @grey2;
21 color: @grey2;
22
22
23 b {
23 b {
24 font-weight: normal;
24 font-weight: normal;
25 }
25 }
26
26
27 em {
27 em {
28 font-weight: bold;
28 font-weight: bold;
29 font-style: normal;
29 font-style: normal;
30 }
30 }
31
31
32 .td-user {
32 .td-user {
33 .rc-user {
33 .rc-user {
34 white-space: nowrap;
34 white-space: nowrap;
35 }
35 }
36 .user-perm-duplicate {
37 color: @grey4;
38 a {
39 color: @grey4;
40 }
41 }
36 }
42 }
37
43
38 .td-email {
44 .td-email {
39 white-space: nowrap;
45 white-space: nowrap;
40 }
46 }
41
47
42 th,
48 th,
43 td {
49 td {
44 height: auto;
50 height: auto;
45 max-width: 20%;
51 max-width: 20%;
46 padding: .65em 0 .65em 1em;
52 padding: .65em 0 .65em 1em;
47 vertical-align: middle;
53 vertical-align: middle;
48 border-bottom: @border-thickness solid @grey5;
54 border-bottom: @border-thickness solid @grey5;
49 white-space: normal;
55 white-space: normal;
50
56
51 &.td-radio,
57 &.td-radio,
52 &.td-checkbox {
58 &.td-checkbox {
53 padding-right: 0;
59 padding-right: 0;
54 text-align: center;
60 text-align: center;
55
61
56 input {
62 input {
57 margin: 0 1em;
63 margin: 0 1em;
58 }
64 }
59 }
65 }
60
66
61 &.truncate-wrap {
67 &.truncate-wrap {
62 white-space: nowrap !important;
68 white-space: nowrap !important;
63 }
69 }
64
70
65 pre {
71 pre {
66 margin: 0;
72 margin: 0;
67 }
73 }
68
74
69 .show_more {
75 .show_more {
70 height: inherit;
76 height: inherit;
71 }
77 }
72 }
78 }
73
79
74 .expired td {
80 .expired td {
75 background-color: @grey7;
81 background-color: @grey7;
76 }
82 }
77 .inactive td {
83 .inactive td {
78 background-color: @grey6;
84 background-color: @grey6;
79 }
85 }
80 th {
86 th {
81 text-align: left;
87 text-align: left;
82 font-weight: @text-semibold-weight;
88 font-weight: @text-semibold-weight;
83 font-family: @text-semibold;
89 font-family: @text-semibold;
84 }
90 }
85
91
86 .hl {
92 .hl {
87 td {
93 td {
88 background-color: lighten(@alert4,25%);
94 background-color: lighten(@alert4,25%);
89 }
95 }
90 }
96 }
91
97
92 // Special Data Cell Types
98 // Special Data Cell Types
93 // See style guide for desciptions and examples.
99 // See style guide for desciptions and examples.
94
100
95 td {
101 td {
96
102
97 &.user {
103 &.user {
98 padding-left: 1em;
104 padding-left: 1em;
99 }
105 }
100
106
101 &.td-rss {
107 &.td-rss {
102 width: 20px;
108 width: 20px;
103 min-width: 0;
109 min-width: 0;
104 margin: 0;
110 margin: 0;
105 }
111 }
106
112
107 &.quick_repo_menu {
113 &.quick_repo_menu {
108 width: 15px;
114 width: 15px;
109 text-align: center;
115 text-align: center;
110
116
111 &:hover {
117 &:hover {
112 background-color: @grey5;
118 background-color: @grey5;
113 }
119 }
114 }
120 }
115
121
116 &.td-icon {
122 &.td-icon {
117 min-width: 20px;
123 min-width: 20px;
118 width: 20px;
124 width: 20px;
119 }
125 }
120
126
121 &.td-hash {
127 &.td-hash {
122 min-width: 80px;
128 min-width: 80px;
123 width: 200px;
129 width: 200px;
124
130
125 .obsolete {
131 .obsolete {
126 text-decoration: line-through;
132 text-decoration: line-through;
127 color: lighten(@grey2,25%);
133 color: lighten(@grey2,25%);
128 }
134 }
129 }
135 }
130
136
131 &.td-sha {
137 &.td-sha {
132 white-space: nowrap;
138 white-space: nowrap;
133 }
139 }
134
140
135 &.td-graphbox {
141 &.td-graphbox {
136 width: 100px;
142 width: 100px;
137 max-width: 100px;
143 max-width: 100px;
138 min-width: 100px;
144 min-width: 100px;
139 }
145 }
140
146
141 &.td-time {
147 &.td-time {
142 width: 160px;
148 width: 160px;
143 white-space: nowrap;
149 white-space: nowrap;
144 }
150 }
145
151
146 &.annotate{
152 &.annotate{
147 padding-right: 0;
153 padding-right: 0;
148
154
149 div.annotatediv{
155 div.annotatediv{
150 margin: 0 0.7em;
156 margin: 0 0.7em;
151 }
157 }
152 }
158 }
153
159
154 &.tags-col {
160 &.tags-col {
155 padding-right: 0;
161 padding-right: 0;
156 }
162 }
157
163
158 &.td-description {
164 &.td-description {
159 min-width: 350px;
165 min-width: 350px;
160
166
161 &.truncate, .truncate-wrap {
167 &.truncate, .truncate-wrap {
162 white-space: nowrap;
168 white-space: nowrap;
163 overflow: hidden;
169 overflow: hidden;
164 text-overflow: ellipsis;
170 text-overflow: ellipsis;
165 max-width: 350px;
171 max-width: 350px;
166 }
172 }
167 }
173 }
168
174
169 &.td-grid-name {
175 &.td-grid-name {
170 white-space: nowrap;
176 white-space: nowrap;
171 min-width: 300px;
177 min-width: 300px;
172 }
178 }
173
179
174 &.td-componentname {
180 &.td-componentname {
175 white-space: nowrap;
181 white-space: nowrap;
176 }
182 }
177
183
178 &.td-name {
184 &.td-name {
179
185
180 }
186 }
181
187
182 &.td-journalaction {
188 &.td-journalaction {
183 min-width: 300px;
189 min-width: 300px;
184
190
185 .journal_action_params {
191 .journal_action_params {
186 // waiting for feedback
192 // waiting for feedback
187 }
193 }
188 }
194 }
189
195
190 &.td-active {
196 &.td-active {
191 padding-left: .65em;
197 padding-left: .65em;
192 }
198 }
193
199
194 &.td-issue-tracker-name {
200 &.td-issue-tracker-name {
195 width: 180px;
201 width: 180px;
196 input {
202 input {
197 width: 180px;
203 width: 180px;
198 }
204 }
199
205
200 }
206 }
201
207
202 &.td-issue-tracker-regex {
208 &.td-issue-tracker-regex {
203 white-space: nowrap;
209 white-space: nowrap;
204
210
205 min-width: 300px;
211 min-width: 300px;
206 input {
212 input {
207 min-width: 300px;
213 min-width: 300px;
208 }
214 }
209
215
210 }
216 }
211
217
212 &.td-url {
218 &.td-url {
213 white-space: nowrap;
219 white-space: nowrap;
214 }
220 }
215
221
216 &.td-comments {
222 &.td-comments {
217 min-width: 3em;
223 min-width: 3em;
218 }
224 }
219
225
220 &.td-buttons {
226 &.td-buttons {
221 padding: .3em 0;
227 padding: .3em 0;
222 }
228 }
223 &.td-align-top {
229 &.td-align-top {
224 vertical-align: text-top
230 vertical-align: text-top
225 }
231 }
226 &.td-action {
232 &.td-action {
227 // this is for the remove/delete/edit buttons
233 // this is for the remove/delete/edit buttons
228 padding-right: 0;
234 padding-right: 0;
229 min-width: 95px;
235 min-width: 95px;
230 text-transform: capitalize;
236 text-transform: capitalize;
231
237
232 i {
238 i {
233 display: none;
239 display: none;
234 }
240 }
235 }
241 }
236
242
237 // TODO: lisa: this needs to be cleaned up with the buttons
243 // TODO: lisa: this needs to be cleaned up with the buttons
238 .grid_edit,
244 .grid_edit,
239 .grid_delete {
245 .grid_delete {
240 display: inline-block;
246 display: inline-block;
241 margin: 0 @padding/3 0 0;
247 margin: 0 @padding/3 0 0;
242 font-family: @text-light;
248 font-family: @text-light;
243
249
244 i {
250 i {
245 display: none;
251 display: none;
246 }
252 }
247 }
253 }
248
254
249 .grid_edit + .grid_delete {
255 .grid_edit + .grid_delete {
250 border-left: @border-thickness solid @grey5;
256 border-left: @border-thickness solid @grey5;
251 padding-left: @padding/2;
257 padding-left: @padding/2;
252 }
258 }
253
259
254 &.td-compare {
260 &.td-compare {
255
261
256 input {
262 input {
257 margin-right: 1em;
263 margin-right: 1em;
258 }
264 }
259
265
260 .compare-radio-button {
266 .compare-radio-button {
261 margin: 0 1em 0 0;
267 margin: 0 1em 0 0;
262 }
268 }
263
269
264
270
265 }
271 }
266
272
267 &.td-tags {
273 &.td-tags {
268 padding: .5em 1em .5em 0;
274 padding: .5em 1em .5em 0;
269 width: 140px;
275 width: 140px;
270
276
271 .tag {
277 .tag {
272 margin: 1px;
278 margin: 1px;
273 float: left;
279 float: left;
274 }
280 }
275 }
281 }
276
282
277 .icon-svn, .icon-hg, .icon-git {
283 .icon-svn, .icon-hg, .icon-git {
278 font-size: 1.4em;
284 font-size: 1.4em;
279 }
285 }
280
286
281 &.collapse_commit,
287 &.collapse_commit,
282 &.expand_commit {
288 &.expand_commit {
283 padding-right: 0;
289 padding-right: 0;
284 padding-left: 1em;
290 padding-left: 1em;
285 cursor: pointer;
291 cursor: pointer;
286 width: 20px;
292 width: 20px;
287 }
293 }
288 }
294 }
289
295
290 .perm_admin_row {
296 .perm_admin_row {
291 color: @grey4;
297 color: @grey4;
292 background-color: @grey6;
298 background-color: @grey6;
293 }
299 }
294
300
295 .noborder {
301 .noborder {
296 border: none;
302 border: none;
297
303
298 td {
304 td {
299 border: none;
305 border: none;
300 }
306 }
301 }
307 }
302 }
308 }
303 .rctable.audit-log {
309 .rctable.audit-log {
304 td {
310 td {
305 vertical-align: top;
311 vertical-align: top;
306 }
312 }
307 }
313 }
308
314
309 // TRUNCATING
315 // TRUNCATING
310 // TODO: lisaq: should this possibly be moved out of tables.less?
316 // TODO: lisaq: should this possibly be moved out of tables.less?
311 // for truncated text
317 // for truncated text
312 // used inside of table cells and in code block headers
318 // used inside of table cells and in code block headers
313 .truncate-wrap {
319 .truncate-wrap {
314 white-space: nowrap !important;
320 white-space: nowrap !important;
315
321
316 //truncated text
322 //truncated text
317 .truncate {
323 .truncate {
318 max-width: 450px;
324 max-width: 450px;
319 width: 300px;
325 width: 300px;
320 overflow: hidden;
326 overflow: hidden;
321 text-overflow: ellipsis;
327 text-overflow: ellipsis;
322 -o-text-overflow: ellipsis;
328 -o-text-overflow: ellipsis;
323 -ms-text-overflow: ellipsis;
329 -ms-text-overflow: ellipsis;
324
330
325 &.autoexpand {
331 &.autoexpand {
326 width: 120px;
332 width: 120px;
327 margin-right: 200px;
333 margin-right: 200px;
328 }
334 }
329 }
335 }
330 &:hover .truncate.autoexpand {
336 &:hover .truncate.autoexpand {
331 overflow: visible;
337 overflow: visible;
332 }
338 }
333
339
334 .tags-truncate {
340 .tags-truncate {
335 width: 150px;
341 width: 150px;
336 height: 22px;
342 height: 22px;
337 overflow: hidden;
343 overflow: hidden;
338
344
339 .tag {
345 .tag {
340 display: inline-block;
346 display: inline-block;
341 }
347 }
342
348
343 &.truncate {
349 &.truncate {
344 height: 22px;
350 height: 22px;
345 max-height:2em;
351 max-height:2em;
346 width: 140px;
352 width: 140px;
347 }
353 }
348 }
354 }
349 }
355 }
350
356
351 .apikeys_wrap {
357 .apikeys_wrap {
352 margin-bottom: @padding;
358 margin-bottom: @padding;
353
359
354 table.rctable td:first-child {
360 table.rctable td:first-child {
355 width: 120px;
361 width: 120px;
356 }
362 }
357 }
363 }
358
364
359
365
360
366
361 // SPECIAL CASES
367 // SPECIAL CASES
362
368
363 // Repository Followers
369 // Repository Followers
364 table.rctable.followers_data {
370 table.rctable.followers_data {
365 width: 75%;
371 width: 75%;
366 margin: 0;
372 margin: 0;
367 }
373 }
368
374
369 // Repository List
375 // Repository List
370 // Group Members List
376 // Group Members List
371 table.rctable.group_members,
377 table.rctable.group_members,
372 table#repo_list_table {
378 table#repo_list_table {
373 min-width: 600px;
379 min-width: 600px;
374 }
380 }
375
381
376 #no_grid_data {
382 #no_grid_data {
377 text-align: center;
383 text-align: center;
378 }
384 }
379
385
380 #grid_data_loading {
386 #grid_data_loading {
381 text-align: center;
387 text-align: center;
382 font-weight: 600;
388 font-weight: 600;
383 font-size: 16px;
389 font-size: 16px;
384 padding: 80px 20px;
390 padding: 80px 20px;
385 }
391 }
386
392
387 // Keyboard mappings
393 // Keyboard mappings
388 table.keyboard-mappings {
394 table.keyboard-mappings {
389 th {
395 th {
390 text-align: left;
396 text-align: left;
391 font-weight: @text-semibold-weight;
397 font-weight: @text-semibold-weight;
392 font-family: @text-semibold;
398 font-family: @text-semibold;
393 }
399 }
394 }
400 }
395
401
396 // Branches, Tags, and Bookmarks
402 // Branches, Tags, and Bookmarks
397 #obj_list_table.dataTable {
403 #obj_list_table.dataTable {
398 td.td-time {
404 td.td-time {
399 padding-right: 1em;
405 padding-right: 1em;
400 }
406 }
401 }
407 }
402
408
403 // User Admin
409 // User Admin
404 .rctable.useremails,
410 .rctable.useremails,
405 .rctable.account_emails {
411 .rctable.account_emails {
406 .tag,
412 .tag,
407 .btn {
413 .btn {
408 float: right;
414 float: right;
409 }
415 }
410 .btn { //to line up with tags
416 .btn { //to line up with tags
411 margin-right: 1.65em;
417 margin-right: 1.65em;
412 }
418 }
413 }
419 }
414
420
415 // User List
421 // User List
416 #user_list_table {
422 #user_list_table {
417
423
418 td.td-user {
424 td.td-user {
419 min-width: 100px;
425 min-width: 100px;
420 }
426 }
421 }
427 }
422
428
423 // Pull Request List Table
429 // Pull Request List Table
424 #pull_request_list_table.dataTable {
430 #pull_request_list_table.dataTable {
425
431
426 //TODO: lisa: This needs to be removed once the description is adjusted
432 //TODO: lisa: This needs to be removed once the description is adjusted
427 // for using an expand_commit button (see issue 765)
433 // for using an expand_commit button (see issue 765)
428 td {
434 td {
429 vertical-align: middle;
435 vertical-align: middle;
430 }
436 }
431 }
437 }
432
438
433 // Settings (no border)
439 // Settings (no border)
434 table.rctable.dl-settings {
440 table.rctable.dl-settings {
435 td {
441 td {
436 border: none;
442 border: none;
437 vertical-align: baseline;
443 vertical-align: baseline;
438 }
444 }
439 }
445 }
440
446
441
447
442 // Statistics
448 // Statistics
443 table.trending_language_tbl {
449 table.trending_language_tbl {
444 width: 100%;
450 width: 100%;
445 line-height: 1em;
451 line-height: 1em;
446
452
447 td div {
453 td div {
448 overflow: visible;
454 overflow: visible;
449 }
455 }
450 }
456 }
451
457
452 .trending_language_tbl, .trending_language_tbl td {
458 .trending_language_tbl, .trending_language_tbl td {
453 border: 0;
459 border: 0;
454 margin: 0;
460 margin: 0;
455 padding: 0;
461 padding: 0;
456 background: transparent;
462 background: transparent;
457 }
463 }
458
464
459 .trending_language_tbl, .trending_language_tbl tr {
465 .trending_language_tbl, .trending_language_tbl tr {
460 border-spacing: 0 3px;
466 border-spacing: 0 3px;
461 }
467 }
462
468
463 .trending_language {
469 .trending_language {
464 position: relative;
470 position: relative;
465 overflow: hidden;
471 overflow: hidden;
466 color: @text-color;
472 color: @text-color;
467 width: 400px;
473 width: 400px;
468
474
469 .lang-bar {
475 .lang-bar {
470 z-index: 1;
476 z-index: 1;
471 overflow: hidden;
477 overflow: hidden;
472 background-color: @rcblue;
478 background-color: @rcblue;
473 color: #FFF;
479 color: #FFF;
474 text-decoration: none;
480 text-decoration: none;
475 }
481 }
476
482
477 }
483 }
478
484
479 // Changesets
485 // Changesets
480 #changesets.rctable {
486 #changesets.rctable {
481 th {
487 th {
482 padding: 0 1em 0.65em 0;
488 padding: 0 1em 0.65em 0;
483 }
489 }
484
490
485 // td must be fixed height for graph
491 // td must be fixed height for graph
486 td {
492 td {
487 height: 32px;
493 height: 32px;
488 padding: 0 1em 0 0;
494 padding: 0 1em 0 0;
489 vertical-align: middle;
495 vertical-align: middle;
490 white-space: nowrap;
496 white-space: nowrap;
491
497
492 &.td-description {
498 &.td-description {
493 white-space: normal;
499 white-space: normal;
494 }
500 }
495
501
496 &.expand_commit {
502 &.expand_commit {
497 padding-right: 0;
503 padding-right: 0;
498 cursor: pointer;
504 cursor: pointer;
499 width: 20px;
505 width: 20px;
500 }
506 }
501 }
507 }
502 }
508 }
503
509
504 // Compare
510 // Compare
505 table.compare_view_commits {
511 table.compare_view_commits {
506 margin-top: @space;
512 margin-top: @space;
507
513
508 td.td-time {
514 td.td-time {
509 padding-left: .5em;
515 padding-left: .5em;
510 }
516 }
511
517
512 // special case to not show hover actions on hidden indicator
518 // special case to not show hover actions on hidden indicator
513 tr.compare_select_hidden:hover {
519 tr.compare_select_hidden:hover {
514 cursor: inherit;
520 cursor: inherit;
515
521
516 td {
522 td {
517 background-color: inherit;
523 background-color: inherit;
518 }
524 }
519 }
525 }
520
526
521 tr:hover {
527 tr:hover {
522 cursor: pointer;
528 cursor: pointer;
523
529
524 td {
530 td {
525 background-color: lighten(@alert4,25%);
531 background-color: lighten(@alert4,25%);
526 }
532 }
527 }
533 }
528
534
529
535
530 }
536 }
531
537
532 .file_history {
538 .file_history {
533 td.td-actions {
539 td.td-actions {
534 text-align: right;
540 text-align: right;
535 }
541 }
536 }
542 }
537
543
538
544
539 // Gist List
545 // Gist List
540 #gist_list_table {
546 #gist_list_table {
541 td {
547 td {
542 vertical-align: middle;
548 vertical-align: middle;
543
549
544 div{
550 div{
545 display: inline-block;
551 display: inline-block;
546 vertical-align: middle;
552 vertical-align: middle;
547 }
553 }
548
554
549 img{
555 img{
550 vertical-align: middle;
556 vertical-align: middle;
551 }
557 }
552
558
553 &.td-expire {
559 &.td-expire {
554 width: 200px;
560 width: 200px;
555 }
561 }
556 &.td-gist-type {
562 &.td-gist-type {
557 width: 100px;
563 width: 100px;
558 }
564 }
559 }
565 }
560 }
566 }
@@ -1,230 +1,240 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-heading">
4 <div class="panel-heading">
5 <h3 class="panel-title">${_('Repository Group Permissions: {}').format(c.repo_group.name)}</h3>
5 <h3 class="panel-title">${_('Repository Group Permissions: {}').format(c.repo_group.name)}</h3>
6 </div>
6 </div>
7 <div class="panel-body">
7 <div class="panel-body">
8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
8 ${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
9 <table id="permissions_manage" class="rctable permissions">
9 <table id="permissions_manage" class="rctable permissions">
10 <tr>
10 <tr>
11 <th class="td-radio">${_('None')}</th>
11 <th class="td-radio">${_('None')}</th>
12 <th class="td-radio">${_('Read')}</th>
12 <th class="td-radio">${_('Read')}</th>
13 <th class="td-radio">${_('Write')}</th>
13 <th class="td-radio">${_('Write')}</th>
14 <th class="td-radio">${_('Admin')}</th>
14 <th class="td-radio">${_('Admin')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
16 <th class="td-action"></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
17 <th class="td-action"></th>
18 </tr>
18 </tr>
19 ## USERS
19 ## USERS
20 %for _user in c.repo_group.permissions():
20 %for _user in c.repo_group.permissions():
21 ## super admin/owner row
21 ## super admin/owner row
22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
22 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
23 <tr class="perm_admin_row">
23 <tr class="perm_admin_row">
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
27 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
28 <td class="td-user">
28 <td class="td-user">
29 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
29 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
30 ${h.link_to_user(_user.username)}
30 ${h.link_to_user(_user.username)}
31 %if getattr(_user, 'admin_row', None):
31 %if getattr(_user, 'admin_row', None):
32 (${_('super-admin')})
32 (${_('super-admin')})
33 %endif
33 %endif
34 %if getattr(_user, 'owner_row', None):
34 %if getattr(_user, 'owner_row', None):
35 (${_('owner')})
35 (${_('owner')})
36 %endif
36 %endif
37 </td>
37 </td>
38 <td></td>
38 <td></td>
39 <td class="quick_repo_menu">
39 <td class="quick_repo_menu">
40 % if c.rhodecode_user.is_admin:
40 % if c.rhodecode_user.is_admin:
41 <i class="icon-more"></i>
41 <i class="icon-more"></i>
42 <div class="menu_items_container" style="display: none;">
42 <div class="menu_items_container" style="display: none;">
43 <ul class="menu_items">
43 <ul class="menu_items">
44 <li>
44 <li>
45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
45 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
46 </li>
46 </li>
47 </ul>
47 </ul>
48 </div>
48 </div>
49 % endif
49 % endif
50 </td>
50 </td>
51 </tr>
51 </tr>
52 %else:
52 %else:
53 <tr>
53 <tr>
54 ##forbid revoking permission from yourself, except if you're an super admin
54 ##forbid revoking permission from yourself, except if you're an super admin
55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
55 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
56 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
57 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
60 <td class="td-user">
60 <td class="td-user">
61 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
61 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
62 <span class="user">
62 <span class="user">
63 % if _user.username == h.DEFAULT_USER:
63 % if _user.username == h.DEFAULT_USER:
64 ${h.DEFAULT_USER}
64 ${h.DEFAULT_USER}
65 % if _user.active:
65 % if _user.active:
66 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
66 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
67 % else:
67 % else:
68 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
68 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
69 % endif
69 % endif
70 % else:
70 % else:
71 % if getattr(_user, 'duplicate_perm', None):
72 <span class="user-perm-duplicate">
71 ${h.link_to_user(_user.username)}
73 ${h.link_to_user(_user.username)}
72 %if getattr(_user, 'duplicate_perm', None):
74 <span class="tooltip" title="${_('This entry is a duplicate, most probably left-over from previously set permission. This user has a higher permission set, so this entry is inactive. Please revoke this permission manually.')}">(${_('inactive duplicate')})
73 (${_('inactive duplicate')})
75 </span>
76 </span>
77 % else:
78 ${h.link_to_user(_user.username)}
74 %endif
79 % endif
75 % endif
80 % endif
76 </span>
81 </span>
77 </td>
82 </td>
78 <td class="td-action">
83 <td class="td-action">
79 %if _user.username != h.DEFAULT_USER:
84 %if _user.username != h.DEFAULT_USER:
80 <span class="btn btn-link btn-danger revoke_perm"
85 <span class="btn btn-link btn-danger revoke_perm"
81 member="${_user.user_id}" member_type="user">
86 member="${_user.user_id}" member_type="user">
82 ${_('Remove')}
87 ${_('Remove')}
83 </span>
88 </span>
84 %endif
89 %endif
85 </td>
90 </td>
86 <td class="quick_repo_menu">
91 <td class="quick_repo_menu">
87 % if c.rhodecode_user.is_admin:
92 % if c.rhodecode_user.is_admin:
88 <i class="icon-more"></i>
93 <i class="icon-more"></i>
89 <div class="menu_items_container" style="display: none;">
94 <div class="menu_items_container" style="display: none;">
90 <ul class="menu_items">
95 <ul class="menu_items">
91 <li>
96 <li>
92 % if _user.username == h.DEFAULT_USER:
97 % if _user.username == h.DEFAULT_USER:
93 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
98 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
94 % else:
99 % else:
95 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
100 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
96 % endif
101 % endif
97 </li>
102 </li>
98 </ul>
103 </ul>
99 </div>
104 </div>
100 % endif
105 % endif
101 </td>
106 </td>
102 %else:
107 %else:
103 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
108 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
104 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
109 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
105 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
110 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
106 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
111 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
107 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
112 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
108 <td class="td-user">
113 <td class="td-user">
109 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
114 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
110 <span class="user">
115 <span class="user">
111 % if _user.username == h.DEFAULT_USER:
116 % if _user.username == h.DEFAULT_USER:
112 ${h.DEFAULT_USER}
117 ${h.DEFAULT_USER}
113 % if _user.active:
118 % if _user.active:
114 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
119 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
115 % else:
120 % else:
116 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
121 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
117 % endif
122 % endif
118 % else:
123 % else:
124 % if getattr(_user, 'duplicate_perm', None):
125 <span class="user-perm-duplicate">
119 ${h.link_to_user(_user.username)}
126 ${h.link_to_user(_user.username)}
120 %if getattr(_user, 'duplicate_perm', None):
127 <span class="tooltip" title="${_('This entry is a duplicate, most probably left-over from previously set permission. This user has a higher permission set, so this entry is inactive. Please revoke this permission manually.')}">(${_('inactive duplicate')})
121 (${_('inactive duplicate')})
128 </span>
129 </span>
130 % else:
131 ${h.link_to_user(_user.username)}
122 %endif
132 % endif
123 % endif
133 % endif
124 <span class="user-perm-help-text">(${_('delegated admin')})</span>
134 <span class="user-perm-help-text">(${_('delegated admin')})</span>
125 </span>
135 </span>
126 </td>
136 </td>
127 <td></td>
137 <td></td>
128 <td class="quick_repo_menu">
138 <td class="quick_repo_menu">
129 % if c.rhodecode_user.is_admin:
139 % if c.rhodecode_user.is_admin:
130 <i class="icon-more"></i>
140 <i class="icon-more"></i>
131 <div class="menu_items_container" style="display: none;">
141 <div class="menu_items_container" style="display: none;">
132 <ul class="menu_items">
142 <ul class="menu_items">
133 <li>
143 <li>
134 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
144 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
135 </li>
145 </li>
136 </ul>
146 </ul>
137 </div>
147 </div>
138 % endif
148 % endif
139 </td>
149 </td>
140 %endif
150 %endif
141 </tr>
151 </tr>
142 %endif
152 %endif
143 %endfor
153 %endfor
144
154
145 ## USER GROUPS
155 ## USER GROUPS
146 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
156 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
147 <tr id="id${id(_user_group.users_group_name)}">
157 <tr id="id${id(_user_group.users_group_name)}">
148 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
158 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
149 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
159 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
150 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
160 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
151 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
161 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
152 <td class="td-componentname">
162 <td class="td-componentname">
153 ${base.user_group_icon(_user_group, tooltip=True)}
163 ${base.user_group_icon(_user_group, tooltip=True)}
154
164
155 %if c.is_super_admin:
165 %if c.is_super_admin:
156 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
166 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
157 ${_user_group.users_group_name}
167 ${_user_group.users_group_name}
158 </a>
168 </a>
159 %else:
169 %else:
160 ${h.link_to_group(_user_group.users_group_name)}
170 ${h.link_to_group(_user_group.users_group_name)}
161 %endif
171 %endif
162 (${_('members')}: ${len(_user_group.members)})
172 (${_('members')}: ${len(_user_group.members)})
163 </td>
173 </td>
164 <td class="td-action">
174 <td class="td-action">
165 <span class="btn btn-link btn-danger revoke_perm"
175 <span class="btn btn-link btn-danger revoke_perm"
166 member="${_user_group.users_group_id}" member_type="user_group">
176 member="${_user_group.users_group_id}" member_type="user_group">
167 ${_('Remove')}
177 ${_('Remove')}
168 </span>
178 </span>
169 </td>
179 </td>
170 <td class="quick_repo_menu">
180 <td class="quick_repo_menu">
171 % if c.rhodecode_user.is_admin:
181 % if c.rhodecode_user.is_admin:
172 <i class="icon-more"></i>
182 <i class="icon-more"></i>
173 <div class="menu_items_container" style="display: none;">
183 <div class="menu_items_container" style="display: none;">
174 <ul class="menu_items">
184 <ul class="menu_items">
175 <li>
185 <li>
176 ${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'))}
186 ${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'))}
177 </li>
187 </li>
178 </ul>
188 </ul>
179 </div>
189 </div>
180 % endif
190 % endif
181 </td>
191 </td>
182 </tr>
192 </tr>
183 %endfor
193 %endfor
184
194
185 <tr class="new_members" id="add_perm_input"></tr>
195 <tr class="new_members" id="add_perm_input"></tr>
186 <tr>
196 <tr>
187 <td></td>
197 <td></td>
188 <td></td>
198 <td></td>
189 <td></td>
199 <td></td>
190 <td></td>
200 <td></td>
191 <td></td>
201 <td></td>
192 <td>
202 <td>
193 <span id="add_perm" class="link">
203 <span id="add_perm" class="link">
194 ${_('Add user/user group')}
204 ${_('Add user/user group')}
195 </span>
205 </span>
196 </td>
206 </td>
197 <td></td>
207 <td></td>
198 </tr>
208 </tr>
199 </table>
209 </table>
200
210
201 <div class="fields">
211 <div class="fields">
202 <div class="field">
212 <div class="field">
203 <div class="label label-radio">
213 <div class="label label-radio">
204 ${_('Apply to children')}:
214 ${_('Apply to children')}:
205 </div>
215 </div>
206 <div class="radios">
216 <div class="radios">
207 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
217 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
208 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
218 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
209 ${h.radio('recursive', 'repos', label=_('Repositories'))}
219 ${h.radio('recursive', 'repos', label=_('Repositories'))}
210 ${h.radio('recursive', 'all', label=_('Both'))}
220 ${h.radio('recursive', 'all', label=_('Both'))}
211 <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>
221 <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>
212 </div>
222 </div>
213 </div>
223 </div>
214 </div>
224 </div>
215 <div class="buttons">
225 <div class="buttons">
216 ${h.submit('save',_('Save'),class_="btn btn-primary")}
226 ${h.submit('save',_('Save'),class_="btn btn-primary")}
217 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
227 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
218 </div>
228 </div>
219 ${h.end_form()}
229 ${h.end_form()}
220 </div>
230 </div>
221 </div>
231 </div>
222 <script type="text/javascript">
232 <script type="text/javascript">
223 $('#add_perm').on('click', function(e){
233 $('#add_perm').on('click', function(e){
224 addNewPermInput($(this), 'group');
234 addNewPermInput($(this), 'group');
225 });
235 });
226 $('.revoke_perm').on('click', function(e){
236 $('.revoke_perm').on('click', function(e){
227 markRevokePermInput($(this), 'group');
237 markRevokePermInput($(this), 'group');
228 });
238 });
229 quick_repo_menu();
239 quick_repo_menu();
230 </script>
240 </script>
@@ -1,239 +1,245 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-heading">
4 <div class="panel-heading">
5 <h3 class="panel-title">${_('Repository Access Permissions')}</h3>
5 <h3 class="panel-title">${_('Repository Access Permissions')}</h3>
6 </div>
6 </div>
7 <div class="panel-body">
7 <div class="panel-body">
8 ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), request=request)}
8 ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), request=request)}
9 <table id="permissions_manage" class="rctable permissions">
9 <table id="permissions_manage" class="rctable permissions">
10 <tr>
10 <tr>
11 <th class="td-radio">${_('None')}</th>
11 <th class="td-radio">${_('None')}</th>
12 <th class="td-radio">${_('Read')}</th>
12 <th class="td-radio">${_('Read')}</th>
13 <th class="td-radio">${_('Write')}</th>
13 <th class="td-radio">${_('Write')}</th>
14 <th class="td-radio">${_('Admin')}</th>
14 <th class="td-radio">${_('Admin')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
15 <th class="td-owner">${_('User/User Group')}</th>
16 <th class="td-action"></th>
16 <th class="td-action"></th>
17 <th class="td-action"></th>
17 <th class="td-action"></th>
18 </tr>
18 </tr>
19 ## USERS
19 ## USERS
20 %for _user in c.rhodecode_db_repo.permissions():
20 %for _user in c.rhodecode_db_repo.permissions():
21 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
21 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
22 <tr class="perm_admin_row">
22 <tr class="perm_admin_row">
23 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
23 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
24 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
25 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
26 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
27 <td class="td-user">
27 <td class="td-user">
28 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
28 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
29 ${h.link_to_user(_user.username)}
29 ${h.link_to_user(_user.username)}
30 %if getattr(_user, 'admin_row', None):
30 %if getattr(_user, 'admin_row', None):
31 (${_('super-admin')})
31 (${_('super-admin')})
32 %endif
32 %endif
33 %if getattr(_user, 'owner_row', None):
33 %if getattr(_user, 'owner_row', None):
34 (${_('owner')})
34 (${_('owner')})
35 %endif
35 %endif
36 </td>
36 </td>
37 <td></td>
37 <td></td>
38 <td class="quick_repo_menu">
38 <td class="quick_repo_menu">
39 % if c.rhodecode_user.is_admin:
39 % if c.rhodecode_user.is_admin:
40 <i class="icon-more"></i>
40 <i class="icon-more"></i>
41 <div class="menu_items_container" style="display: none;">
41 <div class="menu_items_container" style="display: none;">
42 <ul class="menu_items">
42 <ul class="menu_items">
43 <li>
43 <li>
44 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
44 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
45 </li>
45 </li>
46 </ul>
46 </ul>
47 </div>
47 </div>
48 % endif
48 % endif
49 </td>
49 </td>
50 </tr>
50 </tr>
51 %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private:
51 %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private:
52 <tr>
52 <tr>
53 <td colspan="4">
53 <td colspan="4">
54 <span class="private_repo_msg">
54 <span class="private_repo_msg">
55 <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong>
55 <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong>
56 </span>
56 </span>
57 </td>
57 </td>
58 <td class="private_repo_msg">
58 <td class="private_repo_msg">
59 ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)}
59 ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)}
60 ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td>
60 ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td>
61 <td class="td-action">
61 <td class="td-action">
62 <span class="noselect tooltip btn btn-link btn-default" onclick="setPrivateRepo(this, false); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
62 <span class="noselect tooltip btn btn-link btn-default" onclick="setPrivateRepo(this, false); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
63 ${_('un-set private mode')}
63 ${_('un-set private mode')}
64 </span>
64 </span>
65 </td>
65 </td>
66 <td class="quick_repo_menu">
66 <td class="quick_repo_menu">
67 % if c.rhodecode_user.is_admin:
67 % if c.rhodecode_user.is_admin:
68 <i class="icon-more"></i>
68 <i class="icon-more"></i>
69 <div class="menu_items_container" style="display: none;">
69 <div class="menu_items_container" style="display: none;">
70 <ul class="menu_items">
70 <ul class="menu_items">
71 <li>
71 <li>
72 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
72 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
73 </li>
73 </li>
74 </ul>
74 </ul>
75 </div>
75 </div>
76 % endif
76 % endif
77 </td>
77 </td>
78 </tr>
78 </tr>
79 %else:
79 %else:
80 <% used_by_n_rules = len(getattr(_user, 'branch_rules', None) or []) %>
80 <% used_by_n_rules = len(getattr(_user, 'branch_rules', None) or []) %>
81 <tr>
81 <tr>
82 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
82 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
83 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
83 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
84 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
84 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
85 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
85 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
86 <td class="td-user">
86 <td class="td-user">
87 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
87 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
88 <span class="user">
88 <span class="user">
89 % if _user.username == h.DEFAULT_USER:
89 % if _user.username == h.DEFAULT_USER:
90 ${h.DEFAULT_USER}
90 ${h.DEFAULT_USER}
91 % if _user.active:
91 % if _user.active:
92 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
92 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
93 % else:
93 % else:
94 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
94 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
95 % endif
95 % endif
96 % else:
96 % else:
97 % if getattr(_user, 'duplicate_perm', None):
98 <span class="user-perm-duplicate">
97 ${h.link_to_user(_user.username)}
99 ${h.link_to_user(_user.username)}
98 %if getattr(_user, 'duplicate_perm', None):
100 <span class="tooltip" title="${_('This entry is a duplicate, most probably left-over from previously set permission. This user has a higher permission set, so this entry is inactive. Please revoke this permission manually.')}">(${_('inactive duplicate')})
99 (${_('inactive duplicate')})
101 </span>
102 </span>
103 % else:
104 ${h.link_to_user(_user.username)}
100 %endif
105 % endif
106
101 %if getattr(_user, 'branch_rules', None):
107 %if getattr(_user, 'branch_rules', None):
102 % if used_by_n_rules == 1:
108 % if used_by_n_rules == 1:
103 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
109 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
104 % else:
110 % else:
105 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
111 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
106 % endif
112 % endif
107 %endif
113 %endif
108 % endif
114 % endif
109 </span>
115 </span>
110 </td>
116 </td>
111 <td class="td-action">
117 <td class="td-action">
112 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
118 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
113 <span class="btn btn-link btn-danger revoke_perm"
119 <span class="btn btn-link btn-danger revoke_perm"
114 member="${_user.user_id}" member_type="user">
120 member="${_user.user_id}" member_type="user">
115 ${_('Remove')}
121 ${_('Remove')}
116 </span>
122 </span>
117 %elif _user.username == h.DEFAULT_USER:
123 %elif _user.username == h.DEFAULT_USER:
118 <span class="noselect tooltip btn btn-link btn-default" onclick="setPrivateRepo(this, true); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
124 <span class="noselect tooltip btn btn-link btn-default" onclick="setPrivateRepo(this, true); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
119 ${_('set private mode')}
125 ${_('set private mode')}
120 </span>
126 </span>
121 %endif
127 %endif
122 </td>
128 </td>
123 <td class="quick_repo_menu">
129 <td class="quick_repo_menu">
124 % if c.rhodecode_user.is_admin:
130 % if c.rhodecode_user.is_admin:
125 <i class="icon-more"></i>
131 <i class="icon-more"></i>
126 <div class="menu_items_container" style="display: none;">
132 <div class="menu_items_container" style="display: none;">
127 <ul class="menu_items">
133 <ul class="menu_items">
128 <li>
134 <li>
129 % if _user.username == h.DEFAULT_USER:
135 % if _user.username == h.DEFAULT_USER:
130 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
136 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
131 % else:
137 % else:
132 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
138 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
133 % endif
139 % endif
134 </li>
140 </li>
135 </ul>
141 </ul>
136 </div>
142 </div>
137 % endif
143 % endif
138 </td>
144 </td>
139 </tr>
145 </tr>
140 %endif
146 %endif
141 %endfor
147 %endfor
142
148
143 ## USER GROUPS
149 ## USER GROUPS
144 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
150 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
145 <tr>
151 <tr>
146 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
152 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
147 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
153 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td>
148 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td>
154 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td>
149 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td>
155 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td>
150 <td class="td-componentname">
156 <td class="td-componentname">
151 ${base.user_group_icon(_user_group, tooltip=True)}
157 ${base.user_group_icon(_user_group, tooltip=True)}
152 %if c.is_super_admin:
158 %if c.is_super_admin:
153 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
159 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
154 ${_user_group.users_group_name}
160 ${_user_group.users_group_name}
155 </a>
161 </a>
156 %else:
162 %else:
157 ${h.link_to_group(_user_group.users_group_name)}
163 ${h.link_to_group(_user_group.users_group_name)}
158 %endif
164 %endif
159 (${_('members')}: ${len(_user_group.members)})
165 (${_('members')}: ${len(_user_group.members)})
160 </td>
166 </td>
161 <td class="td-action">
167 <td class="td-action">
162 <span class="btn btn-link btn-danger revoke_perm"
168 <span class="btn btn-link btn-danger revoke_perm"
163 member="${_user_group.users_group_id}" member_type="user_group">
169 member="${_user_group.users_group_id}" member_type="user_group">
164 ${_('Remove')}
170 ${_('Remove')}
165 </span>
171 </span>
166 </td>
172 </td>
167 <td class="quick_repo_menu">
173 <td class="quick_repo_menu">
168 % if c.rhodecode_user.is_admin:
174 % if c.rhodecode_user.is_admin:
169 <i class="icon-more"></i>
175 <i class="icon-more"></i>
170 <div class="menu_items_container" style="display: none;">
176 <div class="menu_items_container" style="display: none;">
171 <ul class="menu_items">
177 <ul class="menu_items">
172 <li>
178 <li>
173 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
179 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
174 </li>
180 </li>
175 </ul>
181 </ul>
176 </div>
182 </div>
177 % endif
183 % endif
178 </td>
184 </td>
179 </tr>
185 </tr>
180 %endfor
186 %endfor
181 <tr class="new_members" id="add_perm_input"></tr>
187 <tr class="new_members" id="add_perm_input"></tr>
182
188
183 <tr>
189 <tr>
184 <td></td>
190 <td></td>
185 <td></td>
191 <td></td>
186 <td></td>
192 <td></td>
187 <td></td>
193 <td></td>
188 <td></td>
194 <td></td>
189 <td>
195 <td>
190 <span id="add_perm" class="link">
196 <span id="add_perm" class="link">
191 ${_('Add user/user group')}
197 ${_('Add user/user group')}
192 </span>
198 </span>
193 </td>
199 </td>
194 <td></td>
200 <td></td>
195 </tr>
201 </tr>
196
202
197 </table>
203 </table>
198
204
199 <div class="buttons">
205 <div class="buttons">
200 ${h.submit('save',_('Save'),class_="btn btn-primary")}
206 ${h.submit('save',_('Save'),class_="btn btn-primary")}
201 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
207 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
202 </div>
208 </div>
203 ${h.end_form()}
209 ${h.end_form()}
204 </div>
210 </div>
205 </div>
211 </div>
206
212
207 <script type="text/javascript">
213 <script type="text/javascript">
208 $('#add_perm').on('click', function(e){
214 $('#add_perm').on('click', function(e){
209 addNewPermInput($(this), 'repository');
215 addNewPermInput($(this), 'repository');
210 });
216 });
211 $('.revoke_perm').on('click', function(e){
217 $('.revoke_perm').on('click', function(e){
212 markRevokePermInput($(this), 'repository');
218 markRevokePermInput($(this), 'repository');
213 });
219 });
214 quick_repo_menu();
220 quick_repo_menu();
215
221
216 var setPrivateRepo = function (elem, private) {
222 var setPrivateRepo = function (elem, private) {
217 var $elem = $(elem)
223 var $elem = $(elem)
218 if ($elem.hasClass('disabled')) {
224 if ($elem.hasClass('disabled')) {
219 return
225 return
220 }
226 }
221 $elem.addClass('disabled');
227 $elem.addClass('disabled');
222 $elem.css({"opacity": 0.3})
228 $elem.css({"opacity": 0.3})
223
229
224 var postData = {
230 var postData = {
225 'csrf_token': CSRF_TOKEN,
231 'csrf_token': CSRF_TOKEN,
226 'private': private
232 'private': private
227 };
233 };
228
234
229 var success = function(o) {
235 var success = function(o) {
230 var defaultUrl = pyroutes.url('edit_repo_perms', {"repo_name": templateContext.repo_name});
236 var defaultUrl = pyroutes.url('edit_repo_perms', {"repo_name": templateContext.repo_name});
231 window.location = o.redirect_url || defaultUrl;
237 window.location = o.redirect_url || defaultUrl;
232 };
238 };
233
239
234 ajaxPOST(
240 ajaxPOST(
235 pyroutes.url('edit_repo_perms_set_private', {"repo_name": templateContext.repo_name}),
241 pyroutes.url('edit_repo_perms_set_private', {"repo_name": templateContext.repo_name}),
236 postData,
242 postData,
237 success);
243 success);
238 }
244 }
239 </script>
245 </script>
@@ -1,221 +1,231 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-heading">
4 <div class="panel-heading">
5 <h3 class="panel-title">
5 <h3 class="panel-title">
6 <i class="icon-user-group" title="${_('User group')}"></i>
6 <i class="icon-user-group" title="${_('User group')}"></i>
7 ${h.link_to_group(c.user_group.users_group_name)}
7 ${h.link_to_group(c.user_group.users_group_name)}
8 - ${_('Access Permissions')}
8 - ${_('Access Permissions')}
9 </h3>
9 </h3>
10 </div>
10 </div>
11 <div class="panel-body">
11 <div class="panel-body">
12 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), request=request)}
12 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), request=request)}
13 <table id="permissions_manage" class="rctable permissions">
13 <table id="permissions_manage" class="rctable permissions">
14 <tr>
14 <tr>
15 <th class="td-radio">${_('None')}</th>
15 <th class="td-radio">${_('None')}</th>
16 <th class="td-radio">${_('Read')}</th>
16 <th class="td-radio">${_('Read')}</th>
17 <th class="td-radio">${_('Write')}</th>
17 <th class="td-radio">${_('Write')}</th>
18 <th class="td-radio">${_('Admin')}</th>
18 <th class="td-radio">${_('Admin')}</th>
19 <th>${_('User/User Group')}</th>
19 <th>${_('User/User Group')}</th>
20 <th class="td-action"></th>
20 <th class="td-action"></th>
21 <th class="td-action"></th>
21 <th class="td-action"></th>
22 </tr>
22 </tr>
23 ## USERS
23 ## USERS
24 %for _user in c.user_group.permissions():
24 %for _user in c.user_group.permissions():
25 ## super admin/owner row
25 ## super admin/owner row
26 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
26 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
27 <tr class="perm_admin_row">
27 <tr class="perm_admin_row">
28 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
28 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
29 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
29 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
30 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
30 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
31 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
31 <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
32 <td class="td-user">
32 <td class="td-user">
33 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
33 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
34 <span class="user">
34 <span class="user">
35 ${h.link_to_user(_user.username)}
35 ${h.link_to_user(_user.username)}
36 %if getattr(_user, 'admin_row', None):
36 %if getattr(_user, 'admin_row', None):
37 (${_('super-admin')})
37 (${_('super-admin')})
38 %endif
38 %endif
39 %if getattr(_user, 'owner_row', None):
39 %if getattr(_user, 'owner_row', None):
40 (${_('owner')})
40 (${_('owner')})
41 %endif
41 %endif
42 </span>
42 </span>
43 </td>
43 </td>
44 <td></td>
44 <td></td>
45 <td class="quick_repo_menu">
45 <td class="quick_repo_menu">
46 % if c.rhodecode_user.is_admin:
46 % if c.rhodecode_user.is_admin:
47 <i class="icon-more"></i>
47 <i class="icon-more"></i>
48 <div class="menu_items_container" style="display: none;">
48 <div class="menu_items_container" style="display: none;">
49 <ul class="menu_items">
49 <ul class="menu_items">
50 <li>
50 <li>
51 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
51 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
52 </li>
52 </li>
53 </ul>
53 </ul>
54 </div>
54 </div>
55 % endif
55 % endif
56 </td>
56 </td>
57 </tr>
57 </tr>
58 %else:
58 %else:
59 ##forbid revoking permission from yourself, except if you're an super admin
59 ##forbid revoking permission from yourself, except if you're an super admin
60 <tr>
60 <tr>
61 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
61 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
62 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
62 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
63 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
63 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
64 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
64 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
65 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
65 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
66 <td class="td-user">
66 <td class="td-user">
67 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
67 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
68 <span class="user">
68 <span class="user">
69 % if _user.username == h.DEFAULT_USER:
69 % if _user.username == h.DEFAULT_USER:
70 ${h.DEFAULT_USER}
70 ${h.DEFAULT_USER}
71 % if _user.active:
71 % if _user.active:
72 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
72 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
73 % else:
73 % else:
74 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
74 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
75 % endif
75 % endif
76 % else:
76 % else:
77 % if getattr(_user, 'duplicate_perm', None):
78 <span class="user-perm-duplicate">
77 ${h.link_to_user(_user.username)}
79 ${h.link_to_user(_user.username)}
78 %if getattr(_user, 'duplicate_perm', None):
80 <span class="tooltip" title="${_('This entry is a duplicate, most probably left-over from previously set permission. This user has a higher permission set, so this entry is inactive. Please revoke this permission manually.')}">(${_('inactive duplicate')})
79 (${_('inactive duplicate')})
81 </span>
82 </span>
83 % else:
84 ${h.link_to_user(_user.username)}
80 %endif
85 % endif
81 % endif
86 % endif
82 </span>
87 </span>
83 </td>
88 </td>
84 <td class="td-action">
89 <td class="td-action">
85 %if _user.username != h.DEFAULT_USER:
90 %if _user.username != h.DEFAULT_USER:
86 <span class="btn btn-link btn-danger revoke_perm"
91 <span class="btn btn-link btn-danger revoke_perm"
87 member="${_user.user_id}" member_type="user">
92 member="${_user.user_id}" member_type="user">
88 ${_('Remove')}
93 ${_('Remove')}
89 </span>
94 </span>
90 %endif
95 %endif
91 </td>
96 </td>
92 <td class="quick_repo_menu">
97 <td class="quick_repo_menu">
93 % if c.rhodecode_user.is_admin:
98 % if c.rhodecode_user.is_admin:
94 <i class="icon-more"></i>
99 <i class="icon-more"></i>
95 <div class="menu_items_container" style="display: none;">
100 <div class="menu_items_container" style="display: none;">
96 <ul class="menu_items">
101 <ul class="menu_items">
97 <li>
102 <li>
98 % if _user.username == h.DEFAULT_USER:
103 % if _user.username == h.DEFAULT_USER:
99 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
104 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
100 % else:
105 % else:
101 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
106 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
102 % endif
107 % endif
103 </li>
108 </li>
104 </ul>
109 </ul>
105 </div>
110 </div>
106 % endif
111 % endif
107 </td>
112 </td>
108 %else:
113 %else:
109 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
114 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
110 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
115 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
111 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
116 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
112 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
117 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
113 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
118 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
114 <td class="td-user">
119 <td class="td-user">
115 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
120 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
116 <span class="user">
121 <span class="user">
117 % if _user.username == h.DEFAULT_USER:
122 % if _user.username == h.DEFAULT_USER:
118 ${h.DEFAULT_USER}
123 ${h.DEFAULT_USER}
119 % if _user.active:
124 % if _user.active:
120 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
125 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
121 % else:
126 % else:
122 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
127 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
123 % endif
128 % endif
124 % else:
129 % else:
130 % if getattr(_user, 'duplicate_perm', None):
131 <span class="user-perm-duplicate">
125 ${h.link_to_user(_user.username)}
132 ${h.link_to_user(_user.username)}
126 %if getattr(_user, 'duplicate_perm', None):
133 <span class="tooltip" title="${_('This entry is a duplicate, most probably left-over from previously set permission. This user has a higher permission set, so this entry is inactive. Please revoke this permission manually.')}">(${_('inactive duplicate')})
127 (${_('inactive duplicate')})
134 </span>
135 </span>
136 % else:
137 ${h.link_to_user(_user.username)}
128 %endif
138 % endif
129 % endif
139 % endif
130 <span class="user-perm-help-text">(${_('delegated admin')})</span>
140 <span class="user-perm-help-text">(${_('delegated admin')})</span>
131 </span>
141 </span>
132 </td>
142 </td>
133 <td></td>
143 <td></td>
134 <td class="quick_repo_menu">
144 <td class="quick_repo_menu">
135 % if c.rhodecode_user.is_admin:
145 % if c.rhodecode_user.is_admin:
136 <i class="icon-more"></i>
146 <i class="icon-more"></i>
137 <div class="menu_items_container" style="display: none;">
147 <div class="menu_items_container" style="display: none;">
138 <ul class="menu_items">
148 <ul class="menu_items">
139 <li>
149 <li>
140 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
150 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
141 </li>
151 </li>
142 </ul>
152 </ul>
143 </div>
153 </div>
144 % endif
154 % endif
145 </td>
155 </td>
146 %endif
156 %endif
147 </tr>
157 </tr>
148 %endif
158 %endif
149 %endfor
159 %endfor
150
160
151 ## USER GROUPS
161 ## USER GROUPS
152 %for _user_group in c.user_group.permission_user_groups(with_members=True):
162 %for _user_group in c.user_group.permission_user_groups(with_members=True):
153 <tr>
163 <tr>
154 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
164 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
155 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
165 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
156 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
166 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
157 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
167 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
158 <td class="td-user">
168 <td class="td-user">
159 <i class="icon-user-group"></i>
169 <i class="icon-user-group"></i>
160 %if c.is_super_admin:
170 %if c.is_super_admin:
161 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
171 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
162 ${_user_group.users_group_name}
172 ${_user_group.users_group_name}
163 </a>
173 </a>
164 %else:
174 %else:
165 ${h.link_to_group(_user_group.users_group_name)}
175 ${h.link_to_group(_user_group.users_group_name)}
166 %endif
176 %endif
167 (${_('members')}: ${len(_user_group.members)})
177 (${_('members')}: ${len(_user_group.members)})
168 </td>
178 </td>
169 <td class="td-action">
179 <td class="td-action">
170 <span class="btn btn-link btn-danger revoke_perm"
180 <span class="btn btn-link btn-danger revoke_perm"
171 member="${_user_group.users_group_id}" member_type="user_group">
181 member="${_user_group.users_group_id}" member_type="user_group">
172 ${_('Remove')}
182 ${_('Remove')}
173 </span>
183 </span>
174 </td>
184 </td>
175 <td class="quick_repo_menu">
185 <td class="quick_repo_menu">
176 % if c.rhodecode_user.is_admin:
186 % if c.rhodecode_user.is_admin:
177 <i class="icon-more"></i>
187 <i class="icon-more"></i>
178 <div class="menu_items_container" style="display: none;">
188 <div class="menu_items_container" style="display: none;">
179 <ul class="menu_items">
189 <ul class="menu_items">
180 <li>
190 <li>
181 ${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'))}
191 ${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'))}
182 </li>
192 </li>
183 </ul>
193 </ul>
184 </div>
194 </div>
185 % endif
195 % endif
186 </td>
196 </td>
187 </tr>
197 </tr>
188 %endfor
198 %endfor
189 <tr class="new_members" id="add_perm_input"></tr>
199 <tr class="new_members" id="add_perm_input"></tr>
190 <tr>
200 <tr>
191 <td></td>
201 <td></td>
192 <td></td>
202 <td></td>
193 <td></td>
203 <td></td>
194 <td></td>
204 <td></td>
195 <td></td>
205 <td></td>
196 <td>
206 <td>
197 <span id="add_perm" class="link">
207 <span id="add_perm" class="link">
198 ${_('Add user/user group')}
208 ${_('Add user/user group')}
199 </span>
209 </span>
200 </td>
210 </td>
201 <td></td>
211 <td></td>
202 </tr>
212 </tr>
203 </table>
213 </table>
204
214
205 <div class="buttons">
215 <div class="buttons">
206 ${h.submit('save',_('Save'),class_="btn btn-primary")}
216 ${h.submit('save',_('Save'),class_="btn btn-primary")}
207 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
217 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
208 </div>
218 </div>
209 ${h.end_form()}
219 ${h.end_form()}
210 </div>
220 </div>
211 </div>
221 </div>
212
222
213 <script type="text/javascript">
223 <script type="text/javascript">
214 $('#add_perm').on('click', function(e){
224 $('#add_perm').on('click', function(e){
215 addNewPermInput($(this), 'usergroup');
225 addNewPermInput($(this), 'usergroup');
216 });
226 });
217 $('.revoke_perm').on('click', function(e){
227 $('.revoke_perm').on('click', function(e){
218 markRevokePermInput($(this), 'usergroup');
228 markRevokePermInput($(this), 'usergroup');
219 });
229 });
220 quick_repo_menu()
230 quick_repo_menu()
221 </script>
231 </script>
General Comments 0
You need to be logged in to leave comments. Login now