##// END OF EJS Templates
comments: cleanup of PR versions/author tags.
marcink -
r4409:58906467 default
parent child Browse files
Show More
@@ -1,636 +1,634 b''
1 // comments.less
1 // comments.less
2 // For use in RhodeCode applications;
2 // For use in RhodeCode applications;
3 // see style guide documentation for guidelines.
3 // see style guide documentation for guidelines.
4
4
5
5
6 // Comments
6 // Comments
7 @comment-outdated-opacity: 0.6;
7 @comment-outdated-opacity: 0.6;
8
8
9 .comments {
9 .comments {
10 width: 100%;
10 width: 100%;
11 }
11 }
12
12
13 .comments-heading {
13 .comments-heading {
14 margin-bottom: -1px;
14 margin-bottom: -1px;
15 background: @grey6;
15 background: @grey6;
16 display: block;
16 display: block;
17 padding: 10px 0px;
17 padding: 10px 0px;
18 font-size: 18px
18 font-size: 18px
19 }
19 }
20
20
21 #comment-tr-show {
21 #comment-tr-show {
22 padding: 5px 0;
22 padding: 5px 0;
23 }
23 }
24
24
25 tr.inline-comments div {
25 tr.inline-comments div {
26 max-width: 100%;
26 max-width: 100%;
27
27
28 p {
28 p {
29 white-space: normal;
29 white-space: normal;
30 }
30 }
31
31
32 code, pre, .code, dd {
32 code, pre, .code, dd {
33 overflow-x: auto;
33 overflow-x: auto;
34 width: 1062px;
34 width: 1062px;
35 }
35 }
36
36
37 dd {
37 dd {
38 width: auto;
38 width: auto;
39 }
39 }
40 }
40 }
41
41
42 #injected_page_comments {
42 #injected_page_comments {
43 .comment-previous-link,
43 .comment-previous-link,
44 .comment-next-link,
44 .comment-next-link,
45 .comment-links-divider {
45 .comment-links-divider {
46 display: none;
46 display: none;
47 }
47 }
48 }
48 }
49
49
50 .add-comment {
50 .add-comment {
51 margin-bottom: 10px;
51 margin-bottom: 10px;
52 }
52 }
53 .hide-comment-button .add-comment {
53 .hide-comment-button .add-comment {
54 display: none;
54 display: none;
55 }
55 }
56
56
57 .comment-bubble {
57 .comment-bubble {
58 color: @grey4;
58 color: @grey4;
59 margin-top: 4px;
59 margin-top: 4px;
60 margin-right: 30px;
60 margin-right: 30px;
61 visibility: hidden;
61 visibility: hidden;
62 }
62 }
63
63
64 .comment-label {
64 .comment-label {
65 float: left;
65 float: left;
66
66
67 padding: 0.4em 0.4em;
67 padding: 0.4em 0.4em;
68 margin: 3px 5px 0px -10px;
68 margin: 3px 5px 0px -10px;
69 display: inline-block;
69 display: inline-block;
70 min-height: 0;
70 min-height: 0;
71
71
72 text-align: center;
72 text-align: center;
73 font-size: 10px;
73 font-size: 10px;
74 line-height: .8em;
74 line-height: .8em;
75
75
76 font-family: @text-italic;
76 font-family: @text-italic;
77 font-style: italic;
77 font-style: italic;
78 background: #fff none;
78 background: #fff none;
79 color: @grey4;
79 color: @grey4;
80 border: 1px solid @grey4;
80 border: 1px solid @grey4;
81 white-space: nowrap;
81 white-space: nowrap;
82
82
83 text-transform: uppercase;
83 text-transform: uppercase;
84 min-width: 40px;
84 min-width: 40px;
85
85
86 &.todo {
86 &.todo {
87 color: @color5;
87 color: @color5;
88 font-style: italic;
88 font-style: italic;
89 font-weight: @text-bold-italic-weight;
89 font-weight: @text-bold-italic-weight;
90 font-family: @text-bold-italic;
90 font-family: @text-bold-italic;
91 }
91 }
92
92
93 .resolve {
93 .resolve {
94 cursor: pointer;
94 cursor: pointer;
95 text-decoration: underline;
95 text-decoration: underline;
96 }
96 }
97
97
98 .resolved {
98 .resolved {
99 text-decoration: line-through;
99 text-decoration: line-through;
100 color: @color1;
100 color: @color1;
101 }
101 }
102 .resolved a {
102 .resolved a {
103 text-decoration: line-through;
103 text-decoration: line-through;
104 color: @color1;
104 color: @color1;
105 }
105 }
106 .resolve-text {
106 .resolve-text {
107 color: @color1;
107 color: @color1;
108 margin: 2px 8px;
108 margin: 2px 8px;
109 font-family: @text-italic;
109 font-family: @text-italic;
110 font-style: italic;
110 font-style: italic;
111 }
111 }
112 }
112 }
113
113
114 .has-spacer-after {
114 .has-spacer-after {
115 &:after {
115 &:after {
116 content: ' | ';
116 content: ' | ';
117 color: @grey5;
117 color: @grey5;
118 }
118 }
119 }
119 }
120
120
121 .has-spacer-before {
121 .has-spacer-before {
122 &:before {
122 &:before {
123 content: ' | ';
123 content: ' | ';
124 color: @grey5;
124 color: @grey5;
125 }
125 }
126 }
126 }
127
127
128 .comment {
128 .comment {
129
129
130 &.comment-general {
130 &.comment-general {
131 border: 1px solid @grey5;
131 border: 1px solid @grey5;
132 padding: 5px 5px 5px 5px;
132 padding: 5px 5px 5px 5px;
133 }
133 }
134
134
135 margin: @padding 0;
135 margin: @padding 0;
136 padding: 4px 0 0 0;
136 padding: 4px 0 0 0;
137 line-height: 1em;
137 line-height: 1em;
138
138
139 .rc-user {
139 .rc-user {
140 min-width: 0;
140 min-width: 0;
141 margin: 0px .5em 0 0;
141 margin: 0px .5em 0 0;
142
142
143 .user {
143 .user {
144 display: inline;
144 display: inline;
145 }
145 }
146 }
146 }
147
147
148 .meta {
148 .meta {
149 position: relative;
149 position: relative;
150 width: 100%;
150 width: 100%;
151 border-bottom: 1px solid @grey5;
151 border-bottom: 1px solid @grey5;
152 margin: -5px 0px;
152 margin: -5px 0px;
153 line-height: 24px;
153 line-height: 24px;
154
154
155 &:hover .permalink {
155 &:hover .permalink {
156 visibility: visible;
156 visibility: visible;
157 color: @rcblue;
157 color: @rcblue;
158 }
158 }
159 }
159 }
160
160
161 .author,
161 .author,
162 .date {
162 .date {
163 display: inline;
163 display: inline;
164
164
165 &:after {
165 &:after {
166 content: ' | ';
166 content: ' | ';
167 color: @grey5;
167 color: @grey5;
168 }
168 }
169 }
169 }
170
170
171 .author-general img {
171 .author-general img {
172 top: 3px;
172 top: 3px;
173 }
173 }
174 .author-inline img {
174 .author-inline img {
175 top: 3px;
175 top: 3px;
176 }
176 }
177
177
178 .status-change,
178 .status-change,
179 .permalink,
179 .permalink,
180 .changeset-status-lbl {
180 .changeset-status-lbl {
181 display: inline;
181 display: inline;
182 }
182 }
183
183
184 .permalink {
184 .permalink {
185 visibility: hidden;
185 visibility: hidden;
186 }
186 }
187
187
188 .comment-links-divider {
188 .comment-links-divider {
189 display: inline;
189 display: inline;
190 }
190 }
191
191
192 .comment-links-block {
192 .comment-links-block {
193 float:right;
193 float:right;
194 text-align: right;
194 text-align: right;
195 min-width: 85px;
195 min-width: 85px;
196
196
197 [class^="icon-"]:before,
197 [class^="icon-"]:before,
198 [class*=" icon-"]:before {
198 [class*=" icon-"]:before {
199 margin-left: 0;
199 margin-left: 0;
200 margin-right: 0;
200 margin-right: 0;
201 }
201 }
202 }
202 }
203
203
204 .comment-previous-link {
204 .comment-previous-link {
205 display: inline-block;
205 display: inline-block;
206
206
207 .arrow_comment_link{
207 .arrow_comment_link{
208 cursor: pointer;
208 cursor: pointer;
209 i {
209 i {
210 font-size:10px;
210 font-size:10px;
211 }
211 }
212 }
212 }
213 .arrow_comment_link.disabled {
213 .arrow_comment_link.disabled {
214 cursor: default;
214 cursor: default;
215 color: @grey5;
215 color: @grey5;
216 }
216 }
217 }
217 }
218
218
219 .comment-next-link {
219 .comment-next-link {
220 display: inline-block;
220 display: inline-block;
221
221
222 .arrow_comment_link{
222 .arrow_comment_link{
223 cursor: pointer;
223 cursor: pointer;
224 i {
224 i {
225 font-size:10px;
225 font-size:10px;
226 }
226 }
227 }
227 }
228 .arrow_comment_link.disabled {
228 .arrow_comment_link.disabled {
229 cursor: default;
229 cursor: default;
230 color: @grey5;
230 color: @grey5;
231 }
231 }
232 }
232 }
233
233
234 .delete-comment {
234 .delete-comment {
235 display: inline-block;
235 display: inline-block;
236 color: @rcblue;
236 color: @rcblue;
237
237
238 &:hover {
238 &:hover {
239 cursor: pointer;
239 cursor: pointer;
240 }
240 }
241 }
241 }
242
242
243 .text {
243 .text {
244 clear: both;
244 clear: both;
245 .border-radius(@border-radius);
245 .border-radius(@border-radius);
246 .box-sizing(border-box);
246 .box-sizing(border-box);
247
247
248 .markdown-block p,
248 .markdown-block p,
249 .rst-block p {
249 .rst-block p {
250 margin: .5em 0 !important;
250 margin: .5em 0 !important;
251 // TODO: lisa: This is needed because of other rst !important rules :[
251 // TODO: lisa: This is needed because of other rst !important rules :[
252 }
252 }
253 }
253 }
254
254
255 .pr-version {
255 .pr-version {
256 float: left;
256 display: inline-block;
257 margin: 0px 4px;
258 }
257 }
259 .pr-version-inline {
258 .pr-version-inline {
260 float: left;
259 display: inline-block;
261 margin: 0px 4px;
262 }
260 }
263 .pr-version-num {
261 .pr-version-num {
264 font-size: 10px;
262 font-size: 10px;
265 }
263 }
266 }
264 }
267
265
268 @comment-padding: 5px;
266 @comment-padding: 5px;
269
267
270 .general-comments {
268 .general-comments {
271 .comment-outdated {
269 .comment-outdated {
272 opacity: @comment-outdated-opacity;
270 opacity: @comment-outdated-opacity;
273 }
271 }
274 }
272 }
275
273
276 .inline-comments {
274 .inline-comments {
277 border-radius: @border-radius;
275 border-radius: @border-radius;
278 .comment {
276 .comment {
279 margin: 0;
277 margin: 0;
280 border-radius: @border-radius;
278 border-radius: @border-radius;
281 }
279 }
282 .comment-outdated {
280 .comment-outdated {
283 opacity: @comment-outdated-opacity;
281 opacity: @comment-outdated-opacity;
284 }
282 }
285
283
286 .comment-inline {
284 .comment-inline {
287 background: white;
285 background: white;
288 padding: @comment-padding @comment-padding;
286 padding: @comment-padding @comment-padding;
289 border: @comment-padding solid @grey6;
287 border: @comment-padding solid @grey6;
290
288
291 .text {
289 .text {
292 border: none;
290 border: none;
293 }
291 }
294 .meta {
292 .meta {
295 border-bottom: 1px solid @grey6;
293 border-bottom: 1px solid @grey6;
296 margin: -5px 0px;
294 margin: -5px 0px;
297 line-height: 24px;
295 line-height: 24px;
298 }
296 }
299 }
297 }
300 .comment-selected {
298 .comment-selected {
301 border-left: 6px solid @comment-highlight-color;
299 border-left: 6px solid @comment-highlight-color;
302 }
300 }
303 .comment-inline-form {
301 .comment-inline-form {
304 padding: @comment-padding;
302 padding: @comment-padding;
305 display: none;
303 display: none;
306 }
304 }
307 .cb-comment-add-button {
305 .cb-comment-add-button {
308 margin: @comment-padding;
306 margin: @comment-padding;
309 }
307 }
310 /* hide add comment button when form is open */
308 /* hide add comment button when form is open */
311 .comment-inline-form-open ~ .cb-comment-add-button {
309 .comment-inline-form-open ~ .cb-comment-add-button {
312 display: none;
310 display: none;
313 }
311 }
314 .comment-inline-form-open {
312 .comment-inline-form-open {
315 display: block;
313 display: block;
316 }
314 }
317 /* hide add comment button when form but no comments */
315 /* hide add comment button when form but no comments */
318 .comment-inline-form:first-child + .cb-comment-add-button {
316 .comment-inline-form:first-child + .cb-comment-add-button {
319 display: none;
317 display: none;
320 }
318 }
321 /* hide add comment button when no comments or form */
319 /* hide add comment button when no comments or form */
322 .cb-comment-add-button:first-child {
320 .cb-comment-add-button:first-child {
323 display: none;
321 display: none;
324 }
322 }
325 /* hide add comment button when only comment is being deleted */
323 /* hide add comment button when only comment is being deleted */
326 .comment-deleting:first-child + .cb-comment-add-button {
324 .comment-deleting:first-child + .cb-comment-add-button {
327 display: none;
325 display: none;
328 }
326 }
329 }
327 }
330
328
331
329
332 .show-outdated-comments {
330 .show-outdated-comments {
333 display: inline;
331 display: inline;
334 color: @rcblue;
332 color: @rcblue;
335 }
333 }
336
334
337 // Comment Form
335 // Comment Form
338 div.comment-form {
336 div.comment-form {
339 margin-top: 20px;
337 margin-top: 20px;
340 }
338 }
341
339
342 .comment-form strong {
340 .comment-form strong {
343 display: block;
341 display: block;
344 margin-bottom: 15px;
342 margin-bottom: 15px;
345 }
343 }
346
344
347 .comment-form textarea {
345 .comment-form textarea {
348 width: 100%;
346 width: 100%;
349 height: 100px;
347 height: 100px;
350 font-family: @text-monospace;
348 font-family: @text-monospace;
351 }
349 }
352
350
353 form.comment-form {
351 form.comment-form {
354 margin-top: 10px;
352 margin-top: 10px;
355 margin-left: 10px;
353 margin-left: 10px;
356 }
354 }
357
355
358 .comment-inline-form .comment-block-ta,
356 .comment-inline-form .comment-block-ta,
359 .comment-form .comment-block-ta,
357 .comment-form .comment-block-ta,
360 .comment-form .preview-box {
358 .comment-form .preview-box {
361 .border-radius(@border-radius);
359 .border-radius(@border-radius);
362 .box-sizing(border-box);
360 .box-sizing(border-box);
363 background-color: white;
361 background-color: white;
364 }
362 }
365
363
366 .comment-form-submit {
364 .comment-form-submit {
367 margin-top: 5px;
365 margin-top: 5px;
368 margin-left: 525px;
366 margin-left: 525px;
369 }
367 }
370
368
371 .file-comments {
369 .file-comments {
372 display: none;
370 display: none;
373 }
371 }
374
372
375 .comment-form .preview-box.unloaded,
373 .comment-form .preview-box.unloaded,
376 .comment-inline-form .preview-box.unloaded {
374 .comment-inline-form .preview-box.unloaded {
377 height: 50px;
375 height: 50px;
378 text-align: center;
376 text-align: center;
379 padding: 20px;
377 padding: 20px;
380 background-color: white;
378 background-color: white;
381 }
379 }
382
380
383 .comment-footer {
381 .comment-footer {
384 position: relative;
382 position: relative;
385 width: 100%;
383 width: 100%;
386 min-height: 42px;
384 min-height: 42px;
387
385
388 .status_box,
386 .status_box,
389 .cancel-button {
387 .cancel-button {
390 float: left;
388 float: left;
391 display: inline-block;
389 display: inline-block;
392 }
390 }
393
391
394 .status_box {
392 .status_box {
395 margin-left: 10px;
393 margin-left: 10px;
396 }
394 }
397
395
398 .action-buttons {
396 .action-buttons {
399 float: left;
397 float: left;
400 display: inline-block;
398 display: inline-block;
401 }
399 }
402
400
403 .action-buttons-extra {
401 .action-buttons-extra {
404 display: inline-block;
402 display: inline-block;
405 }
403 }
406 }
404 }
407
405
408 .comment-form {
406 .comment-form {
409
407
410 .comment {
408 .comment {
411 margin-left: 10px;
409 margin-left: 10px;
412 }
410 }
413
411
414 .comment-help {
412 .comment-help {
415 color: @grey4;
413 color: @grey4;
416 padding: 5px 0 5px 0;
414 padding: 5px 0 5px 0;
417 }
415 }
418
416
419 .comment-title {
417 .comment-title {
420 padding: 5px 0 5px 0;
418 padding: 5px 0 5px 0;
421 }
419 }
422
420
423 .comment-button {
421 .comment-button {
424 display: inline-block;
422 display: inline-block;
425 }
423 }
426
424
427 .comment-button-input {
425 .comment-button-input {
428 margin-right: 0;
426 margin-right: 0;
429 }
427 }
430
428
431 .comment-footer {
429 .comment-footer {
432 margin-bottom: 50px;
430 margin-bottom: 50px;
433 margin-top: 10px;
431 margin-top: 10px;
434 }
432 }
435 }
433 }
436
434
437
435
438 .comment-form-login {
436 .comment-form-login {
439 .comment-help {
437 .comment-help {
440 padding: 0.7em; //same as the button
438 padding: 0.7em; //same as the button
441 }
439 }
442
440
443 div.clearfix {
441 div.clearfix {
444 clear: both;
442 clear: both;
445 width: 100%;
443 width: 100%;
446 display: block;
444 display: block;
447 }
445 }
448 }
446 }
449
447
450 .comment-version-select {
448 .comment-version-select {
451 margin: 0px;
449 margin: 0px;
452 border-radius: inherit;
450 border-radius: inherit;
453 border-color: @grey6;
451 border-color: @grey6;
454 height: 20px;
452 height: 20px;
455 }
453 }
456
454
457 .comment-type {
455 .comment-type {
458 margin: 0px;
456 margin: 0px;
459 border-radius: inherit;
457 border-radius: inherit;
460 border-color: @grey6;
458 border-color: @grey6;
461 }
459 }
462
460
463 .preview-box {
461 .preview-box {
464 min-height: 105px;
462 min-height: 105px;
465 margin-bottom: 15px;
463 margin-bottom: 15px;
466 background-color: white;
464 background-color: white;
467 .border-radius(@border-radius);
465 .border-radius(@border-radius);
468 .box-sizing(border-box);
466 .box-sizing(border-box);
469 }
467 }
470
468
471 .add-another-button {
469 .add-another-button {
472 margin-left: 10px;
470 margin-left: 10px;
473 margin-top: 10px;
471 margin-top: 10px;
474 margin-bottom: 10px;
472 margin-bottom: 10px;
475 }
473 }
476
474
477 .comment .buttons {
475 .comment .buttons {
478 float: right;
476 float: right;
479 margin: -1px 0px 0px 0px;
477 margin: -1px 0px 0px 0px;
480 }
478 }
481
479
482 // Inline Comment Form
480 // Inline Comment Form
483 .injected_diff .comment-inline-form,
481 .injected_diff .comment-inline-form,
484 .comment-inline-form {
482 .comment-inline-form {
485 background-color: white;
483 background-color: white;
486 margin-top: 10px;
484 margin-top: 10px;
487 margin-bottom: 20px;
485 margin-bottom: 20px;
488 }
486 }
489
487
490 .inline-form {
488 .inline-form {
491 padding: 10px 7px;
489 padding: 10px 7px;
492 }
490 }
493
491
494 .inline-form div {
492 .inline-form div {
495 max-width: 100%;
493 max-width: 100%;
496 }
494 }
497
495
498 .overlay {
496 .overlay {
499 display: none;
497 display: none;
500 position: absolute;
498 position: absolute;
501 width: 100%;
499 width: 100%;
502 text-align: center;
500 text-align: center;
503 vertical-align: middle;
501 vertical-align: middle;
504 font-size: 16px;
502 font-size: 16px;
505 background: none repeat scroll 0 0 white;
503 background: none repeat scroll 0 0 white;
506
504
507 &.submitting {
505 &.submitting {
508 display: block;
506 display: block;
509 opacity: 0.5;
507 opacity: 0.5;
510 z-index: 100;
508 z-index: 100;
511 }
509 }
512 }
510 }
513 .comment-inline-form .overlay.submitting .overlay-text {
511 .comment-inline-form .overlay.submitting .overlay-text {
514 margin-top: 5%;
512 margin-top: 5%;
515 }
513 }
516
514
517 .comment-inline-form .clearfix,
515 .comment-inline-form .clearfix,
518 .comment-form .clearfix {
516 .comment-form .clearfix {
519 .border-radius(@border-radius);
517 .border-radius(@border-radius);
520 margin: 0px;
518 margin: 0px;
521 }
519 }
522
520
523 .comment-inline-form .comment-footer {
521 .comment-inline-form .comment-footer {
524 margin: 10px 0px 0px 0px;
522 margin: 10px 0px 0px 0px;
525 }
523 }
526
524
527 .hide-inline-form-button {
525 .hide-inline-form-button {
528 margin-left: 5px;
526 margin-left: 5px;
529 }
527 }
530 .comment-button .hide-inline-form {
528 .comment-button .hide-inline-form {
531 background: white;
529 background: white;
532 }
530 }
533
531
534 .comment-area {
532 .comment-area {
535 padding: 6px 8px;
533 padding: 6px 8px;
536 border: 1px solid @grey5;
534 border: 1px solid @grey5;
537 .border-radius(@border-radius);
535 .border-radius(@border-radius);
538
536
539 .resolve-action {
537 .resolve-action {
540 padding: 1px 0px 0px 6px;
538 padding: 1px 0px 0px 6px;
541 }
539 }
542
540
543 }
541 }
544
542
545 comment-area-text {
543 comment-area-text {
546 color: @grey3;
544 color: @grey3;
547 }
545 }
548
546
549 .comment-area-header {
547 .comment-area-header {
550 height: 35px;
548 height: 35px;
551 }
549 }
552
550
553 .comment-area-header .nav-links {
551 .comment-area-header .nav-links {
554 display: flex;
552 display: flex;
555 flex-flow: row wrap;
553 flex-flow: row wrap;
556 -webkit-flex-flow: row wrap;
554 -webkit-flex-flow: row wrap;
557 width: 100%;
555 width: 100%;
558 }
556 }
559
557
560 .comment-area-footer {
558 .comment-area-footer {
561 min-height: 30px;
559 min-height: 30px;
562 }
560 }
563
561
564 .comment-footer .toolbar {
562 .comment-footer .toolbar {
565
563
566 }
564 }
567
565
568 .comment-attachment-uploader {
566 .comment-attachment-uploader {
569 border: 1px dashed white;
567 border: 1px dashed white;
570 border-radius: @border-radius;
568 border-radius: @border-radius;
571 margin-top: -10px;
569 margin-top: -10px;
572 line-height: 30px;
570 line-height: 30px;
573 &.dz-drag-hover {
571 &.dz-drag-hover {
574 border-color: @grey3;
572 border-color: @grey3;
575 }
573 }
576
574
577 .dz-error-message {
575 .dz-error-message {
578 padding-top: 0;
576 padding-top: 0;
579 }
577 }
580 }
578 }
581
579
582 .comment-attachment-text {
580 .comment-attachment-text {
583 clear: both;
581 clear: both;
584 font-size: 11px;
582 font-size: 11px;
585 color: #8F8F8F;
583 color: #8F8F8F;
586 width: 100%;
584 width: 100%;
587 .pick-attachment {
585 .pick-attachment {
588 color: #8F8F8F;
586 color: #8F8F8F;
589 }
587 }
590 .pick-attachment:hover {
588 .pick-attachment:hover {
591 color: @rcblue;
589 color: @rcblue;
592 }
590 }
593 }
591 }
594
592
595 .nav-links {
593 .nav-links {
596 padding: 0;
594 padding: 0;
597 margin: 0;
595 margin: 0;
598 list-style: none;
596 list-style: none;
599 height: auto;
597 height: auto;
600 border-bottom: 1px solid @grey5;
598 border-bottom: 1px solid @grey5;
601 }
599 }
602 .nav-links li {
600 .nav-links li {
603 display: inline-block;
601 display: inline-block;
604 list-style-type: none;
602 list-style-type: none;
605 }
603 }
606
604
607 .nav-links li a.disabled {
605 .nav-links li a.disabled {
608 cursor: not-allowed;
606 cursor: not-allowed;
609 }
607 }
610
608
611 .nav-links li.active a {
609 .nav-links li.active a {
612 border-bottom: 2px solid @rcblue;
610 border-bottom: 2px solid @rcblue;
613 color: #000;
611 color: #000;
614 font-weight: 600;
612 font-weight: 600;
615 }
613 }
616 .nav-links li a {
614 .nav-links li a {
617 display: inline-block;
615 display: inline-block;
618 padding: 0px 10px 5px 10px;
616 padding: 0px 10px 5px 10px;
619 margin-bottom: -1px;
617 margin-bottom: -1px;
620 font-size: 14px;
618 font-size: 14px;
621 line-height: 28px;
619 line-height: 28px;
622 color: #8f8f8f;
620 color: #8f8f8f;
623 border-bottom: 2px solid transparent;
621 border-bottom: 2px solid transparent;
624 }
622 }
625
623
626 .toolbar-text {
624 .toolbar-text {
627 float: right;
625 float: right;
628 font-size: 11px;
626 font-size: 11px;
629 color: @grey4;
627 color: @grey4;
630 text-align: right;
628 text-align: right;
631
629
632 a {
630 a {
633 color: @grey4;
631 color: @grey4;
634 }
632 }
635 }
633 }
636
634
@@ -1,171 +1,175 b''
1 // tags.less
1 // tags.less
2 // For use in RhodeCode applications;
2 // For use in RhodeCode applications;
3 // see style guide documentation for guidelines.
3 // see style guide documentation for guidelines.
4
4
5 // TAGS
5 // TAGS
6 .tag,
6 .tag,
7 .tagtag {
7 .tagtag {
8 display: inline-block;
8 display: inline-block;
9 min-height: 0;
9 min-height: 0;
10 margin: 0 auto;
10 margin: 0 auto;
11 padding: .25em;
11 padding: .25em;
12 text-align: center;
12 text-align: center;
13 font-size: (-1 + @basefontsize); //fit in tables
13 font-size: (-1 + @basefontsize); //fit in tables
14 line-height: 1.1em;
14 line-height: 1.1em;
15 border: none;
15 border: none;
16 box-shadow: @button-shadow;
16 box-shadow: @button-shadow;
17 .border-radius(@border-radius);
17 .border-radius(@border-radius);
18 font-family: @text-regular;
18 font-family: @text-regular;
19 background-image: none;
19 background-image: none;
20 color: @grey4;
20 color: @grey4;
21 .border ( @border-thickness-tags, @grey5 );
21 .border ( @border-thickness-tags, @grey5 );
22 white-space: nowrap;
22 white-space: nowrap;
23 a {
23 a {
24 color: inherit;
24 color: inherit;
25
25
26 &:hover {
26 &:hover {
27 color: @grey2;
27 color: @grey2;
28 }
28 }
29
29
30 i,
30 i,
31 [class^="icon-"]:before,
31 [class^="icon-"]:before,
32 [class*=" icon-"]:before {
32 [class*=" icon-"]:before {
33 text-decoration: none;
33 text-decoration: none;
34 }
34 }
35 }
35 }
36
36
37 &:hover {
37 &:hover {
38 border-color: @grey4;
38 border-color: @grey4;
39 }
39 }
40
41 &.authortag {
42 padding: 2px;
43 }
40 }
44 }
41
45
42 .tag0 { .border ( @border-thickness-tags, @grey4 ); color:@grey4; }
46 .tag0 { .border ( @border-thickness-tags, @grey4 ); color:@grey4; }
43 .tag1 { .border ( @border-thickness-tags, @color1 ); color:@color1; }
47 .tag1 { .border ( @border-thickness-tags, @color1 ); color:@color1; }
44 .tag2 { .border ( @border-thickness-tags, @color2 ); color:@color2; }
48 .tag2 { .border ( @border-thickness-tags, @color2 ); color:@color2; }
45 .tag3 { .border ( @border-thickness-tags, @color3 ); color:@color3; }
49 .tag3 { .border ( @border-thickness-tags, @color3 ); color:@color3; }
46 .tag4 { .border ( @border-thickness-tags, @color4 ); color:@color4; }
50 .tag4 { .border ( @border-thickness-tags, @color4 ); color:@color4; }
47 .tag5 { .border ( @border-thickness-tags, @color5 ); color:@color5; }
51 .tag5 { .border ( @border-thickness-tags, @color5 ); color:@color5; }
48 .tag6 { .border ( @border-thickness-tags, @color6 ); color:@color6; }
52 .tag6 { .border ( @border-thickness-tags, @color6 ); color:@color6; }
49 .tag7 { .border ( @border-thickness-tags, @color7 ); color:@color7; }
53 .tag7 { .border ( @border-thickness-tags, @color7 ); color:@color7; }
50 .tag8 { .border ( @border-thickness-tags, @color8 ); color:@color8; }
54 .tag8 { .border ( @border-thickness-tags, @color8 ); color:@color8; }
51
55
52
56
53 .tag-gist-public {
57 .tag-gist-public {
54 .border (@border-thickness-tags, @color1);
58 .border (@border-thickness-tags, @color1);
55 color: @color1;
59 color: @color1;
56 }
60 }
57
61
58
62
59 .tag-gist-private {
63 .tag-gist-private {
60 .border (@border-thickness-tags, @color2);
64 .border (@border-thickness-tags, @color2);
61 color: @color2;
65 color: @color2;
62 }
66 }
63
67
64
68
65 .tag-merge-state-created {
69 .tag-merge-state-created {
66 color: @color1;
70 color: @color1;
67 }
71 }
68
72
69 .tag-merge-state-creating {
73 .tag-merge-state-creating {
70 color: @color1;
74 color: @color1;
71 }
75 }
72
76
73 .tag-merge-state-merging {
77 .tag-merge-state-merging {
74 color: @color3;
78 color: @color3;
75 }
79 }
76
80
77 .tag-merge-state-updating {
81 .tag-merge-state-updating {
78 color: @color3;
82 color: @color3;
79 }
83 }
80
84
81
85
82 .metatag-list {
86 .metatag-list {
83 margin: 0;
87 margin: 0;
84 padding: 0;
88 padding: 0;
85
89
86 li {
90 li {
87 margin: 0 0 @padding;
91 margin: 0 0 @padding;
88 line-height: 1em;
92 line-height: 1em;
89 list-style-type: none;
93 list-style-type: none;
90 }
94 }
91 }
95 }
92
96
93 .branchtag, .booktag {
97 .branchtag, .booktag {
94 &:extend(.tag);
98 &:extend(.tag);
95
99
96
100
97 a {
101 a {
98 color:inherit;
102 color:inherit;
99 }
103 }
100 }
104 }
101
105
102 .metatag {
106 .metatag {
103 &:extend(.tag);
107 &:extend(.tag);
104 a {
108 a {
105 color:inherit;
109 color:inherit;
106 text-decoration: underline;
110 text-decoration: underline;
107 }
111 }
108 }
112 }
109
113
110 [tag="generic"] { &:extend(.tag0); }
114 [tag="generic"] { &:extend(.tag0); }
111 [tag="label"] { &:extend(.tag0); }
115 [tag="label"] { &:extend(.tag0); }
112
116
113 [tag="state featured"] { &:extend(.tag1); }
117 [tag="state featured"] { &:extend(.tag1); }
114 [tag="state dev"] { &:extend(.tag1); }
118 [tag="state dev"] { &:extend(.tag1); }
115 [tag="ref base"] { &:extend(.tag1); }
119 [tag="ref base"] { &:extend(.tag1); }
116
120
117 [tag="state stable"] { &:extend(.tag2); }
121 [tag="state stable"] { &:extend(.tag2); }
118 [tag="state stale"] { &:extend(.tag2); }
122 [tag="state stale"] { &:extend(.tag2); }
119
123
120 [tag="ref requires"] { &:extend(.tag3); }
124 [tag="ref requires"] { &:extend(.tag3); }
121
125
122 [tag="state dead"] { &:extend(.tag4); }
126 [tag="state dead"] { &:extend(.tag4); }
123 [tag="state deprecated"] { &:extend(.tag4); }
127 [tag="state deprecated"] { &:extend(.tag4); }
124
128
125 [tag="ref conflicts"] { &:extend(.tag4); }
129 [tag="ref conflicts"] { &:extend(.tag4); }
126
130
127 [tag="license"] { &:extend(.tag6); }
131 [tag="license"] { &:extend(.tag6); }
128
132
129 [tag="lang"] { &:extend(.tag7); }
133 [tag="lang"] { &:extend(.tag7); }
130 [tag="language"] { &:extend(.tag7); }
134 [tag="language"] { &:extend(.tag7); }
131 [tag="ref recommends"] { &:extend(.tag7); }
135 [tag="ref recommends"] { &:extend(.tag7); }
132
136
133 [tag="see"] { &:extend(.tag8); }
137 [tag="see"] { &:extend(.tag8); }
134 [tag="url"] { &:extend(.tag8); }
138 [tag="url"] { &:extend(.tag8); }
135
139
136
140
137 .perm_overriden {
141 .perm_overriden {
138 text-decoration: line-through;
142 text-decoration: line-through;
139 opacity: 0.6;
143 opacity: 0.6;
140 }
144 }
141
145
142 .perm_tag {
146 .perm_tag {
143 &:extend(.tag);
147 &:extend(.tag);
144
148
145 &.read {
149 &.read {
146 &:extend(.tag1);
150 &:extend(.tag1);
147 }
151 }
148 &.write {
152 &.write {
149 &:extend(.tag4);
153 &:extend(.tag4);
150 }
154 }
151 &.admin {
155 &.admin {
152 &:extend(.tag5);
156 &:extend(.tag5);
153 }
157 }
154 &.merge {
158 &.merge {
155 &:extend(.tag1);
159 &:extend(.tag1);
156 }
160 }
157 &.push {
161 &.push {
158 &:extend(.tag4);
162 &:extend(.tag4);
159 }
163 }
160 &.push_force {
164 &.push_force {
161 &:extend(.tag5);
165 &:extend(.tag5);
162 }
166 }
163 }
167 }
164
168
165 .phase-draft {
169 .phase-draft {
166 color: @color3
170 color: @color3
167 }
171 }
168
172
169 .phase-secret {
173 .phase-secret {
170 color:@grey3
174 color:@grey3
171 }
175 }
@@ -1,479 +1,481 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 ## usage:
2 ## usage:
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
4 ## ${comment.comment_block(comment)}
4 ## ${comment.comment_block(comment)}
5 ##
5 ##
6
6
7 <%!
7 <%!
8 from rhodecode.lib import html_filters
8 from rhodecode.lib import html_filters
9 %>
9 %>
10
10
11 <%namespace name="base" file="/base/base.mako"/>
11 <%namespace name="base" file="/base/base.mako"/>
12 <%def name="comment_block(comment, inline=False, active_pattern_entries=None)">
12 <%def name="comment_block(comment, inline=False, active_pattern_entries=None)">
13 <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %>
13 <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %>
14 <% latest_ver = len(getattr(c, 'versions', [])) %>
14 <% latest_ver = len(getattr(c, 'versions', [])) %>
15 % if inline:
15 % if inline:
16 <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %>
16 <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %>
17 % else:
17 % else:
18 <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %>
18 <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %>
19 % endif
19 % endif
20
20
21 <div class="comment
21 <div class="comment
22 ${'comment-inline' if inline else 'comment-general'}
22 ${'comment-inline' if inline else 'comment-general'}
23 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
23 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
24 id="comment-${comment.comment_id}"
24 id="comment-${comment.comment_id}"
25 line="${comment.line_no}"
25 line="${comment.line_no}"
26 data-comment-id="${comment.comment_id}"
26 data-comment-id="${comment.comment_id}"
27 data-comment-type="${comment.comment_type}"
27 data-comment-type="${comment.comment_type}"
28 data-comment-renderer="${comment.renderer}"
28 data-comment-renderer="${comment.renderer}"
29 data-comment-text="${comment.text | html_filters.base64,n}"
29 data-comment-text="${comment.text | html_filters.base64,n}"
30 data-comment-line-no="${comment.line_no}"
30 data-comment-line-no="${comment.line_no}"
31 data-comment-inline=${h.json.dumps(inline)}
31 data-comment-inline=${h.json.dumps(inline)}
32 style="${'display: none;' if outdated_at_ver else ''}">
32 style="${'display: none;' if outdated_at_ver else ''}">
33
33
34 <div class="meta">
34 <div class="meta">
35 <div class="comment-type-label">
35 <div class="comment-type-label">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}" title="line: ${comment.line_no}">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}" title="line: ${comment.line_no}">
37 % if comment.comment_type == 'todo':
37 % if comment.comment_type == 'todo':
38 % if comment.resolved:
38 % if comment.resolved:
39 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
39 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
40 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
40 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
41 </div>
41 </div>
42 % else:
42 % else:
43 <div class="resolved tooltip" style="display: none">
43 <div class="resolved tooltip" style="display: none">
44 <span>${comment.comment_type}</span>
44 <span>${comment.comment_type}</span>
45 </div>
45 </div>
46 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}">
46 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}">
47 ${comment.comment_type}
47 ${comment.comment_type}
48 </div>
48 </div>
49 % endif
49 % endif
50 % else:
50 % else:
51 % if comment.resolved_comment:
51 % if comment.resolved_comment:
52 fix
52 fix
53 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
53 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
54 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
54 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
55 </a>
55 </a>
56 % else:
56 % else:
57 ${comment.comment_type or 'note'}
57 ${comment.comment_type or 'note'}
58 % endif
58 % endif
59 % endif
59 % endif
60 </div>
60 </div>
61 </div>
61 </div>
62
62
63 <div class="author ${'author-inline' if inline else 'author-general'}">
63 <div class="author ${'author-inline' if inline else 'author-general'}">
64 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
64 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
65
66 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
67 <span class="tag authortag tooltip" title="${_('Pull request author')}">
68 ${_('author')}
69 </span>
70 % endif
71
65 </div>
72 </div>
66 <div class="date">
73 <div class="date">
67 ${h.age_component(comment.modified_at, time_is_local=True)}
74 ${h.age_component(comment.modified_at, time_is_local=True)}
68 </div>
75 </div>
69 <%
76 <%
70 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
77 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
71 %>
78 %>
72
79
73 % if comment.history:
80 % if comment.history:
74 <div class="date">
81 <div class="date">
75
82
76 <input id="${comment_version_selector}" name="${comment_version_selector}"
83 <input id="${comment_version_selector}" name="${comment_version_selector}"
77 type="hidden"
84 type="hidden"
78 data-last-version="${comment.history[-1].version}">
85 data-last-version="${comment.history[-1].version}">
79
86
80 <script type="text/javascript">
87 <script type="text/javascript">
81
88
82 var preLoadVersionData = [
89 var preLoadVersionData = [
83 % for comment_history in comment.history:
90 % for comment_history in comment.history:
84 {
91 {
85 id: ${comment_history.comment_history_id},
92 id: ${comment_history.comment_history_id},
86 text: 'v${comment_history.version}',
93 text: 'v${comment_history.version}',
87 action: function () {
94 action: function () {
88 Rhodecode.comments.showVersion(
95 Rhodecode.comments.showVersion(
89 "${comment.comment_id}",
96 "${comment.comment_id}",
90 "${comment_history.comment_history_id}"
97 "${comment_history.comment_history_id}"
91 )
98 )
92 },
99 },
93 comment_version: "${comment_history.version}",
100 comment_version: "${comment_history.version}",
94 comment_author_username: "${comment_history.author.username}",
101 comment_author_username: "${comment_history.author.username}",
95 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
102 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
96 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
103 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
97 },
104 },
98 % endfor
105 % endfor
99 ]
106 ]
100 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
107 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
101
108
102 </script>
109 </script>
103
110
104 </div>
111 </div>
105 % else:
112 % else:
106 <div class="date" style="display: none">
113 <div class="date" style="display: none">
107 <input id="${comment_version_selector}" name="${comment_version_selector}"
114 <input id="${comment_version_selector}" name="${comment_version_selector}"
108 type="hidden"
115 type="hidden"
109 data-last-version="0">
116 data-last-version="0">
110 </div>
117 </div>
111 %endif
118 %endif
112 % if inline:
119 % if inline:
113 <span></span>
120 <span></span>
114 % else:
121 % else:
115 <div class="status-change">
122 <div class="status-change">
116 % if comment.pull_request:
123 % if comment.pull_request:
117 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
124 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
118 % if comment.status_change:
125 % if comment.status_change:
119 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}:
126 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}:
120 % else:
127 % else:
121 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}
128 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}
122 % endif
129 % endif
123 </a>
130 </a>
124 % else:
131 % else:
125 % if comment.status_change:
132 % if comment.status_change:
126 ${_('Status change on commit')}:
133 ${_('Status change on commit')}:
127 % endif
134 % endif
128 % endif
135 % endif
129 </div>
136 </div>
130 % endif
137 % endif
131
138
132 % if comment.status_change:
139 % if comment.status_change:
133 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
140 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
134 <div title="${_('Commit status')}" class="changeset-status-lbl">
141 <div title="${_('Commit status')}" class="changeset-status-lbl">
135 ${comment.status_change[0].status_lbl}
142 ${comment.status_change[0].status_lbl}
136 </div>
143 </div>
137 % endif
144 % endif
138
145
139 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
146 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
140
147
141 <div class="comment-links-block">
148 <div class="comment-links-block">
142 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
149
143 <span class="tag authortag tooltip" title="${_('Pull request author')}">
144 ${_('author')}
145 </span>
146 |
147 % endif
148 % if inline:
150 % if inline:
149 <div class="pr-version-inline">
151 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
150 <a href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
151 % if outdated_at_ver:
152 % if outdated_at_ver:
152 <code class="pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
153 <code class="pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
153 outdated ${'v{}'.format(pr_index_ver)} |
154 outdated ${'v{}'.format(pr_index_ver)} |
154 </code>
155 </code>
155 % elif pr_index_ver:
156 % elif pr_index_ver:
156 <code class="pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
157 <code class="pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
157 ${'v{}'.format(pr_index_ver)} |
158 ${'v{}'.format(pr_index_ver)} |
158 </code>
159 </code>
159 % endif
160 % endif
160 </a>
161 </a>
161 </div>
162 % else:
162 % else:
163 % if comment.pull_request_version_id and pr_index_ver:
163 % if comment.pull_request_version_id and pr_index_ver:
164 |
164
165 <div class="pr-version">
166 % if comment.outdated:
165 % if comment.outdated:
167 <a href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}">
166 <a class="pr-version"
167 href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"
168 >
168 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
169 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
169 </a>
170 </a> |
170 % else:
171 % else:
171 <div title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
172 <a class="pr-version"
172 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}">
173 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
173 <code class="pr-version-num">
174 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
174 ${'v{}'.format(pr_index_ver)}
175 >
175 </code>
176 <code class="pr-version-num">
176 </a>
177 ${'v{}'.format(pr_index_ver)}
177 </div>
178 </code>
179 </a> |
178 % endif
180 % endif
179 </div>
181
180 % endif
182 % endif
181 % endif
183 % endif
182
184
183 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
185 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
184 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
186 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
185 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
187 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
186 ## permissions to delete
188 ## permissions to delete
187 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
189 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
188 <a onclick="return Rhodecode.comments.editComment(this);"
190 <a onclick="return Rhodecode.comments.editComment(this);"
189 class="edit-comment">${_('Edit')}</a>
191 class="edit-comment">${_('Edit')}</a>
190 | <a onclick="return Rhodecode.comments.deleteComment(this);"
192 | <a onclick="return Rhodecode.comments.deleteComment(this);"
191 class="delete-comment">${_('Delete')}</a>
193 class="delete-comment">${_('Delete')}</a>
192 %else:
194 %else:
193 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
195 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
194 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
196 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
195 %endif
197 %endif
196 %else:
198 %else:
197 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
199 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
198 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
200 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
199 %endif
201 %endif
200
202
201 % if outdated_at_ver:
203 % if outdated_at_ver:
202 | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
204 | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
203 | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
205 | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
204 % else:
206 % else:
205 | <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
207 | <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
206 | <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
208 | <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
207 % endif
209 % endif
208
210
209 </div>
211 </div>
210 </div>
212 </div>
211 <div class="text">
213 <div class="text">
212 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
214 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
213 </div>
215 </div>
214
216
215 </div>
217 </div>
216 </%def>
218 </%def>
217
219
218 ## generate main comments
220 ## generate main comments
219 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
221 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
220 <%
222 <%
221 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
223 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
222 %>
224 %>
223
225
224 <div class="general-comments" id="comments">
226 <div class="general-comments" id="comments">
225 %for comment in comments:
227 %for comment in comments:
226 <div id="comment-tr-${comment.comment_id}">
228 <div id="comment-tr-${comment.comment_id}">
227 ## only render comments that are not from pull request, or from
229 ## only render comments that are not from pull request, or from
228 ## pull request and a status change
230 ## pull request and a status change
229 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
231 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
230 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
232 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
231 %endif
233 %endif
232 </div>
234 </div>
233 %endfor
235 %endfor
234 ## to anchor ajax comments
236 ## to anchor ajax comments
235 <div id="injected_page_comments"></div>
237 <div id="injected_page_comments"></div>
236 </div>
238 </div>
237 </%def>
239 </%def>
238
240
239
241
240 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
242 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
241
243
242 <div class="comments">
244 <div class="comments">
243 <%
245 <%
244 if is_pull_request:
246 if is_pull_request:
245 placeholder = _('Leave a comment on this Pull Request.')
247 placeholder = _('Leave a comment on this Pull Request.')
246 elif is_compare:
248 elif is_compare:
247 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
249 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
248 else:
250 else:
249 placeholder = _('Leave a comment on this Commit.')
251 placeholder = _('Leave a comment on this Commit.')
250 %>
252 %>
251
253
252 % if c.rhodecode_user.username != h.DEFAULT_USER:
254 % if c.rhodecode_user.username != h.DEFAULT_USER:
253 <div class="js-template" id="cb-comment-general-form-template">
255 <div class="js-template" id="cb-comment-general-form-template">
254 ## template generated for injection
256 ## template generated for injection
255 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
257 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
256 </div>
258 </div>
257
259
258 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
260 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
259 ## inject form here
261 ## inject form here
260 </div>
262 </div>
261 <script type="text/javascript">
263 <script type="text/javascript">
262 var lineNo = 'general';
264 var lineNo = 'general';
263 var resolvesCommentId = null;
265 var resolvesCommentId = null;
264 var generalCommentForm = Rhodecode.comments.createGeneralComment(
266 var generalCommentForm = Rhodecode.comments.createGeneralComment(
265 lineNo, "${placeholder}", resolvesCommentId);
267 lineNo, "${placeholder}", resolvesCommentId);
266
268
267 // set custom success callback on rangeCommit
269 // set custom success callback on rangeCommit
268 % if is_compare:
270 % if is_compare:
269 generalCommentForm.setHandleFormSubmit(function(o) {
271 generalCommentForm.setHandleFormSubmit(function(o) {
270 var self = generalCommentForm;
272 var self = generalCommentForm;
271
273
272 var text = self.cm.getValue();
274 var text = self.cm.getValue();
273 var status = self.getCommentStatus();
275 var status = self.getCommentStatus();
274 var commentType = self.getCommentType();
276 var commentType = self.getCommentType();
275
277
276 if (text === "" && !status) {
278 if (text === "" && !status) {
277 return;
279 return;
278 }
280 }
279
281
280 // we can pick which commits we want to make the comment by
282 // we can pick which commits we want to make the comment by
281 // selecting them via click on preview pane, this will alter the hidden inputs
283 // selecting them via click on preview pane, this will alter the hidden inputs
282 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
284 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
283
285
284 var commitIds = [];
286 var commitIds = [];
285 $('#changeset_compare_view_content .compare_select').each(function(el) {
287 $('#changeset_compare_view_content .compare_select').each(function(el) {
286 var commitId = this.id.replace('row-', '');
288 var commitId = this.id.replace('row-', '');
287 if ($(this).hasClass('hl') || !cherryPicked) {
289 if ($(this).hasClass('hl') || !cherryPicked) {
288 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
290 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
289 commitIds.push(commitId);
291 commitIds.push(commitId);
290 } else {
292 } else {
291 $("input[data-commit-id='{0}']".format(commitId)).val('')
293 $("input[data-commit-id='{0}']".format(commitId)).val('')
292 }
294 }
293 });
295 });
294
296
295 self.setActionButtonsDisabled(true);
297 self.setActionButtonsDisabled(true);
296 self.cm.setOption("readOnly", true);
298 self.cm.setOption("readOnly", true);
297 var postData = {
299 var postData = {
298 'text': text,
300 'text': text,
299 'changeset_status': status,
301 'changeset_status': status,
300 'comment_type': commentType,
302 'comment_type': commentType,
301 'commit_ids': commitIds,
303 'commit_ids': commitIds,
302 'csrf_token': CSRF_TOKEN
304 'csrf_token': CSRF_TOKEN
303 };
305 };
304
306
305 var submitSuccessCallback = function(o) {
307 var submitSuccessCallback = function(o) {
306 location.reload(true);
308 location.reload(true);
307 };
309 };
308 var submitFailCallback = function(){
310 var submitFailCallback = function(){
309 self.resetCommentFormState(text)
311 self.resetCommentFormState(text)
310 };
312 };
311 self.submitAjaxPOST(
313 self.submitAjaxPOST(
312 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
314 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
313 });
315 });
314 % endif
316 % endif
315
317
316 </script>
318 </script>
317 % else:
319 % else:
318 ## form state when not logged in
320 ## form state when not logged in
319 <div class="comment-form ac">
321 <div class="comment-form ac">
320
322
321 <div class="comment-area">
323 <div class="comment-area">
322 <div class="comment-area-header">
324 <div class="comment-area-header">
323 <ul class="nav-links clearfix">
325 <ul class="nav-links clearfix">
324 <li class="active">
326 <li class="active">
325 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
327 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
326 </li>
328 </li>
327 <li class="">
329 <li class="">
328 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
330 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
329 </li>
331 </li>
330 </ul>
332 </ul>
331 </div>
333 </div>
332
334
333 <div class="comment-area-write" style="display: block;">
335 <div class="comment-area-write" style="display: block;">
334 <div id="edit-container">
336 <div id="edit-container">
335 <div style="padding: 40px 0">
337 <div style="padding: 40px 0">
336 ${_('You need to be logged in to leave comments.')}
338 ${_('You need to be logged in to leave comments.')}
337 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
339 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
338 </div>
340 </div>
339 </div>
341 </div>
340 <div id="preview-container" class="clearfix" style="display: none;">
342 <div id="preview-container" class="clearfix" style="display: none;">
341 <div id="preview-box" class="preview-box"></div>
343 <div id="preview-box" class="preview-box"></div>
342 </div>
344 </div>
343 </div>
345 </div>
344
346
345 <div class="comment-area-footer">
347 <div class="comment-area-footer">
346 <div class="toolbar">
348 <div class="toolbar">
347 <div class="toolbar-text">
349 <div class="toolbar-text">
348 </div>
350 </div>
349 </div>
351 </div>
350 </div>
352 </div>
351 </div>
353 </div>
352
354
353 <div class="comment-footer">
355 <div class="comment-footer">
354 </div>
356 </div>
355
357
356 </div>
358 </div>
357 % endif
359 % endif
358
360
359 <script type="text/javascript">
361 <script type="text/javascript">
360 bindToggleButtons();
362 bindToggleButtons();
361 </script>
363 </script>
362 </div>
364 </div>
363 </%def>
365 </%def>
364
366
365
367
366 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
368 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
367
369
368 ## comment injected based on assumption that user is logged in
370 ## comment injected based on assumption that user is logged in
369 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
371 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
370
372
371 <div class="comment-area">
373 <div class="comment-area">
372 <div class="comment-area-header">
374 <div class="comment-area-header">
373 <div class="pull-left">
375 <div class="pull-left">
374 <ul class="nav-links clearfix">
376 <ul class="nav-links clearfix">
375 <li class="active">
377 <li class="active">
376 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
378 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
377 </li>
379 </li>
378 <li class="">
380 <li class="">
379 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
381 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
380 </li>
382 </li>
381 </ul>
383 </ul>
382 </div>
384 </div>
383 <div class="pull-right">
385 <div class="pull-right">
384 <span class="comment-area-text">${_('Mark as')}:</span>
386 <span class="comment-area-text">${_('Mark as')}:</span>
385 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
387 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
386 % for val in c.visual.comment_types:
388 % for val in c.visual.comment_types:
387 <option value="${val}">${val.upper()}</option>
389 <option value="${val}">${val.upper()}</option>
388 % endfor
390 % endfor
389 </select>
391 </select>
390 </div>
392 </div>
391 </div>
393 </div>
392
394
393 <div class="comment-area-write" style="display: block;">
395 <div class="comment-area-write" style="display: block;">
394 <div id="edit-container_${lineno_id}">
396 <div id="edit-container_${lineno_id}">
395 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
397 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
396 </div>
398 </div>
397 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
399 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
398 <div id="preview-box_${lineno_id}" class="preview-box"></div>
400 <div id="preview-box_${lineno_id}" class="preview-box"></div>
399 </div>
401 </div>
400 </div>
402 </div>
401
403
402 <div class="comment-area-footer comment-attachment-uploader">
404 <div class="comment-area-footer comment-attachment-uploader">
403 <div class="toolbar">
405 <div class="toolbar">
404
406
405 <div class="comment-attachment-text">
407 <div class="comment-attachment-text">
406 <div class="dropzone-text">
408 <div class="dropzone-text">
407 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
409 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
408 </div>
410 </div>
409 <div class="dropzone-upload" style="display:none">
411 <div class="dropzone-upload" style="display:none">
410 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
412 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
411 </div>
413 </div>
412 </div>
414 </div>
413
415
414 ## comments dropzone template, empty on purpose
416 ## comments dropzone template, empty on purpose
415 <div style="display: none" class="comment-attachment-uploader-template">
417 <div style="display: none" class="comment-attachment-uploader-template">
416 <div class="dz-file-preview" style="margin: 0">
418 <div class="dz-file-preview" style="margin: 0">
417 <div class="dz-error-message"></div>
419 <div class="dz-error-message"></div>
418 </div>
420 </div>
419 </div>
421 </div>
420
422
421 </div>
423 </div>
422 </div>
424 </div>
423 </div>
425 </div>
424
426
425 <div class="comment-footer">
427 <div class="comment-footer">
426
428
427 ## inject extra inputs into the form
429 ## inject extra inputs into the form
428 % if form_extras and isinstance(form_extras, (list, tuple)):
430 % if form_extras and isinstance(form_extras, (list, tuple)):
429 <div id="comment_form_extras">
431 <div id="comment_form_extras">
430 % for form_ex_el in form_extras:
432 % for form_ex_el in form_extras:
431 ${form_ex_el|n}
433 ${form_ex_el|n}
432 % endfor
434 % endfor
433 </div>
435 </div>
434 % endif
436 % endif
435
437
436 <div class="action-buttons">
438 <div class="action-buttons">
437 % if form_type != 'inline':
439 % if form_type != 'inline':
438 <div class="action-buttons-extra"></div>
440 <div class="action-buttons-extra"></div>
439 % endif
441 % endif
440
442
441 <input class="btn btn-success comment-button-input" id="save_${lineno_id}" name="save" type="submit" value="${_('Comment')}">
443 <input class="btn btn-success comment-button-input" id="save_${lineno_id}" name="save" type="submit" value="${_('Comment')}">
442
444
443 ## inline for has a file, and line-number together with cancel hide button.
445 ## inline for has a file, and line-number together with cancel hide button.
444 % if form_type == 'inline':
446 % if form_type == 'inline':
445 <input type="hidden" name="f_path" value="{0}">
447 <input type="hidden" name="f_path" value="{0}">
446 <input type="hidden" name="line" value="${lineno_id}">
448 <input type="hidden" name="line" value="${lineno_id}">
447 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
449 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
448 ${_('Cancel')}
450 ${_('Cancel')}
449 </button>
451 </button>
450 % endif
452 % endif
451 </div>
453 </div>
452
454
453 % if review_statuses:
455 % if review_statuses:
454 <div class="status_box">
456 <div class="status_box">
455 <select id="change_status_${lineno_id}" name="changeset_status">
457 <select id="change_status_${lineno_id}" name="changeset_status">
456 <option></option> ## Placeholder
458 <option></option> ## Placeholder
457 % for status, lbl in review_statuses:
459 % for status, lbl in review_statuses:
458 <option value="${status}" data-status="${status}">${lbl}</option>
460 <option value="${status}" data-status="${status}">${lbl}</option>
459 %if is_pull_request and change_status and status in ('approved', 'rejected'):
461 %if is_pull_request and change_status and status in ('approved', 'rejected'):
460 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
462 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
461 %endif
463 %endif
462 % endfor
464 % endfor
463 </select>
465 </select>
464 </div>
466 </div>
465 % endif
467 % endif
466
468
467 <div class="toolbar-text">
469 <div class="toolbar-text">
468 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
470 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
469 ${_('Comments parsed using {} syntax.').format(renderer_url)|n} <br/>
471 ${_('Comments parsed using {} syntax.').format(renderer_url)|n} <br/>
470 <span class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span>
472 <span class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span>
471 ${_('and')}
473 ${_('and')}
472 <span class="tooltip" title="${_('Start typing with / for certain actions to be triggered via text box.')}">`/` autocomplete</span>
474 <span class="tooltip" title="${_('Start typing with / for certain actions to be triggered via text box.')}">`/` autocomplete</span>
473 ${_('actions supported.')}
475 ${_('actions supported.')}
474 </div>
476 </div>
475 </div>
477 </div>
476
478
477 </form>
479 </form>
478
480
479 </%def> No newline at end of file
481 </%def>
General Comments 0
You need to be logged in to leave comments. Login now