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