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