Show More
@@ -1,611 +1,611 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 | 256 | float: left; |
|
257 | 257 | margin: 0px 4px; |
|
258 | 258 | } |
|
259 | 259 | .pr-version-inline { |
|
260 | 260 | float: left; |
|
261 | 261 | margin: 0px 4px; |
|
262 | 262 | } |
|
263 | 263 | .pr-version-num { |
|
264 | 264 | font-size: 10px; |
|
265 | 265 | } |
|
266 | 266 | } |
|
267 | 267 | |
|
268 | 268 | @comment-padding: 5px; |
|
269 | 269 | |
|
270 | 270 | .general-comments { |
|
271 | 271 | .comment-outdated { |
|
272 | 272 | opacity: @comment-outdated-opacity; |
|
273 | 273 | } |
|
274 | 274 | } |
|
275 | 275 | |
|
276 | 276 | .inline-comments { |
|
277 | 277 | border-radius: @border-radius; |
|
278 | 278 | .comment { |
|
279 | 279 | margin: 0; |
|
280 | 280 | border-radius: @border-radius; |
|
281 | 281 | } |
|
282 | 282 | .comment-outdated { |
|
283 | 283 | opacity: @comment-outdated-opacity; |
|
284 | 284 | } |
|
285 | 285 | |
|
286 | 286 | .comment-inline { |
|
287 | 287 | background: white; |
|
288 | 288 | padding: @comment-padding @comment-padding; |
|
289 | 289 | border: @comment-padding solid @grey6; |
|
290 | 290 | |
|
291 | 291 | .text { |
|
292 | 292 | border: none; |
|
293 | 293 | } |
|
294 | 294 | .meta { |
|
295 | 295 | border-bottom: 1px solid @grey6; |
|
296 | 296 | margin: -5px 0px; |
|
297 | 297 | line-height: 24px; |
|
298 | 298 | } |
|
299 | 299 | } |
|
300 | 300 | .comment-selected { |
|
301 | 301 | border-left: 6px solid @comment-highlight-color; |
|
302 | 302 | } |
|
303 | 303 | .comment-inline-form { |
|
304 | 304 | padding: @comment-padding; |
|
305 | 305 | display: none; |
|
306 | 306 | } |
|
307 | 307 | .cb-comment-add-button { |
|
308 | 308 | margin: @comment-padding; |
|
309 | 309 | } |
|
310 | 310 | /* hide add comment button when form is open */ |
|
311 | 311 | .comment-inline-form-open ~ .cb-comment-add-button { |
|
312 | 312 | display: none; |
|
313 | 313 | } |
|
314 | 314 | .comment-inline-form-open { |
|
315 | 315 | display: block; |
|
316 | 316 | } |
|
317 | 317 | /* hide add comment button when form but no comments */ |
|
318 | 318 | .comment-inline-form:first-child + .cb-comment-add-button { |
|
319 | 319 | display: none; |
|
320 | 320 | } |
|
321 | 321 | /* hide add comment button when no comments or form */ |
|
322 | 322 | .cb-comment-add-button:first-child { |
|
323 | 323 | display: none; |
|
324 | 324 | } |
|
325 | 325 | /* hide add comment button when only comment is being deleted */ |
|
326 | 326 | .comment-deleting:first-child + .cb-comment-add-button { |
|
327 | 327 | display: none; |
|
328 | 328 | } |
|
329 | 329 | } |
|
330 | 330 | |
|
331 | 331 | |
|
332 | 332 | .show-outdated-comments { |
|
333 | 333 | display: inline; |
|
334 | 334 | color: @rcblue; |
|
335 | 335 | } |
|
336 | 336 | |
|
337 | 337 | // Comment Form |
|
338 | 338 | div.comment-form { |
|
339 | 339 | margin-top: 20px; |
|
340 | 340 | } |
|
341 | 341 | |
|
342 | 342 | .comment-form strong { |
|
343 | 343 | display: block; |
|
344 | 344 | margin-bottom: 15px; |
|
345 | 345 | } |
|
346 | 346 | |
|
347 | 347 | .comment-form textarea { |
|
348 | 348 | width: 100%; |
|
349 | 349 | height: 100px; |
|
350 | 350 | font-family: @text-monospace; |
|
351 | 351 | } |
|
352 | 352 | |
|
353 | 353 | form.comment-form { |
|
354 | 354 | margin-top: 10px; |
|
355 | 355 | margin-left: 10px; |
|
356 | 356 | } |
|
357 | 357 | |
|
358 | 358 | .comment-inline-form .comment-block-ta, |
|
359 | 359 | .comment-form .comment-block-ta, |
|
360 | 360 | .comment-form .preview-box { |
|
361 | 361 | .border-radius(@border-radius); |
|
362 | 362 | .box-sizing(border-box); |
|
363 | 363 | background-color: white; |
|
364 | 364 | } |
|
365 | 365 | |
|
366 | 366 | .comment-form-submit { |
|
367 | 367 | margin-top: 5px; |
|
368 | 368 | margin-left: 525px; |
|
369 | 369 | } |
|
370 | 370 | |
|
371 | 371 | .file-comments { |
|
372 | 372 | display: none; |
|
373 | 373 | } |
|
374 | 374 | |
|
375 | 375 | .comment-form .preview-box.unloaded, |
|
376 | 376 | .comment-inline-form .preview-box.unloaded { |
|
377 | 377 | height: 50px; |
|
378 | 378 | text-align: center; |
|
379 | 379 | padding: 20px; |
|
380 | 380 | background-color: white; |
|
381 | 381 | } |
|
382 | 382 | |
|
383 | 383 | .comment-footer { |
|
384 | 384 | position: relative; |
|
385 | 385 | width: 100%; |
|
386 | 386 | min-height: 42px; |
|
387 | 387 | |
|
388 | 388 | .status_box, |
|
389 | 389 | .cancel-button { |
|
390 | 390 | float: left; |
|
391 | 391 | display: inline-block; |
|
392 | 392 | } |
|
393 | 393 | |
|
394 | 394 | .action-buttons { |
|
395 | 395 | float: right; |
|
396 | 396 | display: inline-block; |
|
397 | 397 | } |
|
398 | 398 | |
|
399 | 399 | .action-buttons-extra { |
|
400 | 400 | display: inline-block; |
|
401 | 401 | } |
|
402 | 402 | } |
|
403 | 403 | |
|
404 | 404 | .comment-form { |
|
405 | 405 | |
|
406 | 406 | .comment { |
|
407 | 407 | margin-left: 10px; |
|
408 | 408 | } |
|
409 | 409 | |
|
410 | 410 | .comment-help { |
|
411 | 411 | color: @grey4; |
|
412 | 412 | padding: 5px 0 5px 0; |
|
413 | 413 | } |
|
414 | 414 | |
|
415 | 415 | .comment-title { |
|
416 | 416 | padding: 5px 0 5px 0; |
|
417 | 417 | } |
|
418 | 418 | |
|
419 | 419 | .comment-button { |
|
420 | 420 | display: inline-block; |
|
421 | 421 | } |
|
422 | 422 | |
|
423 | 423 | .comment-button-input { |
|
424 | 424 | margin-right: 0; |
|
425 | 425 | } |
|
426 | 426 | |
|
427 | 427 | .comment-footer { |
|
428 |
margin-bottom: |
|
|
428 | margin-bottom: 50px; | |
|
429 | 429 | margin-top: 10px; |
|
430 | 430 | } |
|
431 | 431 | } |
|
432 | 432 | |
|
433 | 433 | |
|
434 | 434 | .comment-form-login { |
|
435 | 435 | .comment-help { |
|
436 | 436 | padding: 0.7em; //same as the button |
|
437 | 437 | } |
|
438 | 438 | |
|
439 | 439 | div.clearfix { |
|
440 | 440 | clear: both; |
|
441 | 441 | width: 100%; |
|
442 | 442 | display: block; |
|
443 | 443 | } |
|
444 | 444 | } |
|
445 | 445 | |
|
446 | 446 | .comment-type { |
|
447 | 447 | margin: 0px; |
|
448 | 448 | border-radius: inherit; |
|
449 | 449 | border-color: @grey6; |
|
450 | 450 | } |
|
451 | 451 | |
|
452 | 452 | .preview-box { |
|
453 | 453 | min-height: 105px; |
|
454 | 454 | margin-bottom: 15px; |
|
455 | 455 | background-color: white; |
|
456 | 456 | .border-radius(@border-radius); |
|
457 | 457 | .box-sizing(border-box); |
|
458 | 458 | } |
|
459 | 459 | |
|
460 | 460 | .add-another-button { |
|
461 | 461 | margin-left: 10px; |
|
462 | 462 | margin-top: 10px; |
|
463 | 463 | margin-bottom: 10px; |
|
464 | 464 | } |
|
465 | 465 | |
|
466 | 466 | .comment .buttons { |
|
467 | 467 | float: right; |
|
468 | 468 | margin: -1px 0px 0px 0px; |
|
469 | 469 | } |
|
470 | 470 | |
|
471 | 471 | // Inline Comment Form |
|
472 | 472 | .injected_diff .comment-inline-form, |
|
473 | 473 | .comment-inline-form { |
|
474 | 474 | background-color: white; |
|
475 | 475 | margin-top: 10px; |
|
476 | 476 | margin-bottom: 20px; |
|
477 | 477 | } |
|
478 | 478 | |
|
479 | 479 | .inline-form { |
|
480 | 480 | padding: 10px 7px; |
|
481 | 481 | } |
|
482 | 482 | |
|
483 | 483 | .inline-form div { |
|
484 | 484 | max-width: 100%; |
|
485 | 485 | } |
|
486 | 486 | |
|
487 | 487 | .overlay { |
|
488 | 488 | display: none; |
|
489 | 489 | position: absolute; |
|
490 | 490 | width: 100%; |
|
491 | 491 | text-align: center; |
|
492 | 492 | vertical-align: middle; |
|
493 | 493 | font-size: 16px; |
|
494 | 494 | background: none repeat scroll 0 0 white; |
|
495 | 495 | |
|
496 | 496 | &.submitting { |
|
497 | 497 | display: block; |
|
498 | 498 | opacity: 0.5; |
|
499 | 499 | z-index: 100; |
|
500 | 500 | } |
|
501 | 501 | } |
|
502 | 502 | .comment-inline-form .overlay.submitting .overlay-text { |
|
503 | 503 | margin-top: 5%; |
|
504 | 504 | } |
|
505 | 505 | |
|
506 | 506 | .comment-inline-form .clearfix, |
|
507 | 507 | .comment-form .clearfix { |
|
508 | 508 | .border-radius(@border-radius); |
|
509 | 509 | margin: 0px; |
|
510 | 510 | } |
|
511 | 511 | |
|
512 | 512 | .comment-inline-form .comment-footer { |
|
513 | 513 | margin: 10px 0px 0px 0px; |
|
514 | 514 | } |
|
515 | 515 | |
|
516 | 516 | .hide-inline-form-button { |
|
517 | 517 | margin-left: 5px; |
|
518 | 518 | } |
|
519 | 519 | .comment-button .hide-inline-form { |
|
520 | 520 | background: white; |
|
521 | 521 | } |
|
522 | 522 | |
|
523 | 523 | .comment-area { |
|
524 | 524 | padding: 8px 12px; |
|
525 | 525 | border: 1px solid @grey5; |
|
526 | 526 | .border-radius(@border-radius); |
|
527 | 527 | |
|
528 | 528 | .resolve-action { |
|
529 | 529 | padding: 1px 0px 0px 6px; |
|
530 | 530 | } |
|
531 | 531 | |
|
532 | 532 | } |
|
533 | 533 | |
|
534 | 534 | .comment-area-header .nav-links { |
|
535 | 535 | display: flex; |
|
536 | 536 | flex-flow: row wrap; |
|
537 | 537 | -webkit-flex-flow: row wrap; |
|
538 | 538 | width: 100%; |
|
539 | 539 | } |
|
540 | 540 | |
|
541 | 541 | .comment-area-footer { |
|
542 | 542 | min-height: 30px; |
|
543 | 543 | } |
|
544 | 544 | |
|
545 | 545 | .comment-footer .toolbar { |
|
546 | 546 | |
|
547 | 547 | } |
|
548 | 548 | |
|
549 | 549 | .comment-attachment-uploader { |
|
550 | 550 | border: 1px dashed white; |
|
551 | 551 | border-radius: @border-radius; |
|
552 | 552 | margin-top: -10px; |
|
553 | 553 | |
|
554 | 554 | &.dz-drag-hover { |
|
555 | 555 | border-color: @grey3; |
|
556 | 556 | } |
|
557 | 557 | |
|
558 | 558 | .dz-error-message { |
|
559 | 559 | padding-top: 0; |
|
560 | 560 | } |
|
561 | 561 | } |
|
562 | 562 | |
|
563 | 563 | .comment-attachment-text { |
|
564 | 564 | clear: both; |
|
565 | 565 | font-size: 11px; |
|
566 | 566 | color: #8F8F8F; |
|
567 | 567 | width: 100%; |
|
568 | 568 | .pick-attachment { |
|
569 | 569 | color: #8F8F8F; |
|
570 | 570 | } |
|
571 | 571 | .pick-attachment:hover { |
|
572 | 572 | color: @rcblue; |
|
573 | 573 | } |
|
574 | 574 | } |
|
575 | 575 | |
|
576 | 576 | .nav-links { |
|
577 | 577 | padding: 0; |
|
578 | 578 | margin: 0; |
|
579 | 579 | list-style: none; |
|
580 | 580 | height: auto; |
|
581 | 581 | border-bottom: 1px solid @grey5; |
|
582 | 582 | } |
|
583 | 583 | .nav-links li { |
|
584 | 584 | display: inline-block; |
|
585 | 585 | list-style-type: none; |
|
586 | 586 | } |
|
587 | 587 | |
|
588 | 588 | .nav-links li a.disabled { |
|
589 | 589 | cursor: not-allowed; |
|
590 | 590 | } |
|
591 | 591 | |
|
592 | 592 | .nav-links li.active a { |
|
593 | 593 | border-bottom: 2px solid @rcblue; |
|
594 | 594 | color: #000; |
|
595 | 595 | font-weight: 600; |
|
596 | 596 | } |
|
597 | 597 | .nav-links li a { |
|
598 | 598 | display: inline-block; |
|
599 | 599 | padding: 0px 10px 5px 10px; |
|
600 | 600 | margin-bottom: -1px; |
|
601 | 601 | font-size: 14px; |
|
602 | 602 | line-height: 28px; |
|
603 | 603 | color: #8f8f8f; |
|
604 | 604 | border-bottom: 2px solid transparent; |
|
605 | 605 | } |
|
606 | 606 | |
|
607 | 607 | .toolbar-text { |
|
608 | 608 | float: left; |
|
609 | 609 | font-size: 12px; |
|
610 | 610 | } |
|
611 | 611 |
@@ -1,790 +1,791 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="title()"> |
|
6 | 6 | ${_('{} Pull Request !{}').format(c.repo_name, c.pull_request.pull_request_id)} |
|
7 | 7 | %if c.rhodecode_name: |
|
8 | 8 | · ${h.branding(c.rhodecode_name)} |
|
9 | 9 | %endif |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="breadcrumbs_links()"> |
|
13 | 13 | <span id="pr-title"> |
|
14 | 14 | ${c.pull_request.title} |
|
15 | 15 | %if c.pull_request.is_closed(): |
|
16 | 16 | (${_('Closed')}) |
|
17 | 17 | %endif |
|
18 | 18 | </span> |
|
19 | 19 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
20 | 20 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} |
|
21 | 21 | </div> |
|
22 | 22 | </%def> |
|
23 | 23 | |
|
24 | 24 | <%def name="menu_bar_nav()"> |
|
25 | 25 | ${self.menu_items(active='repositories')} |
|
26 | 26 | </%def> |
|
27 | 27 | |
|
28 | 28 | <%def name="menu_bar_subnav()"> |
|
29 | 29 | ${self.repo_menu(active='showpullrequest')} |
|
30 | 30 | </%def> |
|
31 | 31 | |
|
32 | 32 | <%def name="main()"> |
|
33 | 33 | |
|
34 | 34 | <script type="text/javascript"> |
|
35 | 35 | // TODO: marcink switch this to pyroutes |
|
36 | 36 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; |
|
37 | 37 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
38 | 38 | </script> |
|
39 | 39 | <div class="box"> |
|
40 | 40 | |
|
41 | 41 | ${self.breadcrumbs()} |
|
42 | 42 | |
|
43 | 43 | <div class="box pr-summary"> |
|
44 | 44 | |
|
45 | 45 | <div class="summary-details block-left"> |
|
46 | 46 | <% summary = lambda n:{False:'summary-short'}.get(n) %> |
|
47 | 47 | <div class="pr-details-title"> |
|
48 | 48 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request !{}').format(c.pull_request.pull_request_id)}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
49 | 49 | %if c.allowed_to_update: |
|
50 | 50 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> |
|
51 | 51 | % if c.allowed_to_delete: |
|
52 | 52 | ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)} |
|
53 | 53 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), |
|
54 | 54 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} |
|
55 | 55 | ${h.end_form()} |
|
56 | 56 | % else: |
|
57 | 57 | ${_('Delete')} |
|
58 | 58 | % endif |
|
59 | 59 | </div> |
|
60 | 60 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> |
|
61 | 61 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> |
|
62 | 62 | %endif |
|
63 | 63 | </div> |
|
64 | 64 | |
|
65 | 65 | <div id="summary" class="fields pr-details-content"> |
|
66 | 66 | <div class="field"> |
|
67 | 67 | <div class="label-summary"> |
|
68 | 68 | <label>${_('Source')}:</label> |
|
69 | 69 | </div> |
|
70 | 70 | <div class="input"> |
|
71 | 71 | <div class="pr-origininfo"> |
|
72 | 72 | ## branch link is only valid if it is a branch |
|
73 | 73 | <span class="tag"> |
|
74 | 74 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
75 | 75 | <a href="${h.route_path('repo_commits', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> |
|
76 | 76 | %else: |
|
77 | 77 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
78 | 78 | %endif |
|
79 | 79 | </span> |
|
80 | 80 | <span class="clone-url"> |
|
81 | 81 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
82 | 82 | </span> |
|
83 | 83 | <br/> |
|
84 | 84 | % if c.ancestor_commit: |
|
85 | 85 | ${_('Common ancestor')}: |
|
86 | 86 | <code><a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
87 | 87 | % endif |
|
88 | 88 | </div> |
|
89 | 89 | %if h.is_hg(c.pull_request.source_repo): |
|
90 | 90 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
91 | 91 | %elif h.is_git(c.pull_request.source_repo): |
|
92 | 92 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
93 | 93 | %endif |
|
94 | 94 | |
|
95 | 95 | <div class=""> |
|
96 | 96 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> |
|
97 | 97 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> |
|
98 | 98 | </div> |
|
99 | 99 | |
|
100 | 100 | </div> |
|
101 | 101 | </div> |
|
102 | 102 | <div class="field"> |
|
103 | 103 | <div class="label-summary"> |
|
104 | 104 | <label>${_('Target')}:</label> |
|
105 | 105 | </div> |
|
106 | 106 | <div class="input"> |
|
107 | 107 | <div class="pr-targetinfo"> |
|
108 | 108 | ## branch link is only valid if it is a branch |
|
109 | 109 | <span class="tag"> |
|
110 | 110 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
111 | 111 | <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
112 | 112 | %else: |
|
113 | 113 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
114 | 114 | %endif |
|
115 | 115 | </span> |
|
116 | 116 | <span class="clone-url"> |
|
117 | 117 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
118 | 118 | </span> |
|
119 | 119 | </div> |
|
120 | 120 | </div> |
|
121 | 121 | </div> |
|
122 | 122 | |
|
123 | 123 | ## Link to the shadow repository. |
|
124 | 124 | <div class="field"> |
|
125 | 125 | <div class="label-summary"> |
|
126 | 126 | <label>${_('Merge')}:</label> |
|
127 | 127 | </div> |
|
128 | 128 | <div class="input"> |
|
129 | 129 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
130 | 130 | %if h.is_hg(c.pull_request.target_repo): |
|
131 | 131 | <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
132 | 132 | %elif h.is_git(c.pull_request.target_repo): |
|
133 | 133 | <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
134 | 134 | %endif |
|
135 | 135 | <div class=""> |
|
136 | 136 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> |
|
137 | 137 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> |
|
138 | 138 | </div> |
|
139 | 139 | % else: |
|
140 | 140 | <div class=""> |
|
141 | 141 | ${_('Shadow repository data not available')}. |
|
142 | 142 | </div> |
|
143 | 143 | % endif |
|
144 | 144 | </div> |
|
145 | 145 | </div> |
|
146 | 146 | |
|
147 | 147 | <div class="field"> |
|
148 | 148 | <div class="label-summary"> |
|
149 | 149 | <label>${_('Review')}:</label> |
|
150 | 150 | </div> |
|
151 | 151 | <div class="input"> |
|
152 | 152 | %if c.pull_request_review_status: |
|
153 | 153 | <i class="icon-circle review-status-${c.pull_request_review_status}"></i> |
|
154 | 154 | <span class="changeset-status-lbl tooltip"> |
|
155 | 155 | %if c.pull_request.is_closed(): |
|
156 | 156 | ${_('Closed')}, |
|
157 | 157 | %endif |
|
158 | 158 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
159 | 159 | </span> |
|
160 | 160 | - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
161 | 161 | %endif |
|
162 | 162 | </div> |
|
163 | 163 | </div> |
|
164 | 164 | <div class="field"> |
|
165 | 165 | <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}"> |
|
166 | 166 | <label>${_('Description')}:</label> |
|
167 | 167 | </div> |
|
168 | 168 | <div id="pr-desc" class="input"> |
|
169 | 169 | <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name)}</div> |
|
170 | 170 | </div> |
|
171 | 171 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
172 | 172 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> |
|
173 | 173 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} |
|
174 | 174 | </div> |
|
175 | 175 | </div> |
|
176 | 176 | |
|
177 | 177 | <div class="field"> |
|
178 | 178 | <div class="label-summary"> |
|
179 | 179 | <label>${_('Versions')}:</label> |
|
180 | 180 | </div> |
|
181 | 181 | |
|
182 | 182 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> |
|
183 | 183 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> |
|
184 | 184 | |
|
185 | 185 | <div class="pr-versions"> |
|
186 | 186 | % if c.show_version_changes: |
|
187 | 187 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> |
|
188 | 188 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> |
|
189 | 189 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
190 | 190 | data-toggle-on="${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
191 | 191 | data-toggle-off="${_('Hide all versions of this pull request')}"> |
|
192 | 192 | ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
193 | 193 | </a> |
|
194 | 194 | <table> |
|
195 | 195 | ## SHOW ALL VERSIONS OF PR |
|
196 | 196 | <% ver_pr = None %> |
|
197 | 197 | |
|
198 | 198 | % for data in reversed(list(enumerate(c.versions, 1))): |
|
199 | 199 | <% ver_pos = data[0] %> |
|
200 | 200 | <% ver = data[1] %> |
|
201 | 201 | <% ver_pr = ver.pull_request_version_id %> |
|
202 | 202 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> |
|
203 | 203 | |
|
204 | 204 | <tr class="version-pr" style="display: ${display_row}"> |
|
205 | 205 | <td> |
|
206 | 206 | <code> |
|
207 | 207 | <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a> |
|
208 | 208 | </code> |
|
209 | 209 | </td> |
|
210 | 210 | <td> |
|
211 | 211 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
212 | 212 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
213 | 213 | </td> |
|
214 | 214 | <td> |
|
215 | 215 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> |
|
216 | 216 | <i class="tooltip icon-circle review-status-${review_status}" title="${_('Your review status at this version')}"></i> |
|
217 | 217 | </div> |
|
218 | 218 | </td> |
|
219 | 219 | <td> |
|
220 | 220 | % if c.at_version_num != ver_pr: |
|
221 | 221 | <i class="icon-comment"></i> |
|
222 | 222 | <code class="tooltip" title="${_('Comment from pull request version v{0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
223 | 223 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} |
|
224 | 224 | </code> |
|
225 | 225 | % endif |
|
226 | 226 | </td> |
|
227 | 227 | <td> |
|
228 | 228 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> |
|
229 | 229 | </td> |
|
230 | 230 | <td> |
|
231 | 231 | ${h.age_component(ver.updated_on, time_is_local=True)} |
|
232 | 232 | </td> |
|
233 | 233 | </tr> |
|
234 | 234 | % endfor |
|
235 | 235 | |
|
236 | 236 | <tr> |
|
237 | 237 | <td colspan="6"> |
|
238 | 238 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" |
|
239 | 239 | data-label-text-locked="${_('select versions to show changes')}" |
|
240 | 240 | data-label-text-diff="${_('show changes between versions')}" |
|
241 | 241 | data-label-text-show="${_('show pull request for this version')}" |
|
242 | 242 | > |
|
243 | 243 | ${_('select versions to show changes')} |
|
244 | 244 | </button> |
|
245 | 245 | </td> |
|
246 | 246 | </tr> |
|
247 | 247 | </table> |
|
248 | 248 | % else: |
|
249 | 249 | <div class="input"> |
|
250 | 250 | ${_('Pull request versions not available')}. |
|
251 | 251 | </div> |
|
252 | 252 | % endif |
|
253 | 253 | </div> |
|
254 | 254 | </div> |
|
255 | 255 | |
|
256 | 256 | <div id="pr-save" class="field" style="display: none;"> |
|
257 | 257 | <div class="label-summary"></div> |
|
258 | 258 | <div class="input"> |
|
259 | 259 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
260 | 260 | </div> |
|
261 | 261 | </div> |
|
262 | 262 | </div> |
|
263 | 263 | </div> |
|
264 | 264 | <div> |
|
265 | 265 | ## AUTHOR |
|
266 | 266 | <div class="reviewers-title block-right"> |
|
267 | 267 | <div class="pr-details-title"> |
|
268 | 268 | ${_('Author of this pull request')} |
|
269 | 269 | </div> |
|
270 | 270 | </div> |
|
271 | 271 | <div class="block-right pr-details-content reviewers"> |
|
272 | 272 | <ul class="group_members"> |
|
273 | 273 | <li> |
|
274 | 274 | ${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)} |
|
275 | 275 | </li> |
|
276 | 276 | </ul> |
|
277 | 277 | </div> |
|
278 | 278 | |
|
279 | 279 | ## REVIEW RULES |
|
280 | 280 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> |
|
281 | 281 | <div class="pr-details-title"> |
|
282 | 282 | ${_('Reviewer rules')} |
|
283 | 283 | %if c.allowed_to_update: |
|
284 | 284 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> |
|
285 | 285 | %endif |
|
286 | 286 | </div> |
|
287 | 287 | <div class="pr-reviewer-rules"> |
|
288 | 288 | ## review rules will be appended here, by default reviewers logic |
|
289 | 289 | </div> |
|
290 | 290 | <input id="review_data" type="hidden" name="review_data" value=""> |
|
291 | 291 | </div> |
|
292 | 292 | |
|
293 | 293 | ## REVIEWERS |
|
294 | 294 | <div class="reviewers-title block-right"> |
|
295 | 295 | <div class="pr-details-title"> |
|
296 | 296 | ${_('Pull request reviewers')} |
|
297 | 297 | %if c.allowed_to_update: |
|
298 | 298 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> |
|
299 | 299 | %endif |
|
300 | 300 | </div> |
|
301 | 301 | </div> |
|
302 | 302 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
303 | 303 | |
|
304 | 304 | ## members redering block |
|
305 | 305 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
306 | 306 | <ul id="review_members" class="group_members"> |
|
307 | 307 | |
|
308 | 308 | % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers: |
|
309 | 309 | <script> |
|
310 | 310 | var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n}; |
|
311 | 311 | var status = "${(status[0][1].status if status else 'not_reviewed')}"; |
|
312 | 312 | var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}"; |
|
313 | 313 | var allowed_to_update = ${h.json.dumps(c.allowed_to_update)}; |
|
314 | 314 | |
|
315 | 315 | var entry = renderTemplate('reviewMemberEntry', { |
|
316 | 316 | 'member': member, |
|
317 | 317 | 'mandatory': member.mandatory, |
|
318 | 318 | 'reasons': member.reasons, |
|
319 | 319 | 'allowed_to_update': allowed_to_update, |
|
320 | 320 | 'review_status': status, |
|
321 | 321 | 'review_status_label': status_lbl, |
|
322 | 322 | 'user_group': member.user_group, |
|
323 | 323 | 'create': false |
|
324 | 324 | }); |
|
325 | 325 | $('#review_members').append(entry) |
|
326 | 326 | </script> |
|
327 | 327 | |
|
328 | 328 | % endfor |
|
329 | 329 | |
|
330 | 330 | </ul> |
|
331 | 331 | |
|
332 | 332 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
333 | 333 | ## end members redering block |
|
334 | 334 | |
|
335 | 335 | %if not c.pull_request.is_closed(): |
|
336 | 336 | <div id="add_reviewer" class="ac" style="display: none;"> |
|
337 | 337 | %if c.allowed_to_update: |
|
338 | 338 | % if not c.forbid_adding_reviewers: |
|
339 | 339 | <div id="add_reviewer_input" class="reviewer_ac"> |
|
340 | 340 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} |
|
341 | 341 | <div id="reviewers_container"></div> |
|
342 | 342 | </div> |
|
343 | 343 | % endif |
|
344 | 344 | <div class="pull-right"> |
|
345 | 345 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> |
|
346 | 346 | </div> |
|
347 | 347 | %endif |
|
348 | 348 | </div> |
|
349 | 349 | %endif |
|
350 | 350 | </div> |
|
351 | 351 | </div> |
|
352 | 352 | </div> |
|
353 | 353 | <div class="box"> |
|
354 | 354 | ##DIFF |
|
355 | 355 | <div class="table" > |
|
356 | 356 | <div id="changeset_compare_view_content"> |
|
357 | 357 | ##CS |
|
358 | 358 | % if c.missing_requirements: |
|
359 | 359 | <div class="box"> |
|
360 | 360 | <div class="alert alert-warning"> |
|
361 | 361 | <div> |
|
362 | 362 | <strong>${_('Missing requirements:')}</strong> |
|
363 | 363 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
364 | 364 | </div> |
|
365 | 365 | </div> |
|
366 | 366 | </div> |
|
367 | 367 | % elif c.missing_commits: |
|
368 | 368 | <div class="box"> |
|
369 | 369 | <div class="alert alert-warning"> |
|
370 | 370 | <div> |
|
371 | 371 | <strong>${_('Missing commits')}:</strong> |
|
372 | 372 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
373 | 373 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
374 | 374 | ${_('Consider doing a {force_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n} |
|
375 | 375 | </div> |
|
376 | 376 | </div> |
|
377 | 377 | </div> |
|
378 | 378 | % endif |
|
379 | 379 | |
|
380 | 380 | <div class="compare_view_commits_title"> |
|
381 | 381 | % if not c.compare_mode: |
|
382 | 382 | |
|
383 | 383 | % if c.at_version_pos: |
|
384 | 384 | <h4> |
|
385 | 385 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} |
|
386 | 386 | </h4> |
|
387 | 387 | % endif |
|
388 | 388 | |
|
389 | 389 | <div class="pull-left"> |
|
390 | 390 | <div class="btn-group"> |
|
391 | 391 | <a |
|
392 | 392 | class="btn" |
|
393 | 393 | href="#" |
|
394 | 394 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
395 | 395 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
396 | 396 | </a> |
|
397 | 397 | <a |
|
398 | 398 | class="btn" |
|
399 | 399 | href="#" |
|
400 | 400 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
401 | 401 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
402 | 402 | </a> |
|
403 | 403 | </div> |
|
404 | 404 | </div> |
|
405 | 405 | |
|
406 | 406 | <div class="pull-right"> |
|
407 | 407 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
408 | 408 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> |
|
409 | 409 | % else: |
|
410 | 410 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> |
|
411 | 411 | % endif |
|
412 | 412 | |
|
413 | 413 | </div> |
|
414 | 414 | % endif |
|
415 | 415 | </div> |
|
416 | 416 | |
|
417 | 417 | % if not c.missing_commits: |
|
418 | 418 | % if c.compare_mode: |
|
419 | 419 | % if c.at_version: |
|
420 | 420 | <h4> |
|
421 | 421 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: |
|
422 | 422 | </h4> |
|
423 | 423 | |
|
424 | 424 | <div class="subtitle-compare"> |
|
425 | 425 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} |
|
426 | 426 | </div> |
|
427 | 427 | |
|
428 | 428 | <div class="container"> |
|
429 | 429 | <table class="rctable compare_view_commits"> |
|
430 | 430 | <tr> |
|
431 | 431 | <th></th> |
|
432 | 432 | <th>${_('Time')}</th> |
|
433 | 433 | <th>${_('Author')}</th> |
|
434 | 434 | <th>${_('Commit')}</th> |
|
435 | 435 | <th></th> |
|
436 | 436 | <th>${_('Description')}</th> |
|
437 | 437 | </tr> |
|
438 | 438 | |
|
439 | 439 | % for c_type, commit in c.commit_changes: |
|
440 | 440 | % if c_type in ['a', 'r']: |
|
441 | 441 | <% |
|
442 | 442 | if c_type == 'a': |
|
443 | 443 | cc_title = _('Commit added in displayed changes') |
|
444 | 444 | elif c_type == 'r': |
|
445 | 445 | cc_title = _('Commit removed in displayed changes') |
|
446 | 446 | else: |
|
447 | 447 | cc_title = '' |
|
448 | 448 | %> |
|
449 | 449 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> |
|
450 | 450 | <td> |
|
451 | 451 | <div class="commit-change-indicator color-${c_type}-border"> |
|
452 | 452 | <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}"> |
|
453 | 453 | ${c_type.upper()} |
|
454 | 454 | </div> |
|
455 | 455 | </div> |
|
456 | 456 | </td> |
|
457 | 457 | <td class="td-time"> |
|
458 | 458 | ${h.age_component(commit.date)} |
|
459 | 459 | </td> |
|
460 | 460 | <td class="td-user"> |
|
461 | 461 | ${base.gravatar_with_user(commit.author, 16, tooltip=True)} |
|
462 | 462 | </td> |
|
463 | 463 | <td class="td-hash"> |
|
464 | 464 | <code> |
|
465 | 465 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
466 | 466 | r${commit.idx}:${h.short_id(commit.raw_id)} |
|
467 | 467 | </a> |
|
468 | 468 | ${h.hidden('revisions', commit.raw_id)} |
|
469 | 469 | </code> |
|
470 | 470 | </td> |
|
471 | 471 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}" onclick="commitsController.expandCommit(this); return false"> |
|
472 | 472 | <i class="icon-expand-linked"></i> |
|
473 | 473 | </td> |
|
474 | 474 | <td class="mid td-description"> |
|
475 | 475 | <div class="log-container truncate-wrap"> |
|
476 | 476 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${h.urlify_commit_message(commit.message, c.repo_name)}</div> |
|
477 | 477 | </div> |
|
478 | 478 | </td> |
|
479 | 479 | </tr> |
|
480 | 480 | % endif |
|
481 | 481 | % endfor |
|
482 | 482 | </table> |
|
483 | 483 | </div> |
|
484 | 484 | |
|
485 | 485 | % endif |
|
486 | 486 | |
|
487 | 487 | % else: |
|
488 | 488 | <%include file="/compare/compare_commits.mako" /> |
|
489 | 489 | % endif |
|
490 | 490 | |
|
491 | 491 | <div class="cs_files"> |
|
492 | 492 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
493 | 493 | % if c.at_version: |
|
494 | 494 | <% c.inline_cnt = len(c.inline_versions[c.at_version_num]['display']) %> |
|
495 | 495 | <% c.comments = c.comment_versions[c.at_version_num]['display'] %> |
|
496 | 496 | % else: |
|
497 | 497 | <% c.inline_cnt = len(c.inline_versions[c.at_version_num]['until']) %> |
|
498 | 498 | <% c.comments = c.comment_versions[c.at_version_num]['until'] %> |
|
499 | 499 | % endif |
|
500 | 500 | |
|
501 | 501 | <% |
|
502 | 502 | pr_menu_data = { |
|
503 | 503 | 'outdated_comm_count_ver': outdated_comm_count_ver |
|
504 | 504 | } |
|
505 | 505 | %> |
|
506 | 506 | |
|
507 | 507 | ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on)} |
|
508 | 508 | |
|
509 | 509 | % if c.range_diff_on: |
|
510 | 510 | % for commit in c.commit_ranges: |
|
511 | 511 | ${cbdiffs.render_diffset( |
|
512 | 512 | c.changes[commit.raw_id], |
|
513 | 513 | commit=commit, use_comments=True, |
|
514 | 514 | collapse_when_files_over=5, |
|
515 | 515 | disable_new_comments=True, |
|
516 | 516 | deleted_files_comments=c.deleted_files_comments, |
|
517 | 517 | inline_comments=c.inline_comments, |
|
518 | 518 | pull_request_menu=pr_menu_data)} |
|
519 | 519 | % endfor |
|
520 | 520 | % else: |
|
521 | 521 | ${cbdiffs.render_diffset( |
|
522 | 522 | c.diffset, use_comments=True, |
|
523 | 523 | collapse_when_files_over=30, |
|
524 | 524 | disable_new_comments=not c.allowed_to_comment, |
|
525 | 525 | deleted_files_comments=c.deleted_files_comments, |
|
526 | 526 | inline_comments=c.inline_comments, |
|
527 | 527 | pull_request_menu=pr_menu_data)} |
|
528 | 528 | % endif |
|
529 | 529 | |
|
530 | 530 | </div> |
|
531 | 531 | % else: |
|
532 | 532 | ## skipping commits we need to clear the view for missing commits |
|
533 | 533 | <div style="clear:both;"></div> |
|
534 | 534 | % endif |
|
535 | 535 | |
|
536 | 536 | </div> |
|
537 | 537 | </div> |
|
538 | 538 | |
|
539 | 539 | ## template for inline comment form |
|
540 | 540 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
541 | 541 | |
|
542 | 542 | ## comments heading with count |
|
543 | 543 | <div class="comments-heading"> |
|
544 | 544 | <i class="icon-comment"></i> |
|
545 | 545 | ${_('Comments')} ${len(c.comments)} |
|
546 | 546 | </div> |
|
547 | 547 | |
|
548 | 548 | ## render general comments |
|
549 | 549 | <div id="comment-tr-show"> |
|
550 | 550 | % if general_outdated_comm_count_ver: |
|
551 | 551 | <div class="info-box"> |
|
552 | 552 | % if general_outdated_comm_count_ver == 1: |
|
553 | 553 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, |
|
554 | 554 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> |
|
555 | 555 | % else: |
|
556 | 556 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, |
|
557 | 557 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> |
|
558 | 558 | % endif |
|
559 | 559 | </div> |
|
560 | 560 | % endif |
|
561 | 561 | </div> |
|
562 | 562 | |
|
563 | 563 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} |
|
564 | 564 | |
|
565 | 565 | % if not c.pull_request.is_closed(): |
|
566 | ## main comment form and it status | |
|
567 | ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, | |
|
568 | pull_request_id=c.pull_request.pull_request_id), | |
|
569 | c.pull_request_review_status, | |
|
570 | is_pull_request=True, change_status=c.allowed_to_change_status)} | |
|
571 | ||
|
566 | 572 | ## merge status, and merge action |
|
567 | 573 |
|
|
568 | 574 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> |
|
569 | 575 | </div> |
|
570 | 576 | |
|
571 | ## main comment form and it status | |
|
572 | ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, | |
|
573 | pull_request_id=c.pull_request.pull_request_id), | |
|
574 | c.pull_request_review_status, | |
|
575 | is_pull_request=True, change_status=c.allowed_to_change_status)} | |
|
576 | 577 |
|
|
577 | 578 | |
|
578 | 579 | <script type="text/javascript"> |
|
579 | 580 | |
|
580 | 581 | versionController = new VersionController(); |
|
581 | 582 | versionController.init(); |
|
582 | 583 | |
|
583 | 584 | reviewersController = new ReviewersController(); |
|
584 | 585 | commitsController = new CommitsController(); |
|
585 | 586 | |
|
586 | 587 | $(function(){ |
|
587 | 588 | |
|
588 | 589 | // custom code mirror |
|
589 | 590 | var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm; |
|
590 | 591 | |
|
591 | 592 | var PRDetails = { |
|
592 | 593 | editButton: $('#open_edit_pullrequest'), |
|
593 | 594 | closeButton: $('#close_edit_pullrequest'), |
|
594 | 595 | deleteButton: $('#delete_pullrequest'), |
|
595 | 596 | viewFields: $('#pr-desc, #pr-title'), |
|
596 | 597 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
597 | 598 | |
|
598 | 599 | init: function() { |
|
599 | 600 | var that = this; |
|
600 | 601 | this.editButton.on('click', function(e) { that.edit(); }); |
|
601 | 602 | this.closeButton.on('click', function(e) { that.view(); }); |
|
602 | 603 | }, |
|
603 | 604 | |
|
604 | 605 | edit: function(event) { |
|
605 | 606 | this.viewFields.hide(); |
|
606 | 607 | this.editButton.hide(); |
|
607 | 608 | this.deleteButton.hide(); |
|
608 | 609 | this.closeButton.show(); |
|
609 | 610 | this.editFields.show(); |
|
610 | 611 | codeMirrorInstance.refresh(); |
|
611 | 612 | }, |
|
612 | 613 | |
|
613 | 614 | view: function(event) { |
|
614 | 615 | this.editButton.show(); |
|
615 | 616 | this.deleteButton.show(); |
|
616 | 617 | this.editFields.hide(); |
|
617 | 618 | this.closeButton.hide(); |
|
618 | 619 | this.viewFields.show(); |
|
619 | 620 | } |
|
620 | 621 | }; |
|
621 | 622 | |
|
622 | 623 | var ReviewersPanel = { |
|
623 | 624 | editButton: $('#open_edit_reviewers'), |
|
624 | 625 | closeButton: $('#close_edit_reviewers'), |
|
625 | 626 | addButton: $('#add_reviewer'), |
|
626 | 627 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'), |
|
627 | 628 | |
|
628 | 629 | init: function() { |
|
629 | 630 | var self = this; |
|
630 | 631 | this.editButton.on('click', function(e) { self.edit(); }); |
|
631 | 632 | this.closeButton.on('click', function(e) { self.close(); }); |
|
632 | 633 | }, |
|
633 | 634 | |
|
634 | 635 | edit: function(event) { |
|
635 | 636 | this.editButton.hide(); |
|
636 | 637 | this.closeButton.show(); |
|
637 | 638 | this.addButton.show(); |
|
638 | 639 | this.removeButtons.css('visibility', 'visible'); |
|
639 | 640 | // review rules |
|
640 | 641 | reviewersController.loadReviewRules( |
|
641 | 642 | ${c.pull_request.reviewer_data_json | n}); |
|
642 | 643 | }, |
|
643 | 644 | |
|
644 | 645 | close: function(event) { |
|
645 | 646 | this.editButton.show(); |
|
646 | 647 | this.closeButton.hide(); |
|
647 | 648 | this.addButton.hide(); |
|
648 | 649 | this.removeButtons.css('visibility', 'hidden'); |
|
649 | 650 | // hide review rules |
|
650 | 651 | reviewersController.hideReviewRules() |
|
651 | 652 | } |
|
652 | 653 | }; |
|
653 | 654 | |
|
654 | 655 | PRDetails.init(); |
|
655 | 656 | ReviewersPanel.init(); |
|
656 | 657 | |
|
657 | 658 | showOutdated = function(self){ |
|
658 | 659 | $('.comment-inline.comment-outdated').show(); |
|
659 | 660 | $('.filediff-outdated').show(); |
|
660 | 661 | $('.showOutdatedComments').hide(); |
|
661 | 662 | $('.hideOutdatedComments').show(); |
|
662 | 663 | }; |
|
663 | 664 | |
|
664 | 665 | hideOutdated = function(self){ |
|
665 | 666 | $('.comment-inline.comment-outdated').hide(); |
|
666 | 667 | $('.filediff-outdated').hide(); |
|
667 | 668 | $('.hideOutdatedComments').hide(); |
|
668 | 669 | $('.showOutdatedComments').show(); |
|
669 | 670 | }; |
|
670 | 671 | |
|
671 | 672 | refreshMergeChecks = function(){ |
|
672 | 673 | var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}"; |
|
673 | 674 | $('.pull-request-merge').css('opacity', 0.3); |
|
674 | 675 | $('.action-buttons-extra').css('opacity', 0.3); |
|
675 | 676 | |
|
676 | 677 | $('.pull-request-merge').load( |
|
677 | 678 | loadUrl, function() { |
|
678 | 679 | $('.pull-request-merge').css('opacity', 1); |
|
679 | 680 | |
|
680 | 681 | $('.action-buttons-extra').css('opacity', 1); |
|
681 | 682 | } |
|
682 | 683 | ); |
|
683 | 684 | }; |
|
684 | 685 | |
|
685 | 686 | closePullRequest = function (status) { |
|
686 | 687 | // inject closing flag |
|
687 | 688 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); |
|
688 | 689 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); |
|
689 | 690 | $(generalCommentForm.submitForm).submit(); |
|
690 | 691 | }; |
|
691 | 692 | |
|
692 | 693 | $('#show-outdated-comments').on('click', function(e){ |
|
693 | 694 | var button = $(this); |
|
694 | 695 | var outdated = $('.comment-outdated'); |
|
695 | 696 | |
|
696 | 697 | if (button.html() === "(Show)") { |
|
697 | 698 | button.html("(Hide)"); |
|
698 | 699 | outdated.show(); |
|
699 | 700 | } else { |
|
700 | 701 | button.html("(Show)"); |
|
701 | 702 | outdated.hide(); |
|
702 | 703 | } |
|
703 | 704 | }); |
|
704 | 705 | |
|
705 | 706 | $('.show-inline-comments').on('change', function(e){ |
|
706 | 707 | var show = 'none'; |
|
707 | 708 | var target = e.currentTarget; |
|
708 | 709 | if(target.checked){ |
|
709 | 710 | show = '' |
|
710 | 711 | } |
|
711 | 712 | var boxid = $(target).attr('id_for'); |
|
712 | 713 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
713 | 714 | var fn_display = function(idx){ |
|
714 | 715 | $(this).css('display', show); |
|
715 | 716 | }; |
|
716 | 717 | $(comments).each(fn_display); |
|
717 | 718 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
718 | 719 | $(btns).each(fn_display); |
|
719 | 720 | }); |
|
720 | 721 | |
|
721 | 722 | $('#merge_pull_request_form').submit(function() { |
|
722 | 723 | if (!$('#merge_pull_request').attr('disabled')) { |
|
723 | 724 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
724 | 725 | } |
|
725 | 726 | return true; |
|
726 | 727 | }); |
|
727 | 728 | |
|
728 | 729 | $('#edit_pull_request').on('click', function(e){ |
|
729 | 730 | var title = $('#pr-title-input').val(); |
|
730 | 731 | var description = codeMirrorInstance.getValue(); |
|
731 | 732 | var renderer = $('#pr-renderer-input').val(); |
|
732 | 733 | editPullRequest( |
|
733 | 734 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
734 | 735 | title, description, renderer); |
|
735 | 736 | }); |
|
736 | 737 | |
|
737 | 738 | $('#update_pull_request').on('click', function(e){ |
|
738 | 739 | $(this).attr('disabled', 'disabled'); |
|
739 | 740 | $(this).addClass('disabled'); |
|
740 | 741 | $(this).html(_gettext('Saving...')); |
|
741 | 742 | reviewersController.updateReviewers( |
|
742 | 743 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
743 | 744 | }); |
|
744 | 745 | |
|
745 | 746 | $('#update_commits').on('click', function(e){ |
|
746 | 747 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
747 | 748 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
748 | 749 | $(e.currentTarget).addClass('disabled'); |
|
749 | 750 | $(e.currentTarget).removeClass('btn-primary'); |
|
750 | 751 | $(e.currentTarget).text(_gettext('Updating...')); |
|
751 | 752 | if(isDisabled){ |
|
752 | 753 | updateCommits( |
|
753 | 754 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
754 | 755 | } |
|
755 | 756 | }); |
|
756 | 757 | // fixing issue with caches on firefox |
|
757 | 758 | $('#update_commits').removeAttr("disabled"); |
|
758 | 759 | |
|
759 | 760 | $('.show-inline-comments').on('click', function(e){ |
|
760 | 761 | var boxid = $(this).attr('data-comment-id'); |
|
761 | 762 | var button = $(this); |
|
762 | 763 | |
|
763 | 764 | if(button.hasClass("comments-visible")) { |
|
764 | 765 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
765 | 766 | $(this).hide(); |
|
766 | 767 | }); |
|
767 | 768 | button.removeClass("comments-visible"); |
|
768 | 769 | } else { |
|
769 | 770 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
770 | 771 | $(this).show(); |
|
771 | 772 | }); |
|
772 | 773 | button.addClass("comments-visible"); |
|
773 | 774 | } |
|
774 | 775 | }); |
|
775 | 776 | |
|
776 | 777 | // register submit callback on commentForm form to track TODOs |
|
777 | 778 | window.commentFormGlobalSubmitSuccessCallback = function(){ |
|
778 | 779 | refreshMergeChecks(); |
|
779 | 780 | }; |
|
780 | 781 | |
|
781 | 782 | ReviewerAutoComplete('#user'); |
|
782 | 783 | |
|
783 | 784 | }) |
|
784 | 785 | |
|
785 | 786 | </script> |
|
786 | 787 | |
|
787 | 788 | </div> |
|
788 | 789 | </div> |
|
789 | 790 | |
|
790 | 791 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now