##// END OF EJS Templates
permissions: add better helper block about default permissions, and corelation with anonymous access.
bart -
r4222:21ec1451 stable
parent child Browse files
Show More
@@ -1,614 +1,614 b''
1 //
1 //
2 // Typography
2 // Typography
3 // modified from Bootstrap
3 // modified from Bootstrap
4 // --------------------------------------------------
4 // --------------------------------------------------
5
5
6 // Base
6 // Base
7 body {
7 body {
8 font-size: @basefontsize;
8 font-size: @basefontsize;
9 font-family: @text-light;
9 font-family: @text-light;
10 letter-spacing: .02em;
10 letter-spacing: .02em;
11 color: @grey2;
11 color: @grey2;
12 }
12 }
13
13
14 #content, label{
14 #content, label{
15 font-size: @basefontsize;
15 font-size: @basefontsize;
16 }
16 }
17
17
18 label {
18 label {
19 color: @grey2;
19 color: @grey2;
20 }
20 }
21
21
22 ::selection { background: @rchighlightblue; }
22 ::selection { background: @rchighlightblue; }
23
23
24 // Headings
24 // Headings
25 // -------------------------
25 // -------------------------
26
26
27 h1, h2, h3, h4, h5, h6,
27 h1, h2, h3, h4, h5, h6,
28 .h1, .h2, .h3, .h4, .h5, .h6 {
28 .h1, .h2, .h3, .h4, .h5, .h6 {
29 margin: 0 0 @textmargin 0;
29 margin: 0 0 @textmargin 0;
30 padding: 0;
30 padding: 0;
31 line-height: 1.8em;
31 line-height: 1.8em;
32 color: @text-color;
32 color: @text-color;
33 a {
33 a {
34 color: @rcblue;
34 color: @rcblue;
35 }
35 }
36 }
36 }
37
37
38 h1, .h1 { font-size: 1.54em; font-weight: @text-bold-weight; font-family: @text-bold; }
38 h1, .h1 { font-size: 1.54em; font-weight: @text-bold-weight; font-family: @text-bold; }
39 h2, .h2 { font-size: 1.23em; font-weight: @text-semibold-weight; font-family: @text-semibold; }
39 h2, .h2 { font-size: 1.23em; font-weight: @text-semibold-weight; font-family: @text-semibold; }
40 h3, .h3 { font-size: 1.23em; font-family: @text-regular; }
40 h3, .h3 { font-size: 1.23em; font-family: @text-regular; }
41 h4, .h4 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
41 h4, .h4 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
42 h5, .h5 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
42 h5, .h5 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
43 h6, .h6 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
43 h6, .h6 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
44
44
45 // Breadcrumbs
45 // Breadcrumbs
46 .breadcrumbs {
46 .breadcrumbs {
47 font-size: @repo-title-fontsize;
47 font-size: @repo-title-fontsize;
48 margin: 0;
48 margin: 0;
49 width: ~"calc(100% - 180px)";
49 width: ~"calc(100% - 180px)";
50 float: left;
50 float: left;
51
51
52 h4 {
52 h4 {
53 font-size: @basefontsize;
53 font-size: @basefontsize;
54 margin-bottom: 15px;
54 margin-bottom: 15px;
55 }
55 }
56 }
56 }
57
57
58 .breadcrumbs_light {
58 .breadcrumbs_light {
59 float:left;
59 float:left;
60 font-size: 1.3em;
60 font-size: 1.3em;
61 line-height: 38px;
61 line-height: 38px;
62 }
62 }
63
63
64 // Body text
64 // Body text
65 // -------------------------
65 // -------------------------
66
66
67 p {
67 p {
68 margin: 0 0 @textmargin 0;
68 margin: 0 0 @textmargin 0;
69 padding: 0;
69 padding: 0;
70 line-height: 2em;
70 line-height: 2em;
71 }
71 }
72
72
73 .lead {
73 .lead {
74 margin-bottom: @textmargin;
74 margin-bottom: @textmargin;
75 font-weight: 300;
75 font-weight: 300;
76 line-height: 1.4;
76 line-height: 1.4;
77
77
78 @media (min-width: @screen-sm-min) {
78 @media (min-width: @screen-sm-min) {
79 font-size: (@basefontsize * 1.5);
79 font-size: (@basefontsize * 1.5);
80 }
80 }
81 }
81 }
82
82
83 a,
83 a,
84 .link {
84 .link {
85 color: @rcblue;
85 color: @rcblue;
86 text-decoration: none;
86 text-decoration: none;
87 outline: none;
87 outline: none;
88 cursor: pointer;
88 cursor: pointer;
89
89
90 &:focus {
90 &:focus {
91 outline: none;
91 outline: none;
92 }
92 }
93
93
94 &:hover {
94 &:hover {
95 color: @rcdarkblue;
95 color: @rcdarkblue;
96 }
96 }
97 }
97 }
98
98
99 img {
99 img {
100 border: none;
100 border: none;
101 outline: none;
101 outline: none;
102 }
102 }
103
103
104 strong {
104 strong {
105 font-weight: @text-bold-weight;
105 font-weight: @text-bold-weight;
106 font-family: @text-bold;
106 font-family: @text-bold;
107 }
107 }
108
108
109 em {
109 em {
110 font-family: @text-italic;
110 font-family: @text-italic;
111 font-style: italic;
111 font-style: italic;
112 }
112 }
113
113
114 strong em,
114 strong em,
115 em strong {
115 em strong {
116 font-style: italic;
116 font-style: italic;
117 font-weight: @text-bold-italic-weight;
117 font-weight: @text-bold-italic-weight;
118 font-family: @text-bold-italic;
118 font-family: @text-bold-italic;
119 }
119 }
120
120
121 //TODO: lisa: b and i are depreciated, but we are still using them in places.
121 //TODO: lisa: b and i are depreciated, but we are still using them in places.
122 // Should probably make some decision whether to keep or lose these.
122 // Should probably make some decision whether to keep or lose these.
123 b {
123 b {
124
124
125 }
125 }
126
126
127 i {
127 i {
128 font-style: normal;
128 font-style: normal;
129 }
129 }
130
130
131 label {
131 label {
132 color: @text-color;
132 color: @text-color;
133
133
134 input[type="checkbox"] {
134 input[type="checkbox"] {
135 margin-right: 1em;
135 margin-right: 1em;
136 }
136 }
137 input[type="radio"] {
137 input[type="radio"] {
138 margin-right: 1em;
138 margin-right: 1em;
139 }
139 }
140 }
140 }
141
141
142 code,
142 code,
143 .code {
143 .code {
144 font-size: .95em;
144 font-size: .95em;
145 font-family: @text-code;
145 font-family: @text-code;
146 color: @grey3;
146 color: @grey3;
147
147
148 a {
148 a {
149 color: lighten(@rcblue,10%)
149 color: lighten(@rcblue,10%)
150 }
150 }
151 }
151 }
152
152
153 pre {
153 pre {
154 margin: 0;
154 margin: 0;
155 padding: 0;
155 padding: 0;
156 border: 0;
156 border: 0;
157 outline: 0;
157 outline: 0;
158 font-size: @basefontsize*.95;
158 font-size: @basefontsize*.95;
159 line-height: 1.4em;
159 line-height: 1.4em;
160 font-family: @text-code;
160 font-family: @text-code;
161 color: @grey3;
161 color: @grey3;
162 }
162 }
163
163
164 // Emphasis & misc
164 // Emphasis & misc
165 // -------------------------
165 // -------------------------
166 .discreet {
166 .discreet {
167 color: @grey4;
167 color: @grey4;
168 font-size: 85%;
168 font-size: 85%;
169 font-weight: normal;
169 font-weight: normal;
170
170
171 a {
171 a {
172 color: @grey4;
172 color: @grey4;
173
173
174 &:hover {
174 &:hover {
175 color: @rcdarkblue;
175 color: @rcdarkblue;
176 }
176 }
177 }
177 }
178 }
178 }
179
179
180 small,
180 small,
181 .small {
181 .small {
182 font-size: 75%;
182 font-size: 75%;
183 font-weight: normal;
183 font-weight: normal;
184 line-height: 1em;
184 line-height: 1em;
185 }
185 }
186
186
187 mark,
187 mark,
188 .mark {
188 .mark {
189 padding: .2em;
189 padding: .2em;
190 }
190 }
191
191
192 // Alignment
192 // Alignment
193 .text-left { text-align: left; }
193 .text-left { text-align: left; }
194 .text-right { text-align: right; }
194 .text-right { text-align: right; }
195 .text-center { text-align: center; }
195 .text-center { text-align: center; }
196 .text-justify { text-align: justify; }
196 .text-justify { text-align: justify; }
197 .text-nowrap { white-space: nowrap; }
197 .text-nowrap { white-space: nowrap; }
198
198
199 // Transformation
199 // Transformation
200 .text-lowercase { text-transform: lowercase; }
200 .text-lowercase { text-transform: lowercase; }
201 .text-uppercase { text-transform: uppercase; }
201 .text-uppercase { text-transform: uppercase; }
202 .text-capitalize { text-transform: capitalize; }
202 .text-capitalize { text-transform: capitalize; }
203
203
204 // Contextual colors
204 // Contextual colors
205 .text-muted {
205 .text-muted {
206 color: @grey4;
206 color: @grey4;
207 }
207 }
208 .text-primary {
208 .text-primary {
209 color: @rcblue;
209 color: @rcblue;
210 }
210 }
211 .text-success {
211 .text-success {
212 color: @alert1;
212 color: @alert1;
213 }
213 }
214 .text-info {
214 .text-info {
215 color: @alert4;
215 color: @alert4;
216 }
216 }
217 .text-warning {
217 .text-warning {
218 color: @alert3;
218 color: @alert3;
219 }
219 }
220 .text-danger {
220 .text-danger {
221 color: @alert2;
221 color: @alert2;
222 }
222 }
223
223
224 // Contextual backgrounds
224 // Contextual backgrounds
225 .bg-primary {
225 .bg-primary {
226 background-color: white;
226 background-color: white;
227 }
227 }
228 .bg-success {
228 .bg-success {
229 background-color: @alert1;
229 background-color: @alert1;
230 }
230 }
231 .bg-info {
231 .bg-info {
232 background-color: @alert4;
232 background-color: @alert4;
233 }
233 }
234 .bg-warning {
234 .bg-warning {
235 background-color: @alert3;
235 background-color: @alert3;
236 }
236 }
237 .bg-danger {
237 .bg-danger {
238 background-color: @alert2;
238 background-color: @alert2;
239 }
239 }
240
240
241
241
242 // Page header
242 // Page header
243 // -------------------------
243 // -------------------------
244
244
245 .page-header {
245 .page-header {
246 margin: @pagepadding 0 @textmargin;
246 margin: @pagepadding 0 @textmargin;
247 border-bottom: @border-thickness solid @grey5;
247 border-bottom: @border-thickness solid @grey5;
248 }
248 }
249
249
250 .title {
250 .title {
251 clear: both;
251 clear: both;
252 float: left;
252 float: left;
253 width: 100%;
253 width: 100%;
254 margin: @pagepadding/2 0 @pagepadding/4;
254 margin: @pagepadding/2 0 @pagepadding/4;
255 min-height: 25px;
255 min-height: 25px;
256
256
257 .breadcrumbs {
257 .breadcrumbs {
258 float: left;
258 float: left;
259 clear: both;
259 clear: both;
260 width: 700px;
260 width: 700px;
261 margin: 0;
261 margin: 0;
262
262
263 .q_filter_box {
263 .q_filter_box {
264 margin-right: @padding;
264 margin-right: @padding;
265 }
265 }
266 }
266 }
267
267
268 h1 a {
268 h1 a {
269 color: @rcblue;
269 color: @rcblue;
270 }
270 }
271
271
272 input{
272 input{
273 margin-right: @padding;
273 margin-right: @padding;
274 }
274 }
275
275
276 h5, .h5 {
276 h5, .h5 {
277 color: @grey1;
277 color: @grey1;
278 margin-bottom: @space;
278 margin-bottom: @space;
279
279
280 span {
280 span {
281 display: inline-block;
281 display: inline-block;
282 }
282 }
283 }
283 }
284
284
285 p {
285 p {
286 margin-bottom: 0;
286 margin-bottom: 0;
287 }
287 }
288
288
289 .links {
289 .links {
290 float: right;
290 float: right;
291 display: inline;
291 display: inline;
292 margin: 0;
292 margin: 0;
293 padding-left: 0;
293 padding-left: 0;
294 list-style: none;
294 list-style: none;
295 text-align: right;
295 text-align: right;
296
296
297 li {
297 li {
298 float: right;
298 float: right;
299 list-style-type: none;
299 list-style-type: none;
300 }
300 }
301
301
302 a {
302 a {
303 display: inline-block;
303 display: inline-block;
304 margin-left: @textmargin/2;
304 margin-left: @textmargin/2;
305 }
305 }
306 }
306 }
307
307
308 .title-content {
308 .title-content {
309
309
310 &.repo-title {
310 &.repo-title {
311 float: none
311 float: none
312 }
312 }
313
313
314 float: left;
314 float: left;
315 margin: 0;
315 margin: 0;
316 padding: 0;
316 padding: 0;
317
317
318 & + .breadcrumbs {
318 & + .breadcrumbs {
319 margin-top: @padding;
319 margin-top: @padding;
320 }
320 }
321
321
322 & + .links {
322 & + .links {
323 margin-top: -@button-padding;
323 margin-top: -@button-padding;
324
324
325 & + .breadcrumbs {
325 & + .breadcrumbs {
326 margin-top: @padding;
326 margin-top: @padding;
327 }
327 }
328 }
328 }
329
329
330 .repo-group-desc {
330 .repo-group-desc {
331 padding: 8px 0px 0px 0px;
331 padding: 8px 0px 0px 0px;
332 }
332 }
333 }
333 }
334
334
335 .title-main {
335 .title-main {
336 font-size: @repo-title-fontsize;
336 font-size: @repo-title-fontsize;
337 }
337 }
338
338
339 .title-description {
339 .title-description {
340 margin-top: .5em;
340 margin-top: .5em;
341 }
341 }
342
342
343 .q_filter_box {
343 .q_filter_box {
344 width: 200px;
344 width: 200px;
345 }
345 }
346
346
347 }
347 }
348
348
349 #readme .title {
349 #readme .title {
350 text-transform: none;
350 text-transform: none;
351 }
351 }
352
352
353 // Lists
353 // Lists
354 // -------------------------
354 // -------------------------
355
355
356 // Unordered and Ordered lists
356 // Unordered and Ordered lists
357 ul,
357 ul,
358 ol {
358 ol {
359 margin-top: 0;
359 margin-top: 0;
360 margin-bottom: @textmargin;
360 margin-bottom: @textmargin;
361 ul,
361 ul,
362 ol {
362 ol {
363 margin-bottom: 0;
363 margin-bottom: 0;
364 }
364 }
365 }
365 }
366
366
367 li {
367 li {
368 line-height: 2em;
368 line-height: 2em;
369 }
369 }
370
370
371 ul li {
371 ul li {
372 position: relative;
372 position: relative;
373 list-style-type: disc;
373 list-style-type: disc;
374
374
375 p:first-child {
375 p:first-child {
376 display:inline;
376 display:inline;
377 }
377 }
378 }
378 }
379
379
380 // List options
380 // List options
381
381
382 // Unstyled keeps list items block level, just removes default browser padding and list-style
382 // Unstyled keeps list items block level, just removes default browser padding and list-style
383 .list-unstyled {
383 .list-unstyled {
384 padding-left: 0;
384 padding-left: 0;
385 list-style: none;
385 list-style: none;
386 li:before { content: none; }
386 li:before { content: none; }
387 }
387 }
388
388
389 // Inline turns list items into inline-block
389 // Inline turns list items into inline-block
390 .list-inline {
390 .list-inline {
391 .list-unstyled();
391 .list-unstyled();
392 margin-left: -5px;
392 margin-left: -5px;
393
393
394 > li {
394 > li {
395 display: inline-block;
395 display: inline-block;
396 padding-left: 5px;
396 padding-left: 5px;
397 padding-right: 5px;
397 padding-right: 5px;
398 }
398 }
399 }
399 }
400
400
401 // Description Lists
401 // Description Lists
402
402
403 dl {
403 dl {
404 margin-top: 0; // Remove browser default
404 margin-top: 0; // Remove browser default
405 margin-bottom: @textmargin;
405 margin-bottom: @textmargin;
406 }
406 }
407
407
408 dt,
408 dt,
409 dd {
409 dd {
410 line-height: 1.4em;
410 line-height: 1.4em;
411 }
411 }
412
412
413 dt {
413 dt {
414 margin: @textmargin 0 0 0;
414 margin: @textmargin 0 0 0;
415 font-weight: @text-bold-weight;
415 font-weight: @text-bold-weight;
416 font-family: @text-bold;
416 font-family: @text-bold;
417 }
417 }
418
418
419 dd {
419 dd {
420 margin-left: 0; // Undo browser default
420 margin-left: 0; // Undo browser default
421 }
421 }
422
422
423 // Horizontal description lists
423 // Horizontal description lists
424 // Defaults to being stacked without any of the below styles applied, until the
424 // Defaults to being stacked without any of the below styles applied, until the
425 // grid breakpoint is reached (default of ~768px).
425 // grid breakpoint is reached (default of ~768px).
426 // These are used in forms as well; see style guide.
426 // These are used in forms as well; see style guide.
427 // TODO: lisa: These should really not be used in forms.
427 // TODO: lisa: These should really not be used in forms.
428
428
429 .dl-horizontal {
429 .dl-horizontal {
430
430
431 overflow: hidden;
431 overflow: hidden;
432 margin-bottom: @space;
432 margin-bottom: @space;
433
433
434 dt, dd {
434 dt, dd {
435 float: left;
435 float: left;
436 margin: 5px 0 5px 0;
436 margin: 5px 0 5px 0;
437 }
437 }
438
438
439 dt {
439 dt {
440 clear: left;
440 clear: left;
441 width: @label-width - @form-vertical-margin;
441 width: @label-width - @form-vertical-margin;
442 }
442 }
443
443
444 dd {
444 dd {
445 &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present
445 &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present
446 margin-left: @form-vertical-margin;
446 margin-left: @form-vertical-margin;
447 max-width: @form-max-width - (@label-width - @form-vertical-margin) - @form-vertical-margin;
447 max-width: @form-max-width - (@label-width - @form-vertical-margin) - @form-vertical-margin;
448 }
448 }
449
449
450 pre {
450 pre {
451 margin: 0;
451 margin: 0;
452 }
452 }
453
453
454 &.settings {
454 &.settings {
455 dt {
455 dt {
456 text-align: left;
456 text-align: left;
457 }
457 }
458 }
458 }
459
459
460 @media (min-width: 768px) {
460 @media (min-width: 768px) {
461 dt {
461 dt {
462 float: left;
462 float: left;
463 width: 185px;
463 width: 185px;
464 clear: left;
464 clear: left;
465 text-align: right;
465 text-align: right;
466 }
466 }
467 dd {
467 dd {
468 margin-left: 20px;
468 margin-left: 20px;
469 }
469 }
470 }
470 }
471
471
472 &.dt-300 {
472 &.dt-300 {
473 dt {
473 dt {
474 width: 300px;
474 width: 300px;
475 }
475 }
476 }
476 }
477
477
478 &.dt-400 {
478 &.dt-400 {
479 dt {
479 dt {
480 width: 400px;
480 width: 400px;
481 }
481 }
482 }
482 }
483
483
484 &.dt-500 {
484 &.dt-500 {
485 dt {
485 dt {
486 width: 500px;
486 width: 500px;
487 }
487 }
488 }
488 }
489
489
490 &.dt-600 {
490 &.dt-600 {
491 dt {
491 dt {
492 width: 600px;
492 width: 600px;
493 }
493 }
494 }
494 }
495
495
496 &.dt-700 {
496 &.dt-700 {
497 dt {
497 dt {
498 width: 700px;
498 width: 700px;
499 }
499 }
500 }
500 }
501
501
502 &.dt-800 {
502 &.dt-800 {
503 dt {
503 dt {
504 width: 800px;
504 width: 800px;
505 }
505 }
506 }
506 }
507 }
507 }
508
508
509
509
510 // Misc
510 // Misc
511 // -------------------------
511 // -------------------------
512
512
513 // Abbreviations and acronyms
513 // Abbreviations and acronyms
514 abbr[title],
514 abbr[title],
515 abbr[data-original-title] {
515 abbr[data-original-title] {
516 cursor: help;
516 cursor: help;
517 border-bottom: @border-thickness dotted @grey4;
517 border-bottom: @border-thickness dotted @grey4;
518 }
518 }
519 .initialism {
519 .initialism {
520 font-size: 90%;
520 font-size: 90%;
521 text-transform: uppercase;
521 text-transform: uppercase;
522 }
522 }
523
523
524 // Blockquotes
524 // Blockquotes
525 blockquote {
525 blockquote {
526 padding: 1em 2em;
526 padding: 1em 2em;
527 margin: 0 0 2em;
527 margin: 0 0 2em;
528 font-size: @basefontsize;
528 font-size: @basefontsize;
529 border-left: 2px solid @grey6;
529 border-left: 2px solid @grey6;
530
530
531 p,
531 p,
532 ul,
532 ul,
533 ol {
533 ol {
534 &:last-child {
534 &:last-child {
535 margin-bottom: 0;
535 margin-bottom: 0;
536 }
536 }
537 }
537 }
538
538
539 footer,
539 footer,
540 small,
540 small,
541 .small {
541 .small {
542 display: block;
542 display: block;
543 font-size: 80%;
543 font-size: 80%;
544
544
545 &:before {
545 &:before {
546 content: '\2014 \00A0'; // em dash, nbsp
546 content: '\2014 \00A0'; // em dash, nbsp
547 }
547 }
548 }
548 }
549 }
549 }
550
550
551 // Opposite alignment of blockquote
551 // Opposite alignment of blockquote
552 //
552 //
553 .blockquote-reverse,
553 .blockquote-reverse,
554 blockquote.pull-right {
554 blockquote.pull-right {
555 padding-right: 15px;
555 padding-right: 15px;
556 padding-left: 0;
556 padding-left: 0;
557 border-right: 5px solid @grey6;
557 border-right: 5px solid @grey6;
558 border-left: 0;
558 border-left: 0;
559 text-align: right;
559 text-align: right;
560
560
561 // Account for citation
561 // Account for citation
562 footer,
562 footer,
563 small,
563 small,
564 .small {
564 .small {
565 &:before { content: ''; }
565 &:before { content: ''; }
566 &:after {
566 &:after {
567 content: '\00A0 \2014'; // nbsp, em dash
567 content: '\00A0 \2014'; // nbsp, em dash
568 }
568 }
569 }
569 }
570 }
570 }
571
571
572 // Addresses
572 // Addresses
573 address {
573 address {
574 margin-bottom: 2em;
574 margin-bottom: 2em;
575 font-style: normal;
575 font-style: normal;
576 line-height: 1.8em;
576 line-height: 1.8em;
577 }
577 }
578
578
579 .error-message {
579 .error-message {
580 display: block;
580 display: block;
581 margin: @padding/3 0;
581 margin: @padding/3 0;
582 color: @alert2;
582 color: @alert2;
583 }
583 }
584
584
585 .issue-tracker-link {
585 .issue-tracker-link {
586 color: @rcblue;
586 color: @rcblue;
587 }
587 }
588
588
589 .info_text{
589 .info_text{
590 font-size: @basefontsize;
590 font-size: @basefontsize;
591 color: @grey4;
591 color: @grey4;
592 font-family: @text-regular;
592 font-family: @text-regular;
593 }
593 }
594
594
595 .help-block-inline {
595 .help-block-inline {
596 margin: 0;
596 margin: 0 !important;
597 }
597 }
598
598
599 // help block text
599 // help block text
600 .help-block {
600 .help-block {
601 display: block;
601 display: block;
602 margin: 0 0 @padding;
602 margin: 0 0 @padding;
603 color: @grey4;
603 color: @grey4;
604 font-family: @text-light;
604 font-family: @text-light;
605 &.pre-formatting {
605 &.pre-formatting {
606 white-space: pre-wrap;
606 white-space: pre-wrap;
607 }
607 }
608 }
608 }
609
609
610 .error-message {
610 .error-message {
611 display: block;
611 display: block;
612 margin: @padding/3 0;
612 margin: @padding/3 0;
613 color: @alert2;
613 color: @alert2;
614 }
614 }
@@ -1,44 +1,44 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('%s repository group settings') % c.repo_group.name}
5 ${_('%s repository group settings') % c.repo_group.name}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10
10
11 <%def name="menu_bar_nav()">
11 <%def name="menu_bar_nav()">
12 ${self.menu_items(active='admin')}
12 ${self.menu_items(active='admin')}
13 </%def>
13 </%def>
14
14
15 <%def name="menu_bar_subnav()">
15 <%def name="menu_bar_subnav()">
16 ${self.repo_group_menu(active='settings')}
16 ${self.repo_group_menu(active='settings')}
17 </%def>
17 </%def>
18
18
19 <%def name="main_content()">
19 <%def name="main_content()">
20 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
20 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
21 </%def>
21 </%def>
22
22
23 <%def name="main()">
23 <%def name="main()">
24
24
25 <div class="box">
25 <div class="box">
26 <div class="sidebar-col-wrapper">
26 <div class="sidebar-col-wrapper">
27 ##main
27 ##main
28 <div class="sidebar">
28 <div class="sidebar">
29 <ul class="nav nav-pills nav-stacked">
29 <ul class="nav nav-pills nav-stacked">
30 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
30 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
31 <li class="${h.is_active('permissions', c.active)}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li>
31 <li class="${h.is_active('permissions', c.active)}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Access Permissions')}</a></li>
32 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
32 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
33 <li class="${h.is_active('integrations', c.active)}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
33 <li class="${h.is_active('integrations', c.active)}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
34 </ul>
34 </ul>
35 </div>
35 </div>
36
36
37 <div class="main-content-full-width">
37 <div class="main-content-full-width">
38 ${self.main_content()}
38 ${self.main_content()}
39 </div>
39 </div>
40
40
41 </div>
41 </div>
42 </div>
42 </div>
43
43
44 </%def>
44 </%def>
@@ -1,220 +1,230 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} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
64 ${h.DEFAULT_USER}
65 % if _user.active:
66 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
67 % else:
68 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
69 % endif
65 % else:
70 % else:
66 ${h.link_to_user(_user.username)}
71 ${h.link_to_user(_user.username)}
67 %if getattr(_user, 'duplicate_perm', None):
72 %if getattr(_user, 'duplicate_perm', None):
68 (${_('inactive duplicate')})
73 (${_('inactive duplicate')})
69 %endif
74 %endif
70 % endif
75 % endif
71 </span>
76 </span>
72 </td>
77 </td>
73 <td class="td-action">
78 <td class="td-action">
74 %if _user.username != h.DEFAULT_USER:
79 %if _user.username != h.DEFAULT_USER:
75 <span class="btn btn-link btn-danger revoke_perm"
80 <span class="btn btn-link btn-danger revoke_perm"
76 member="${_user.user_id}" member_type="user">
81 member="${_user.user_id}" member_type="user">
77 ${_('Remove')}
82 ${_('Remove')}
78 </span>
83 </span>
79 %endif
84 %endif
80 </td>
85 </td>
81 <td class="quick_repo_menu">
86 <td class="quick_repo_menu">
82 % if c.rhodecode_user.is_admin:
87 % if c.rhodecode_user.is_admin:
83 <i class="icon-more"></i>
88 <i class="icon-more"></i>
84 <div class="menu_items_container" style="display: none;">
89 <div class="menu_items_container" style="display: none;">
85 <ul class="menu_items">
90 <ul class="menu_items">
86 <li>
91 <li>
87 % if _user.username == h.DEFAULT_USER:
92 % if _user.username == h.DEFAULT_USER:
88 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
93 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
89 % else:
94 % else:
90 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
95 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
91 % endif
96 % endif
92 </li>
97 </li>
93 </ul>
98 </ul>
94 </div>
99 </div>
95 % endif
100 % endif
96 </td>
101 </td>
97 %else:
102 %else:
98 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
103 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
99 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
104 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
100 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
105 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
106 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
107 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
103 <td class="td-user">
108 <td class="td-user">
104 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
109 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
105 <span class="user">
110 <span class="user">
106 % if _user.username == h.DEFAULT_USER:
111 % if _user.username == h.DEFAULT_USER:
107 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
112 ${h.DEFAULT_USER}
113 % if _user.active:
114 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
115 % else:
116 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
117 % endif
108 % else:
118 % else:
109 ${h.link_to_user(_user.username)}
119 ${h.link_to_user(_user.username)}
110 %if getattr(_user, 'duplicate_perm', None):
120 %if getattr(_user, 'duplicate_perm', None):
111 (${_('inactive duplicate')})
121 (${_('inactive duplicate')})
112 %endif
122 %endif
113 % endif
123 % endif
114 <span class="user-perm-help-text">(${_('delegated admin')})</span>
124 <span class="user-perm-help-text">(${_('delegated admin')})</span>
115 </span>
125 </span>
116 </td>
126 </td>
117 <td></td>
127 <td></td>
118 <td class="quick_repo_menu">
128 <td class="quick_repo_menu">
119 % if c.rhodecode_user.is_admin:
129 % if c.rhodecode_user.is_admin:
120 <i class="icon-more"></i>
130 <i class="icon-more"></i>
121 <div class="menu_items_container" style="display: none;">
131 <div class="menu_items_container" style="display: none;">
122 <ul class="menu_items">
132 <ul class="menu_items">
123 <li>
133 <li>
124 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
134 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
125 </li>
135 </li>
126 </ul>
136 </ul>
127 </div>
137 </div>
128 % endif
138 % endif
129 </td>
139 </td>
130 %endif
140 %endif
131 </tr>
141 </tr>
132 %endif
142 %endif
133 %endfor
143 %endfor
134
144
135 ## USER GROUPS
145 ## USER GROUPS
136 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
146 %for _user_group in c.repo_group.permission_user_groups(with_members=True):
137 <tr id="id${id(_user_group.users_group_name)}">
147 <tr id="id${id(_user_group.users_group_name)}">
138 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
148 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
139 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</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>
140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</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>
141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</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>
142 <td class="td-componentname">
152 <td class="td-componentname">
143 ${base.user_group_icon(_user_group, tooltip=True)}
153 ${base.user_group_icon(_user_group, tooltip=True)}
144
154
145 %if c.is_super_admin:
155 %if c.is_super_admin:
146 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
156 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
147 ${_user_group.users_group_name}
157 ${_user_group.users_group_name}
148 </a>
158 </a>
149 %else:
159 %else:
150 ${h.link_to_group(_user_group.users_group_name)}
160 ${h.link_to_group(_user_group.users_group_name)}
151 %endif
161 %endif
152 (${_('members')}: ${len(_user_group.members)})
162 (${_('members')}: ${len(_user_group.members)})
153 </td>
163 </td>
154 <td class="td-action">
164 <td class="td-action">
155 <span class="btn btn-link btn-danger revoke_perm"
165 <span class="btn btn-link btn-danger revoke_perm"
156 member="${_user_group.users_group_id}" member_type="user_group">
166 member="${_user_group.users_group_id}" member_type="user_group">
157 ${_('Remove')}
167 ${_('Remove')}
158 </span>
168 </span>
159 </td>
169 </td>
160 <td class="quick_repo_menu">
170 <td class="quick_repo_menu">
161 % if c.rhodecode_user.is_admin:
171 % if c.rhodecode_user.is_admin:
162 <i class="icon-more"></i>
172 <i class="icon-more"></i>
163 <div class="menu_items_container" style="display: none;">
173 <div class="menu_items_container" style="display: none;">
164 <ul class="menu_items">
174 <ul class="menu_items">
165 <li>
175 <li>
166 ${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'))}
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'))}
167 </li>
177 </li>
168 </ul>
178 </ul>
169 </div>
179 </div>
170 % endif
180 % endif
171 </td>
181 </td>
172 </tr>
182 </tr>
173 %endfor
183 %endfor
174
184
175 <tr class="new_members" id="add_perm_input"></tr>
185 <tr class="new_members" id="add_perm_input"></tr>
176 <tr>
186 <tr>
177 <td></td>
187 <td></td>
178 <td></td>
188 <td></td>
179 <td></td>
189 <td></td>
180 <td></td>
190 <td></td>
181 <td></td>
191 <td></td>
182 <td>
192 <td>
183 <span id="add_perm" class="link">
193 <span id="add_perm" class="link">
184 ${_('Add user/user group')}
194 ${_('Add user/user group')}
185 </span>
195 </span>
186 </td>
196 </td>
187 <td></td>
197 <td></td>
188 </tr>
198 </tr>
189 </table>
199 </table>
190
200
191 <div class="fields">
201 <div class="fields">
192 <div class="field">
202 <div class="field">
193 <div class="label label-radio">
203 <div class="label label-radio">
194 ${_('Apply to children')}:
204 ${_('Apply to children')}:
195 </div>
205 </div>
196 <div class="radios">
206 <div class="radios">
197 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
207 ${h.radio('recursive', 'none', label=_('None'), checked="checked")}
198 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
208 ${h.radio('recursive', 'groups', label=_('Repository Groups'))}
199 ${h.radio('recursive', 'repos', label=_('Repositories'))}
209 ${h.radio('recursive', 'repos', label=_('Repositories'))}
200 ${h.radio('recursive', 'all', label=_('Both'))}
210 ${h.radio('recursive', 'all', label=_('Both'))}
201 <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>
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>
202 </div>
212 </div>
203 </div>
213 </div>
204 </div>
214 </div>
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 <script type="text/javascript">
222 <script type="text/javascript">
213 $('#add_perm').on('click', function(e){
223 $('#add_perm').on('click', function(e){
214 addNewPermInput($(this), 'group');
224 addNewPermInput($(this), 'group');
215 });
225 });
216 $('.revoke_perm').on('click', function(e){
226 $('.revoke_perm').on('click', function(e){
217 markRevokePermInput($(this), 'group');
227 markRevokePermInput($(this), 'group');
218 });
228 });
219 quick_repo_menu();
229 quick_repo_menu();
220 </script>
230 </script>
@@ -1,227 +1,232 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="tooltip btn btn-link btn-default" onclick="setPrivateRepo(false); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
62 <span class="tooltip btn btn-link btn-default" onclick="setPrivateRepo(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} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
90 ${h.DEFAULT_USER}
91 % if _user.active:
92 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
93 % else:
94 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
95 % endif
91 % else:
96 % else:
92 ${h.link_to_user(_user.username)}
97 ${h.link_to_user(_user.username)}
93 %if getattr(_user, 'duplicate_perm', None):
98 %if getattr(_user, 'duplicate_perm', None):
94 (${_('inactive duplicate')})
99 (${_('inactive duplicate')})
95 %endif
100 %endif
96 %if getattr(_user, 'branch_rules', None):
101 %if getattr(_user, 'branch_rules', None):
97 % if used_by_n_rules == 1:
102 % if used_by_n_rules == 1:
98 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
103 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
99 % else:
104 % else:
100 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
105 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
101 % endif
106 % endif
102 %endif
107 %endif
103 % endif
108 % endif
104 </span>
109 </span>
105 </td>
110 </td>
106 <td class="td-action">
111 <td class="td-action">
107 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
112 %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None:
108 <span class="btn btn-link btn-danger revoke_perm"
113 <span class="btn btn-link btn-danger revoke_perm"
109 member="${_user.user_id}" member_type="user">
114 member="${_user.user_id}" member_type="user">
110 ${_('Remove')}
115 ${_('Remove')}
111 </span>
116 </span>
112 %elif _user.username == h.DEFAULT_USER:
117 %elif _user.username == h.DEFAULT_USER:
113 <span class="tooltip btn btn-link btn-default" onclick="setPrivateRepo(true); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
118 <span class="tooltip btn btn-link btn-default" onclick="setPrivateRepo(true); return false" title="${_('Private repositories are only visible to people explicitly added as collaborators. Default permissions wont apply')}">
114 ${_('set private mode')}
119 ${_('set private mode')}
115 </span>
120 </span>
116 %endif
121 %endif
117 </td>
122 </td>
118 <td class="quick_repo_menu">
123 <td class="quick_repo_menu">
119 % if c.rhodecode_user.is_admin:
124 % if c.rhodecode_user.is_admin:
120 <i class="icon-more"></i>
125 <i class="icon-more"></i>
121 <div class="menu_items_container" style="display: none;">
126 <div class="menu_items_container" style="display: none;">
122 <ul class="menu_items">
127 <ul class="menu_items">
123 <li>
128 <li>
124 % if _user.username == h.DEFAULT_USER:
129 % if _user.username == h.DEFAULT_USER:
125 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
130 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))}
126 % else:
131 % else:
127 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
132 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))}
128 % endif
133 % endif
129 </li>
134 </li>
130 </ul>
135 </ul>
131 </div>
136 </div>
132 % endif
137 % endif
133 </td>
138 </td>
134 </tr>
139 </tr>
135 %endif
140 %endif
136 %endfor
141 %endfor
137
142
138 ## USER GROUPS
143 ## USER GROUPS
139 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
144 %for _user_group in c.rhodecode_db_repo.permission_user_groups(with_members=True):
140 <tr>
145 <tr>
141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
146 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td>
142 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</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>
143 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</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>
144 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</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>
145 <td class="td-componentname">
150 <td class="td-componentname">
146 ${base.user_group_icon(_user_group, tooltip=True)}
151 ${base.user_group_icon(_user_group, tooltip=True)}
147 %if c.is_super_admin:
152 %if c.is_super_admin:
148 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
153 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
149 ${_user_group.users_group_name}
154 ${_user_group.users_group_name}
150 </a>
155 </a>
151 %else:
156 %else:
152 ${h.link_to_group(_user_group.users_group_name)}
157 ${h.link_to_group(_user_group.users_group_name)}
153 %endif
158 %endif
154 (${_('members')}: ${len(_user_group.members)})
159 (${_('members')}: ${len(_user_group.members)})
155 </td>
160 </td>
156 <td class="td-action">
161 <td class="td-action">
157 <span class="btn btn-link btn-danger revoke_perm"
162 <span class="btn btn-link btn-danger revoke_perm"
158 member="${_user_group.users_group_id}" member_type="user_group">
163 member="${_user_group.users_group_id}" member_type="user_group">
159 ${_('Remove')}
164 ${_('Remove')}
160 </span>
165 </span>
161 </td>
166 </td>
162 <td class="quick_repo_menu">
167 <td class="quick_repo_menu">
163 % if c.rhodecode_user.is_admin:
168 % if c.rhodecode_user.is_admin:
164 <i class="icon-more"></i>
169 <i class="icon-more"></i>
165 <div class="menu_items_container" style="display: none;">
170 <div class="menu_items_container" style="display: none;">
166 <ul class="menu_items">
171 <ul class="menu_items">
167 <li>
172 <li>
168 ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))}
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'))}
169 </li>
174 </li>
170 </ul>
175 </ul>
171 </div>
176 </div>
172 % endif
177 % endif
173 </td>
178 </td>
174 </tr>
179 </tr>
175 %endfor
180 %endfor
176 <tr class="new_members" id="add_perm_input"></tr>
181 <tr class="new_members" id="add_perm_input"></tr>
177
182
178 <tr>
183 <tr>
179 <td></td>
184 <td></td>
180 <td></td>
185 <td></td>
181 <td></td>
186 <td></td>
182 <td></td>
187 <td></td>
183 <td></td>
188 <td></td>
184 <td>
189 <td>
185 <span id="add_perm" class="link">
190 <span id="add_perm" class="link">
186 ${_('Add user/user group')}
191 ${_('Add user/user group')}
187 </span>
192 </span>
188 </td>
193 </td>
189 <td></td>
194 <td></td>
190 </tr>
195 </tr>
191
196
192 </table>
197 </table>
193
198
194 <div class="buttons">
199 <div class="buttons">
195 ${h.submit('save',_('Save'),class_="btn btn-primary")}
200 ${h.submit('save',_('Save'),class_="btn btn-primary")}
196 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
201 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
197 </div>
202 </div>
198 ${h.end_form()}
203 ${h.end_form()}
199 </div>
204 </div>
200 </div>
205 </div>
201
206
202 <script type="text/javascript">
207 <script type="text/javascript">
203 $('#add_perm').on('click', function(e){
208 $('#add_perm').on('click', function(e){
204 addNewPermInput($(this), 'repository');
209 addNewPermInput($(this), 'repository');
205 });
210 });
206 $('.revoke_perm').on('click', function(e){
211 $('.revoke_perm').on('click', function(e){
207 markRevokePermInput($(this), 'repository');
212 markRevokePermInput($(this), 'repository');
208 });
213 });
209 quick_repo_menu();
214 quick_repo_menu();
210
215
211 var setPrivateRepo = function (private) {
216 var setPrivateRepo = function (private) {
212 var postData = {
217 var postData = {
213 'csrf_token': CSRF_TOKEN,
218 'csrf_token': CSRF_TOKEN,
214 'private': private
219 'private': private
215 };
220 };
216
221
217 var success = function(o) {
222 var success = function(o) {
218 var defaultUrl = pyroutes.url('edit_repo_perms', {"repo_name": templateContext.repo_name});
223 var defaultUrl = pyroutes.url('edit_repo_perms', {"repo_name": templateContext.repo_name});
219 window.location = o.redirect_url || defaultUrl;
224 window.location = o.redirect_url || defaultUrl;
220 };
225 };
221
226
222 ajaxPOST(
227 ajaxPOST(
223 pyroutes.url('edit_repo_perms_set_private', {"repo_name": templateContext.repo_name}),
228 pyroutes.url('edit_repo_perms_set_private', {"repo_name": templateContext.repo_name}),
224 postData,
229 postData,
225 success);
230 success);
226 }
231 }
227 </script>
232 </script>
@@ -1,207 +1,217 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">${_('User Group Permissions')}</h3>
5 <h3 class="panel-title">${_('User Group Permissions')}</h3>
6 </div>
6 </div>
7 <div class="panel-body">
7 <div class="panel-body">
8 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), request=request)}
8 ${h.secure_form(h.route_path('edit_user_group_perms_update', user_group_id=c.user_group.users_group_id), 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>${_('User/User Group')}</th>
15 <th>${_('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.user_group.permissions():
20 %for _user in c.user_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 <span class="user">
30 <span class="user">
31 ${h.link_to_user(_user.username)}
31 ${h.link_to_user(_user.username)}
32 %if getattr(_user, 'admin_row', None):
32 %if getattr(_user, 'admin_row', None):
33 (${_('super-admin')})
33 (${_('super-admin')})
34 %endif
34 %endif
35 %if getattr(_user, 'owner_row', None):
35 %if getattr(_user, 'owner_row', None):
36 (${_('owner')})
36 (${_('owner')})
37 %endif
37 %endif
38 </span>
38 </span>
39 </td>
39 </td>
40 <td></td>
40 <td></td>
41 <td class="quick_repo_menu">
41 <td class="quick_repo_menu">
42 % if c.rhodecode_user.is_admin:
42 % if c.rhodecode_user.is_admin:
43 <i class="icon-more"></i>
43 <i class="icon-more"></i>
44 <div class="menu_items_container" style="display: none;">
44 <div class="menu_items_container" style="display: none;">
45 <ul class="menu_items">
45 <ul class="menu_items">
46 <li>
46 <li>
47 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
47 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
48 </li>
48 </li>
49 </ul>
49 </ul>
50 </div>
50 </div>
51 % endif
51 % endif
52 </td>
52 </td>
53 </tr>
53 </tr>
54 %else:
54 %else:
55 ##forbid revoking permission from yourself, except if you're an super admin
55 ##forbid revoking permission from yourself, except if you're an super admin
56 <tr>
56 <tr>
57 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
57 %if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
58 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
59 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read')}</td>
60 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
60 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write')}</td>
61 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
61 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin')}</td>
62 <td class="td-user">
62 <td class="td-user">
63 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
63 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
64 <span class="user">
64 <span class="user">
65 % if _user.username == h.DEFAULT_USER:
65 % if _user.username == h.DEFAULT_USER:
66 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
66 ${h.DEFAULT_USER}
67 % if _user.active:
68 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
69 % else:
70 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
71 % endif
67 % else:
72 % else:
68 ${h.link_to_user(_user.username)}
73 ${h.link_to_user(_user.username)}
69 %if getattr(_user, 'duplicate_perm', None):
74 %if getattr(_user, 'duplicate_perm', None):
70 (${_('inactive duplicate')})
75 (${_('inactive duplicate')})
71 %endif
76 %endif
72 % endif
77 % endif
73 </span>
78 </span>
74 </td>
79 </td>
75 <td class="td-action">
80 <td class="td-action">
76 %if _user.username != h.DEFAULT_USER:
81 %if _user.username != h.DEFAULT_USER:
77 <span class="btn btn-link btn-danger revoke_perm"
82 <span class="btn btn-link btn-danger revoke_perm"
78 member="${_user.user_id}" member_type="user">
83 member="${_user.user_id}" member_type="user">
79 ${_('Remove')}
84 ${_('Remove')}
80 </span>
85 </span>
81 %endif
86 %endif
82 </td>
87 </td>
83 <td class="quick_repo_menu">
88 <td class="quick_repo_menu">
84 % if c.rhodecode_user.is_admin:
89 % if c.rhodecode_user.is_admin:
85 <i class="icon-more"></i>
90 <i class="icon-more"></i>
86 <div class="menu_items_container" style="display: none;">
91 <div class="menu_items_container" style="display: none;">
87 <ul class="menu_items">
92 <ul class="menu_items">
88 <li>
93 <li>
89 % if _user.username == h.DEFAULT_USER:
94 % if _user.username == h.DEFAULT_USER:
90 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
95 ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='user-groups-permissions'))}
91 % else:
96 % else:
92 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
97 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
93 % endif
98 % endif
94 </li>
99 </li>
95 </ul>
100 </ul>
96 </div>
101 </div>
97 % endif
102 % endif
98 </td>
103 </td>
99 %else:
104 %else:
100 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
105 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
101 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
106 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.none', disabled="disabled")}</td>
102 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
107 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.read', disabled="disabled")}</td>
103 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
108 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.write', disabled="disabled")}</td>
104 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
109 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'usergroup.admin', disabled="disabled")}</td>
105 <td class="td-user">
110 <td class="td-user">
106 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
111 ${base.gravatar(_user.email, 16, user=_user, tooltip=True)}
107 <span class="user">
112 <span class="user">
108 % if _user.username == h.DEFAULT_USER:
113 % if _user.username == h.DEFAULT_USER:
109 ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
114 ${h.DEFAULT_USER}
115 % if _user.active:
116 <span class="user-perm-help-text"> - ${_('permission for other logged in and anonymous users')}</span>
117 % else:
118 <span class="user-perm-help-text"> - ${_('permission for other logged in users')}</span>
119 % endif
110 % else:
120 % else:
111 ${h.link_to_user(_user.username)}
121 ${h.link_to_user(_user.username)}
112 %if getattr(_user, 'duplicate_perm', None):
122 %if getattr(_user, 'duplicate_perm', None):
113 (${_('inactive duplicate')})
123 (${_('inactive duplicate')})
114 %endif
124 %endif
115 % endif
125 % endif
116 <span class="user-perm-help-text">(${_('delegated admin')})</span>
126 <span class="user-perm-help-text">(${_('delegated admin')})</span>
117 </span>
127 </span>
118 </td>
128 </td>
119 <td></td>
129 <td></td>
120 <td class="quick_repo_menu">
130 <td class="quick_repo_menu">
121 % if c.rhodecode_user.is_admin:
131 % if c.rhodecode_user.is_admin:
122 <i class="icon-more"></i>
132 <i class="icon-more"></i>
123 <div class="menu_items_container" style="display: none;">
133 <div class="menu_items_container" style="display: none;">
124 <ul class="menu_items">
134 <ul class="menu_items">
125 <li>
135 <li>
126 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
136 ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='user-groups-permissions'))}
127 </li>
137 </li>
128 </ul>
138 </ul>
129 </div>
139 </div>
130 % endif
140 % endif
131 </td>
141 </td>
132 %endif
142 %endif
133 </tr>
143 </tr>
134 %endif
144 %endif
135 %endfor
145 %endfor
136
146
137 ## USER GROUPS
147 ## USER GROUPS
138 %for _user_group in c.user_group.permission_user_groups(with_members=True):
148 %for _user_group in c.user_group.permission_user_groups(with_members=True):
139 <tr>
149 <tr>
140 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
150 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.none')}</td>
141 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
151 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.read')}</td>
142 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
152 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.write')}</td>
143 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
153 <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'usergroup.admin')}</td>
144 <td class="td-user">
154 <td class="td-user">
145 <i class="icon-user-group"></i>
155 <i class="icon-user-group"></i>
146 %if c.is_super_admin:
156 %if c.is_super_admin:
147 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
157 <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
148 ${_user_group.users_group_name}
158 ${_user_group.users_group_name}
149 </a>
159 </a>
150 %else:
160 %else:
151 ${h.link_to_group(_user_group.users_group_name)}
161 ${h.link_to_group(_user_group.users_group_name)}
152 %endif
162 %endif
153 (${_('members')}: ${len(_user_group.members)})
163 (${_('members')}: ${len(_user_group.members)})
154 </td>
164 </td>
155 <td class="td-action">
165 <td class="td-action">
156 <span class="btn btn-link btn-danger revoke_perm"
166 <span class="btn btn-link btn-danger revoke_perm"
157 member="${_user_group.users_group_id}" member_type="user_group">
167 member="${_user_group.users_group_id}" member_type="user_group">
158 ${_('Remove')}
168 ${_('Remove')}
159 </span>
169 </span>
160 </td>
170 </td>
161 <td class="quick_repo_menu">
171 <td class="quick_repo_menu">
162 % if c.rhodecode_user.is_admin:
172 % if c.rhodecode_user.is_admin:
163 <i class="icon-more"></i>
173 <i class="icon-more"></i>
164 <div class="menu_items_container" style="display: none;">
174 <div class="menu_items_container" style="display: none;">
165 <ul class="menu_items">
175 <ul class="menu_items">
166 <li>
176 <li>
167 ${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'))}
177 ${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'))}
168 </li>
178 </li>
169 </ul>
179 </ul>
170 </div>
180 </div>
171 % endif
181 % endif
172 </td>
182 </td>
173 </tr>
183 </tr>
174 %endfor
184 %endfor
175 <tr class="new_members" id="add_perm_input"></tr>
185 <tr class="new_members" id="add_perm_input"></tr>
176 <tr>
186 <tr>
177 <td></td>
187 <td></td>
178 <td></td>
188 <td></td>
179 <td></td>
189 <td></td>
180 <td></td>
190 <td></td>
181 <td></td>
191 <td></td>
182 <td>
192 <td>
183 <span id="add_perm" class="link">
193 <span id="add_perm" class="link">
184 ${_('Add user/user group')}
194 ${_('Add user/user group')}
185 </span>
195 </span>
186 </td>
196 </td>
187 <td></td>
197 <td></td>
188 </tr>
198 </tr>
189 </table>
199 </table>
190
200
191 <div class="buttons">
201 <div class="buttons">
192 ${h.submit('save',_('Save'),class_="btn btn-primary")}
202 ${h.submit('save',_('Save'),class_="btn btn-primary")}
193 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
203 ${h.reset('reset',_('Reset'),class_="btn btn-danger")}
194 </div>
204 </div>
195 ${h.end_form()}
205 ${h.end_form()}
196 </div>
206 </div>
197 </div>
207 </div>
198
208
199 <script type="text/javascript">
209 <script type="text/javascript">
200 $('#add_perm').on('click', function(e){
210 $('#add_perm').on('click', function(e){
201 addNewPermInput($(this), 'usergroup');
211 addNewPermInput($(this), 'usergroup');
202 });
212 });
203 $('.revoke_perm').on('click', function(e){
213 $('.revoke_perm').on('click', function(e){
204 markRevokePermInput($(this), 'usergroup');
214 markRevokePermInput($(this), 'usergroup');
205 });
215 });
206 quick_repo_menu()
216 quick_repo_menu()
207 </script>
217 </script>
General Comments 0
You need to be logged in to leave comments. Login now