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