##// END OF EJS Templates
diffs: added handy quick file selector in diffs views.
ergo -
r3100:c6e45536 default
parent child Browse files
Show More
@@ -1,1152 +1,1167 b''
1 // Default styles
1 // Default styles
2
2
3 .diff-collapse {
3 .diff-collapse {
4 margin: @padding 0;
4 margin: @padding 0;
5 text-align: right;
5 text-align: right;
6 }
6 }
7
7
8 .diff-container {
8 .diff-container {
9 margin-bottom: @space;
9 margin-bottom: @space;
10
10
11 .diffblock {
11 .diffblock {
12 margin-bottom: @space;
12 margin-bottom: @space;
13 }
13 }
14
14
15 &.hidden {
15 &.hidden {
16 display: none;
16 display: none;
17 overflow: hidden;
17 overflow: hidden;
18 }
18 }
19 }
19 }
20
20
21
21
22 div.diffblock .sidebyside {
22 div.diffblock .sidebyside {
23 background: #ffffff;
23 background: #ffffff;
24 }
24 }
25
25
26 div.diffblock {
26 div.diffblock {
27 overflow-x: auto;
27 overflow-x: auto;
28 overflow-y: hidden;
28 overflow-y: hidden;
29 clear: both;
29 clear: both;
30 padding: 0px;
30 padding: 0px;
31 background: @grey6;
31 background: @grey6;
32 border: @border-thickness solid @grey5;
32 border: @border-thickness solid @grey5;
33 -webkit-border-radius: @border-radius @border-radius 0px 0px;
33 -webkit-border-radius: @border-radius @border-radius 0px 0px;
34 border-radius: @border-radius @border-radius 0px 0px;
34 border-radius: @border-radius @border-radius 0px 0px;
35
35
36
36
37 .comments-number {
37 .comments-number {
38 float: right;
38 float: right;
39 }
39 }
40
40
41 // BEGIN CODE-HEADER STYLES
41 // BEGIN CODE-HEADER STYLES
42
42
43 .code-header {
43 .code-header {
44 background: @grey6;
44 background: @grey6;
45 padding: 10px 0 10px 0;
45 padding: 10px 0 10px 0;
46 height: auto;
46 height: auto;
47 width: 100%;
47 width: 100%;
48
48
49 .hash {
49 .hash {
50 float: left;
50 float: left;
51 padding: 2px 0 0 2px;
51 padding: 2px 0 0 2px;
52 }
52 }
53
53
54 .date {
54 .date {
55 float: left;
55 float: left;
56 text-transform: uppercase;
56 text-transform: uppercase;
57 padding: 4px 0px 0px 2px;
57 padding: 4px 0px 0px 2px;
58 }
58 }
59
59
60 div {
60 div {
61 margin-left: 4px;
61 margin-left: 4px;
62 }
62 }
63
63
64 div.compare_header {
64 div.compare_header {
65 min-height: 40px;
65 min-height: 40px;
66 margin: 0;
66 margin: 0;
67 padding: 0 @padding;
67 padding: 0 @padding;
68
68
69 .drop-menu {
69 .drop-menu {
70 float:left;
70 float:left;
71 display: block;
71 display: block;
72 margin:0 0 @padding 0;
72 margin:0 0 @padding 0;
73 }
73 }
74
74
75 .compare-label {
75 .compare-label {
76 float: left;
76 float: left;
77 clear: both;
77 clear: both;
78 display: inline-block;
78 display: inline-block;
79 min-width: 5em;
79 min-width: 5em;
80 margin: 0;
80 margin: 0;
81 padding: @button-padding @button-padding @button-padding 0;
81 padding: @button-padding @button-padding @button-padding 0;
82 font-family: @text-semibold;
82 font-family: @text-semibold;
83 }
83 }
84
84
85 .compare-buttons {
85 .compare-buttons {
86 float: left;
86 float: left;
87 margin: 0;
87 margin: 0;
88 padding: 0 0 @padding;
88 padding: 0 0 @padding;
89
89
90 .btn {
90 .btn {
91 margin: 0 @padding 0 0;
91 margin: 0 @padding 0 0;
92 }
92 }
93 }
93 }
94 }
94 }
95
95
96 }
96 }
97
97
98 .parents {
98 .parents {
99 float: left;
99 float: left;
100 width: 100px;
100 width: 100px;
101 font-weight: 400;
101 font-weight: 400;
102 vertical-align: middle;
102 vertical-align: middle;
103 padding: 0px 2px 0px 2px;
103 padding: 0px 2px 0px 2px;
104 background-color: @grey6;
104 background-color: @grey6;
105
105
106 #parent_link {
106 #parent_link {
107 margin: 00px 2px;
107 margin: 00px 2px;
108
108
109 &.double {
109 &.double {
110 margin: 0px 2px;
110 margin: 0px 2px;
111 }
111 }
112
112
113 &.disabled{
113 &.disabled{
114 margin-right: @padding;
114 margin-right: @padding;
115 }
115 }
116 }
116 }
117 }
117 }
118
118
119 .children {
119 .children {
120 float: right;
120 float: right;
121 width: 100px;
121 width: 100px;
122 font-weight: 400;
122 font-weight: 400;
123 vertical-align: middle;
123 vertical-align: middle;
124 text-align: right;
124 text-align: right;
125 padding: 0px 2px 0px 2px;
125 padding: 0px 2px 0px 2px;
126 background-color: @grey6;
126 background-color: @grey6;
127
127
128 #child_link {
128 #child_link {
129 margin: 0px 2px;
129 margin: 0px 2px;
130
130
131 &.double {
131 &.double {
132 margin: 0px 2px;
132 margin: 0px 2px;
133 }
133 }
134
134
135 &.disabled{
135 &.disabled{
136 margin-right: @padding;
136 margin-right: @padding;
137 }
137 }
138 }
138 }
139 }
139 }
140
140
141 .changeset_header {
141 .changeset_header {
142 height: 16px;
142 height: 16px;
143
143
144 & > div{
144 & > div{
145 margin-right: @padding;
145 margin-right: @padding;
146 }
146 }
147 }
147 }
148
148
149 .changeset_file {
149 .changeset_file {
150 text-align: left;
150 text-align: left;
151 float: left;
151 float: left;
152 padding: 0;
152 padding: 0;
153
153
154 a{
154 a{
155 display: inline-block;
155 display: inline-block;
156 margin-right: 0.5em;
156 margin-right: 0.5em;
157 }
157 }
158
158
159 #selected_mode{
159 #selected_mode{
160 margin-left: 0;
160 margin-left: 0;
161 }
161 }
162 }
162 }
163
163
164 .diff-menu-wrapper {
164 .diff-menu-wrapper {
165 float: left;
165 float: left;
166 }
166 }
167
167
168 .diff-menu {
168 .diff-menu {
169 position: absolute;
169 position: absolute;
170 background: none repeat scroll 0 0 #FFFFFF;
170 background: none repeat scroll 0 0 #FFFFFF;
171 border-color: #003367 @grey3 @grey3;
171 border-color: #003367 @grey3 @grey3;
172 border-right: 1px solid @grey3;
172 border-right: 1px solid @grey3;
173 border-style: solid solid solid;
173 border-style: solid solid solid;
174 border-width: @border-thickness;
174 border-width: @border-thickness;
175 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
175 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
176 margin-top: 5px;
176 margin-top: 5px;
177 margin-left: 1px;
177 margin-left: 1px;
178 }
178 }
179
179
180 .diff-actions, .editor-actions {
180 .diff-actions, .editor-actions {
181 float: left;
181 float: left;
182
182
183 input{
183 input{
184 margin: 0 0.5em 0 0;
184 margin: 0 0.5em 0 0;
185 }
185 }
186 }
186 }
187
187
188 // END CODE-HEADER STYLES
188 // END CODE-HEADER STYLES
189
189
190 // BEGIN CODE-BODY STYLES
190 // BEGIN CODE-BODY STYLES
191
191
192 .code-body {
192 .code-body {
193 padding: 0;
193 padding: 0;
194 background-color: #ffffff;
194 background-color: #ffffff;
195 position: relative;
195 position: relative;
196 max-width: none;
196 max-width: none;
197 box-sizing: border-box;
197 box-sizing: border-box;
198 // TODO: johbo: Parent has overflow: auto, this forces the child here
198 // TODO: johbo: Parent has overflow: auto, this forces the child here
199 // to have the intended size and to scroll. Should be simplified.
199 // to have the intended size and to scroll. Should be simplified.
200 width: 100%;
200 width: 100%;
201 overflow-x: auto;
201 overflow-x: auto;
202 }
202 }
203
203
204 pre.raw {
204 pre.raw {
205 background: white;
205 background: white;
206 color: @grey1;
206 color: @grey1;
207 }
207 }
208 // END CODE-BODY STYLES
208 // END CODE-BODY STYLES
209
209
210 }
210 }
211
211
212
212
213 table.code-difftable {
213 table.code-difftable {
214 border-collapse: collapse;
214 border-collapse: collapse;
215 width: 99%;
215 width: 99%;
216 border-radius: 0px !important;
216 border-radius: 0px !important;
217
217
218 td {
218 td {
219 padding: 0 !important;
219 padding: 0 !important;
220 background: none !important;
220 background: none !important;
221 border: 0 !important;
221 border: 0 !important;
222 }
222 }
223
223
224 .context {
224 .context {
225 background: none repeat scroll 0 0 #DDE7EF;
225 background: none repeat scroll 0 0 #DDE7EF;
226 }
226 }
227
227
228 .add {
228 .add {
229 background: none repeat scroll 0 0 #DDFFDD;
229 background: none repeat scroll 0 0 #DDFFDD;
230
230
231 ins {
231 ins {
232 background: none repeat scroll 0 0 #AAFFAA;
232 background: none repeat scroll 0 0 #AAFFAA;
233 text-decoration: none;
233 text-decoration: none;
234 }
234 }
235 }
235 }
236
236
237 .del {
237 .del {
238 background: none repeat scroll 0 0 #FFDDDD;
238 background: none repeat scroll 0 0 #FFDDDD;
239
239
240 del {
240 del {
241 background: none repeat scroll 0 0 #FFAAAA;
241 background: none repeat scroll 0 0 #FFAAAA;
242 text-decoration: none;
242 text-decoration: none;
243 }
243 }
244 }
244 }
245
245
246 /** LINE NUMBERS **/
246 /** LINE NUMBERS **/
247 .lineno {
247 .lineno {
248 padding-left: 2px !important;
248 padding-left: 2px !important;
249 padding-right: 2px;
249 padding-right: 2px;
250 text-align: right;
250 text-align: right;
251 width: 32px;
251 width: 32px;
252 -moz-user-select: none;
252 -moz-user-select: none;
253 -webkit-user-select: none;
253 -webkit-user-select: none;
254 border-right: @border-thickness solid @grey5 !important;
254 border-right: @border-thickness solid @grey5 !important;
255 border-left: 0px solid #CCC !important;
255 border-left: 0px solid #CCC !important;
256 border-top: 0px solid #CCC !important;
256 border-top: 0px solid #CCC !important;
257 border-bottom: none !important;
257 border-bottom: none !important;
258
258
259 a {
259 a {
260 &:extend(pre);
260 &:extend(pre);
261 text-align: right;
261 text-align: right;
262 padding-right: 2px;
262 padding-right: 2px;
263 cursor: pointer;
263 cursor: pointer;
264 display: block;
264 display: block;
265 width: 32px;
265 width: 32px;
266 }
266 }
267 }
267 }
268
268
269 .context {
269 .context {
270 cursor: auto;
270 cursor: auto;
271 &:extend(pre);
271 &:extend(pre);
272 }
272 }
273
273
274 .lineno-inline {
274 .lineno-inline {
275 background: none repeat scroll 0 0 #FFF !important;
275 background: none repeat scroll 0 0 #FFF !important;
276 padding-left: 2px;
276 padding-left: 2px;
277 padding-right: 2px;
277 padding-right: 2px;
278 text-align: right;
278 text-align: right;
279 width: 30px;
279 width: 30px;
280 -moz-user-select: none;
280 -moz-user-select: none;
281 -webkit-user-select: none;
281 -webkit-user-select: none;
282 }
282 }
283
283
284 /** CODE **/
284 /** CODE **/
285 .code {
285 .code {
286 display: block;
286 display: block;
287 width: 100%;
287 width: 100%;
288
288
289 td {
289 td {
290 margin: 0;
290 margin: 0;
291 padding: 0;
291 padding: 0;
292 }
292 }
293
293
294 pre {
294 pre {
295 margin: 0;
295 margin: 0;
296 padding: 0;
296 padding: 0;
297 margin-left: .5em;
297 margin-left: .5em;
298 }
298 }
299 }
299 }
300 }
300 }
301
301
302
302
303 // Comments
303 // Comments
304
304
305 div.comment:target {
305 div.comment:target {
306 border-left: 6px solid @comment-highlight-color !important;
306 border-left: 6px solid @comment-highlight-color !important;
307 padding-left: 3px;
307 padding-left: 3px;
308 margin-left: -9px;
308 margin-left: -9px;
309 }
309 }
310
310
311 //TODO: anderson: can't get an absolute number out of anything, so had to put the
311 //TODO: anderson: can't get an absolute number out of anything, so had to put the
312 //current values that might change. But to make it clear I put as a calculation
312 //current values that might change. But to make it clear I put as a calculation
313 @comment-max-width: 1065px;
313 @comment-max-width: 1065px;
314 @pr-extra-margin: 34px;
314 @pr-extra-margin: 34px;
315 @pr-border-spacing: 4px;
315 @pr-border-spacing: 4px;
316 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
316 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
317
317
318 // Pull Request
318 // Pull Request
319 .cs_files .code-difftable {
319 .cs_files .code-difftable {
320 border: @border-thickness solid @grey5; //borders only on PRs
320 border: @border-thickness solid @grey5; //borders only on PRs
321
321
322 .comment-inline-form,
322 .comment-inline-form,
323 div.comment {
323 div.comment {
324 width: @pr-comment-width;
324 width: @pr-comment-width;
325 }
325 }
326 }
326 }
327
327
328 // Changeset
328 // Changeset
329 .code-difftable {
329 .code-difftable {
330 .comment-inline-form,
330 .comment-inline-form,
331 div.comment {
331 div.comment {
332 width: @comment-max-width;
332 width: @comment-max-width;
333 }
333 }
334 }
334 }
335
335
336 //Style page
336 //Style page
337 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
337 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
338 #style-page .code-difftable{
338 #style-page .code-difftable{
339 .comment-inline-form,
339 .comment-inline-form,
340 div.comment {
340 div.comment {
341 width: @comment-max-width - @style-extra-margin;
341 width: @comment-max-width - @style-extra-margin;
342 }
342 }
343 }
343 }
344
344
345 #context-bar > h2 {
345 #context-bar > h2 {
346 font-size: 20px;
346 font-size: 20px;
347 }
347 }
348
348
349 #context-bar > h2> a {
349 #context-bar > h2> a {
350 font-size: 20px;
350 font-size: 20px;
351 }
351 }
352 // end of defaults
352 // end of defaults
353
353
354 .file_diff_buttons {
354 .file_diff_buttons {
355 padding: 0 0 @padding;
355 padding: 0 0 @padding;
356
356
357 .drop-menu {
357 .drop-menu {
358 float: left;
358 float: left;
359 margin: 0 @padding 0 0;
359 margin: 0 @padding 0 0;
360 }
360 }
361 .btn {
361 .btn {
362 margin: 0 @padding 0 0;
362 margin: 0 @padding 0 0;
363 }
363 }
364 }
364 }
365
365
366 .code-body.textarea.editor {
366 .code-body.textarea.editor {
367 max-width: none;
367 max-width: none;
368 padding: 15px;
368 padding: 15px;
369 }
369 }
370
370
371 td.injected_diff{
371 td.injected_diff{
372 max-width: 1178px;
372 max-width: 1178px;
373 overflow-x: auto;
373 overflow-x: auto;
374 overflow-y: hidden;
374 overflow-y: hidden;
375
375
376 div.diff-container,
376 div.diff-container,
377 div.diffblock{
377 div.diffblock{
378 max-width: 100%;
378 max-width: 100%;
379 }
379 }
380
380
381 div.code-body {
381 div.code-body {
382 max-width: 1124px;
382 max-width: 1124px;
383 overflow-x: auto;
383 overflow-x: auto;
384 overflow-y: hidden;
384 overflow-y: hidden;
385 padding: 0;
385 padding: 0;
386 }
386 }
387 div.diffblock {
387 div.diffblock {
388 border: none;
388 border: none;
389 }
389 }
390
390
391 &.inline-form {
391 &.inline-form {
392 width: 99%
392 width: 99%
393 }
393 }
394 }
394 }
395
395
396
396
397 table.code-difftable {
397 table.code-difftable {
398 width: 100%;
398 width: 100%;
399 }
399 }
400
400
401 /** PYGMENTS COLORING **/
401 /** PYGMENTS COLORING **/
402 div.codeblock {
402 div.codeblock {
403
403
404 // TODO: johbo: Added interim to get rid of the margin around
404 // TODO: johbo: Added interim to get rid of the margin around
405 // Select2 widgets. This needs further cleanup.
405 // Select2 widgets. This needs further cleanup.
406 margin-top: @padding;
406 margin-top: @padding;
407
407
408 overflow: auto;
408 overflow: auto;
409 padding: 0px;
409 padding: 0px;
410 border: @border-thickness solid @grey5;
410 border: @border-thickness solid @grey5;
411 background: @grey6;
411 background: @grey6;
412 .border-radius(@border-radius);
412 .border-radius(@border-radius);
413
413
414 #remove_gist {
414 #remove_gist {
415 float: right;
415 float: right;
416 }
416 }
417
417
418 .gist_url {
418 .gist_url {
419 padding: 0px 0px 10px 0px;
419 padding: 0px 0px 10px 0px;
420 }
420 }
421
421
422 .author {
422 .author {
423 clear: both;
423 clear: both;
424 vertical-align: middle;
424 vertical-align: middle;
425 font-family: @text-bold;
425 font-family: @text-bold;
426 }
426 }
427
427
428 .btn-mini {
428 .btn-mini {
429 float: left;
429 float: left;
430 margin: 0 5px 0 0;
430 margin: 0 5px 0 0;
431 }
431 }
432
432
433 .code-header {
433 .code-header {
434 padding: @padding;
434 padding: @padding;
435 border-bottom: @border-thickness solid @grey5;
435 border-bottom: @border-thickness solid @grey5;
436
436
437 .rc-user {
437 .rc-user {
438 min-width: 0;
438 min-width: 0;
439 margin-right: .5em;
439 margin-right: .5em;
440 }
440 }
441
441
442 .stats {
442 .stats {
443 clear: both;
443 clear: both;
444 margin: 0 0 @padding 0;
444 margin: 0 0 @padding 0;
445 padding: 0;
445 padding: 0;
446 .left {
446 .left {
447 float: left;
447 float: left;
448 clear: left;
448 clear: left;
449 max-width: 75%;
449 max-width: 75%;
450 margin: 0 0 @padding 0;
450 margin: 0 0 @padding 0;
451
451
452 &.item {
452 &.item {
453 margin-right: @padding;
453 margin-right: @padding;
454 &.last { border-right: none; }
454 &.last { border-right: none; }
455 }
455 }
456 }
456 }
457 .buttons { float: right; }
457 .buttons { float: right; }
458 .author {
458 .author {
459 height: 25px; margin-left: 15px; font-weight: bold;
459 height: 25px; margin-left: 15px; font-weight: bold;
460 }
460 }
461 }
461 }
462
462
463 .commit {
463 .commit {
464 margin: 5px 0 0 26px;
464 margin: 5px 0 0 26px;
465 font-weight: normal;
465 font-weight: normal;
466 white-space: pre-wrap;
466 white-space: pre-wrap;
467 }
467 }
468 }
468 }
469
469
470 .message {
470 .message {
471 position: relative;
471 position: relative;
472 margin: @padding;
472 margin: @padding;
473
473
474 .codeblock-label {
474 .codeblock-label {
475 margin: 0 0 1em 0;
475 margin: 0 0 1em 0;
476 }
476 }
477 }
477 }
478
478
479 .code-body {
479 .code-body {
480 padding: @padding;
480 padding: @padding;
481 background-color: #ffffff;
481 background-color: #ffffff;
482 min-width: 100%;
482 min-width: 100%;
483 box-sizing: border-box;
483 box-sizing: border-box;
484 // TODO: johbo: Parent has overflow: auto, this forces the child here
484 // TODO: johbo: Parent has overflow: auto, this forces the child here
485 // to have the intended size and to scroll. Should be simplified.
485 // to have the intended size and to scroll. Should be simplified.
486 width: 100%;
486 width: 100%;
487 overflow-x: auto;
487 overflow-x: auto;
488
488
489 img.rendered-binary {
489 img.rendered-binary {
490 height: auto;
490 height: auto;
491 width: 100%;
491 width: 100%;
492 }
492 }
493 }
493 }
494 }
494 }
495
495
496 .code-highlighttable,
496 .code-highlighttable,
497 div.codeblock {
497 div.codeblock {
498
498
499 &.readme {
499 &.readme {
500 background-color: white;
500 background-color: white;
501 }
501 }
502
502
503 .markdown-block table {
503 .markdown-block table {
504 border-collapse: collapse;
504 border-collapse: collapse;
505
505
506 th,
506 th,
507 td {
507 td {
508 padding: .5em;
508 padding: .5em;
509 border: @border-thickness solid @border-default-color;
509 border: @border-thickness solid @border-default-color;
510 }
510 }
511 }
511 }
512
512
513 table {
513 table {
514 border: 0px;
514 border: 0px;
515 margin: 0;
515 margin: 0;
516 letter-spacing: normal;
516 letter-spacing: normal;
517
517
518
518
519 td {
519 td {
520 border: 0px;
520 border: 0px;
521 vertical-align: top;
521 vertical-align: top;
522 }
522 }
523 }
523 }
524 }
524 }
525
525
526 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
526 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
527 div.search-code-body {
527 div.search-code-body {
528 background-color: #ffffff; padding: 5px 0 5px 10px;
528 background-color: #ffffff; padding: 5px 0 5px 10px;
529 pre {
529 pre {
530 .match { background-color: #faffa6;}
530 .match { background-color: #faffa6;}
531 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
531 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
532 }
532 }
533 .code-highlighttable {
533 .code-highlighttable {
534 border-collapse: collapse;
534 border-collapse: collapse;
535
535
536 tr:hover {
536 tr:hover {
537 background: #fafafa;
537 background: #fafafa;
538 }
538 }
539 td.code {
539 td.code {
540 padding-left: 10px;
540 padding-left: 10px;
541 }
541 }
542 td.line {
542 td.line {
543 border-right: 1px solid #ccc !important;
543 border-right: 1px solid #ccc !important;
544 padding-right: 10px;
544 padding-right: 10px;
545 text-align: right;
545 text-align: right;
546 font-family: "Lucida Console",Monaco,monospace;
546 font-family: "Lucida Console",Monaco,monospace;
547 span {
547 span {
548 white-space: pre-wrap;
548 white-space: pre-wrap;
549 color: #666666;
549 color: #666666;
550 }
550 }
551 }
551 }
552 }
552 }
553 }
553 }
554
554
555 div.annotatediv { margin-left: 2px; margin-right: 4px; }
555 div.annotatediv { margin-left: 2px; margin-right: 4px; }
556 .code-highlight {
556 .code-highlight {
557 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
557 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
558 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
558 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
559 pre div:target {background-color: @comment-highlight-color !important;}
559 pre div:target {background-color: @comment-highlight-color !important;}
560 }
560 }
561
561
562 .linenos a { text-decoration: none; }
562 .linenos a { text-decoration: none; }
563
563
564 .CodeMirror-selected { background: @rchighlightblue; }
564 .CodeMirror-selected { background: @rchighlightblue; }
565 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
565 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
566 .CodeMirror ::selection { background: @rchighlightblue; }
566 .CodeMirror ::selection { background: @rchighlightblue; }
567 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
567 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
568
568
569 .code { display: block; border:0px !important; }
569 .code { display: block; border:0px !important; }
570 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
570 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
571 .codehilite {
571 .codehilite {
572 .hll { background-color: #ffffcc }
572 .hll { background-color: #ffffcc }
573 .c { color: #408080; font-style: italic } /* Comment */
573 .c { color: #408080; font-style: italic } /* Comment */
574 .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */
574 .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */
575 .k { color: #008000; font-weight: bold } /* Keyword */
575 .k { color: #008000; font-weight: bold } /* Keyword */
576 .o { color: #666666 } /* Operator */
576 .o { color: #666666 } /* Operator */
577 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
577 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
578 .cp { color: #BC7A00 } /* Comment.Preproc */
578 .cp { color: #BC7A00 } /* Comment.Preproc */
579 .c1 { color: #408080; font-style: italic } /* Comment.Single */
579 .c1 { color: #408080; font-style: italic } /* Comment.Single */
580 .cs { color: #408080; font-style: italic } /* Comment.Special */
580 .cs { color: #408080; font-style: italic } /* Comment.Special */
581 .gd { color: #A00000 } /* Generic.Deleted */
581 .gd { color: #A00000 } /* Generic.Deleted */
582 .ge { font-style: italic } /* Generic.Emph */
582 .ge { font-style: italic } /* Generic.Emph */
583 .gr { color: #FF0000 } /* Generic.Error */
583 .gr { color: #FF0000 } /* Generic.Error */
584 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
584 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
585 .gi { color: #00A000 } /* Generic.Inserted */
585 .gi { color: #00A000 } /* Generic.Inserted */
586 .go { color: #808080 } /* Generic.Output */
586 .go { color: #808080 } /* Generic.Output */
587 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
587 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
588 .gs { font-weight: bold } /* Generic.Strong */
588 .gs { font-weight: bold } /* Generic.Strong */
589 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
589 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
590 .gt { color: #0040D0 } /* Generic.Traceback */
590 .gt { color: #0040D0 } /* Generic.Traceback */
591 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
591 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
592 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
592 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
593 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
593 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
594 .kp { color: #008000 } /* Keyword.Pseudo */
594 .kp { color: #008000 } /* Keyword.Pseudo */
595 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
595 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
596 .kt { color: #B00040 } /* Keyword.Type */
596 .kt { color: #B00040 } /* Keyword.Type */
597 .m { color: #666666 } /* Literal.Number */
597 .m { color: #666666 } /* Literal.Number */
598 .s { color: #BA2121 } /* Literal.String */
598 .s { color: #BA2121 } /* Literal.String */
599 .na { color: #7D9029 } /* Name.Attribute */
599 .na { color: #7D9029 } /* Name.Attribute */
600 .nb { color: #008000 } /* Name.Builtin */
600 .nb { color: #008000 } /* Name.Builtin */
601 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
601 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
602 .no { color: #880000 } /* Name.Constant */
602 .no { color: #880000 } /* Name.Constant */
603 .nd { color: #AA22FF } /* Name.Decorator */
603 .nd { color: #AA22FF } /* Name.Decorator */
604 .ni { color: #999999; font-weight: bold } /* Name.Entity */
604 .ni { color: #999999; font-weight: bold } /* Name.Entity */
605 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
605 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
606 .nf { color: #0000FF } /* Name.Function */
606 .nf { color: #0000FF } /* Name.Function */
607 .nl { color: #A0A000 } /* Name.Label */
607 .nl { color: #A0A000 } /* Name.Label */
608 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
608 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
609 .nt { color: #008000; font-weight: bold } /* Name.Tag */
609 .nt { color: #008000; font-weight: bold } /* Name.Tag */
610 .nv { color: #19177C } /* Name.Variable */
610 .nv { color: #19177C } /* Name.Variable */
611 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
611 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
612 .w { color: #bbbbbb } /* Text.Whitespace */
612 .w { color: #bbbbbb } /* Text.Whitespace */
613 .mf { color: #666666 } /* Literal.Number.Float */
613 .mf { color: #666666 } /* Literal.Number.Float */
614 .mh { color: #666666 } /* Literal.Number.Hex */
614 .mh { color: #666666 } /* Literal.Number.Hex */
615 .mi { color: #666666 } /* Literal.Number.Integer */
615 .mi { color: #666666 } /* Literal.Number.Integer */
616 .mo { color: #666666 } /* Literal.Number.Oct */
616 .mo { color: #666666 } /* Literal.Number.Oct */
617 .sb { color: #BA2121 } /* Literal.String.Backtick */
617 .sb { color: #BA2121 } /* Literal.String.Backtick */
618 .sc { color: #BA2121 } /* Literal.String.Char */
618 .sc { color: #BA2121 } /* Literal.String.Char */
619 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
619 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
620 .s2 { color: #BA2121 } /* Literal.String.Double */
620 .s2 { color: #BA2121 } /* Literal.String.Double */
621 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
621 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
622 .sh { color: #BA2121 } /* Literal.String.Heredoc */
622 .sh { color: #BA2121 } /* Literal.String.Heredoc */
623 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
623 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
624 .sx { color: #008000 } /* Literal.String.Other */
624 .sx { color: #008000 } /* Literal.String.Other */
625 .sr { color: #BB6688 } /* Literal.String.Regex */
625 .sr { color: #BB6688 } /* Literal.String.Regex */
626 .s1 { color: #BA2121 } /* Literal.String.Single */
626 .s1 { color: #BA2121 } /* Literal.String.Single */
627 .ss { color: #19177C } /* Literal.String.Symbol */
627 .ss { color: #19177C } /* Literal.String.Symbol */
628 .bp { color: #008000 } /* Name.Builtin.Pseudo */
628 .bp { color: #008000 } /* Name.Builtin.Pseudo */
629 .vc { color: #19177C } /* Name.Variable.Class */
629 .vc { color: #19177C } /* Name.Variable.Class */
630 .vg { color: #19177C } /* Name.Variable.Global */
630 .vg { color: #19177C } /* Name.Variable.Global */
631 .vi { color: #19177C } /* Name.Variable.Instance */
631 .vi { color: #19177C } /* Name.Variable.Instance */
632 .il { color: #666666 } /* Literal.Number.Integer.Long */
632 .il { color: #666666 } /* Literal.Number.Integer.Long */
633 }
633 }
634
634
635 /* customized pre blocks for markdown/rst */
635 /* customized pre blocks for markdown/rst */
636 pre.literal-block, .codehilite pre{
636 pre.literal-block, .codehilite pre{
637 padding: @padding;
637 padding: @padding;
638 border: 1px solid @grey6;
638 border: 1px solid @grey6;
639 .border-radius(@border-radius);
639 .border-radius(@border-radius);
640 background-color: @grey7;
640 background-color: @grey7;
641 }
641 }
642
642
643
643
644 /* START NEW CODE BLOCK CSS */
644 /* START NEW CODE BLOCK CSS */
645
645
646 @cb-line-height: 18px;
646 @cb-line-height: 18px;
647 @cb-line-code-padding: 10px;
647 @cb-line-code-padding: 10px;
648 @cb-text-padding: 5px;
648 @cb-text-padding: 5px;
649
649
650 @pill-padding: 2px 7px;
650 @pill-padding: 2px 7px;
651 @pill-padding-small: 2px 2px 1px 2px;
651
652
652 input.filediff-collapse-state {
653 input.filediff-collapse-state {
653 display: none;
654 display: none;
654
655
655 &:checked + .filediff { /* file diff is collapsed */
656 &:checked + .filediff { /* file diff is collapsed */
656 .cb {
657 .cb {
657 display: none
658 display: none
658 }
659 }
659 .filediff-collapse-indicator {
660 .filediff-collapse-indicator {
660 width: 0;
661 width: 0;
661 height: 0;
662 height: 0;
662 border-style: solid;
663 border-style: solid;
663 border-width: 4.5px 0 4.5px 9.3px;
664 border-width: 4.5px 0 4.5px 9.3px;
664 border-color: transparent transparent transparent #aaa;
665 border-color: transparent transparent transparent #aaa;
665 margin: 6px 0px;
666 margin: 6px 0px;
666 }
667 }
667 .filediff-menu {
668 .filediff-menu {
668 display: none;
669 display: none;
669 }
670 }
670 margin: 10px 0 0 0;
671 margin: 10px 0 0 0;
671 }
672 }
672
673
673 &+ .filediff { /* file diff is expanded */
674 &+ .filediff { /* file diff is expanded */
674 .filediff-collapse-indicator {
675 .filediff-collapse-indicator {
675 width: 0;
676 width: 0;
676 height: 0;
677 height: 0;
677 border-style: solid;
678 border-style: solid;
678 border-width: 9.3px 4.5px 0 4.5px;
679 border-width: 9.3px 4.5px 0 4.5px;
679 border-color: #aaa transparent transparent transparent;
680 border-color: #aaa transparent transparent transparent;
680 margin: 6px 0px;
681 margin: 6px 0px;
681
682
682 }
683 }
683 .filediff-menu {
684 .filediff-menu {
684 display: block;
685 display: block;
685 }
686 }
686 margin: 10px 0;
687 margin: 10px 0;
687 &:nth-child(2) {
688 &:nth-child(2) {
688 margin: 0;
689 margin: 0;
689 }
690 }
690 }
691 }
691 }
692 }
692 .cs_files {
693 .cs_files {
693 clear: both;
694 clear: both;
694 }
695 }
695
696
696 .diffset-menu {
697 .diffset-menu {
697 margin-bottom: 20px;
698 margin-bottom: 20px;
698 }
699 }
699 .diffset {
700 .diffset {
700 margin: 20px auto;
701 margin: 20px auto;
701 .diffset-heading {
702 .diffset-heading {
702 border: 1px solid @grey5;
703 border: 1px solid @grey5;
703 margin-bottom: -1px;
704 margin-bottom: -1px;
704 // margin-top: 20px;
705 // margin-top: 20px;
705 h2 {
706 h2 {
706 margin: 0;
707 margin: 0;
707 line-height: 38px;
708 line-height: 38px;
708 padding-left: 10px;
709 padding-left: 10px;
709 }
710 }
710 .btn {
711 .btn {
711 margin: 0;
712 margin: 0;
712 }
713 }
713 background: @grey6;
714 background: @grey6;
714 display: block;
715 display: block;
715 padding: 5px;
716 padding: 5px;
716 }
717 }
717 .diffset-heading-warning {
718 .diffset-heading-warning {
718 background: @alert3-inner;
719 background: @alert3-inner;
719 border: 1px solid @alert3;
720 border: 1px solid @alert3;
720 }
721 }
721 &.diffset-comments-disabled {
722 &.diffset-comments-disabled {
722 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
723 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
723 display: none !important;
724 display: none !important;
724 }
725 }
725 }
726 }
726 }
727 }
727
728
729 .filelist {
730 .pill {
731 display: block;
732 float: left;
733 padding: @pill-padding-small;
734 }
735 }
736
728 .pill {
737 .pill {
729 display: block;
738 display: block;
730 float: left;
739 float: left;
731 padding: @pill-padding;
740 padding: @pill-padding;
732 }
741 }
742
733 .pill-group {
743 .pill-group {
734 .pill {
744 .pill {
735 opacity: .8;
745 opacity: .8;
736 &:first-child {
746 &:first-child {
737 border-radius: @border-radius 0 0 @border-radius;
747 border-radius: @border-radius 0 0 @border-radius;
738 }
748 }
739 &:last-child {
749 &:last-child {
740 border-radius: 0 @border-radius @border-radius 0;
750 border-radius: 0 @border-radius @border-radius 0;
741 }
751 }
742 &:only-child {
752 &:only-child {
743 border-radius: @border-radius;
753 border-radius: @border-radius;
744 }
754 }
745 }
755 }
746 }
756 }
747
757
748 /* Main comments*/
758 /* Main comments*/
749 #comments {
759 #comments {
750 .comment-selected {
760 .comment-selected {
751 border-left: 6px solid @comment-highlight-color;
761 border-left: 6px solid @comment-highlight-color;
752 padding-left: 3px;
762 padding-left: 3px;
753 margin-left: -9px;
763 margin-left: -9px;
754 }
764 }
755 }
765 }
756
766
757 .filediff {
767 .filediff {
758 border: 1px solid @grey5;
768 border: 1px solid @grey5;
759
769
760 /* START OVERRIDES */
770 /* START OVERRIDES */
761 .code-highlight {
771 .code-highlight {
762 border: none; // TODO: remove this border from the global
772 border: none; // TODO: remove this border from the global
763 // .code-highlight, it doesn't belong there
773 // .code-highlight, it doesn't belong there
764 }
774 }
765 label {
775 label {
766 margin: 0; // TODO: remove this margin definition from global label
776 margin: 0; // TODO: remove this margin definition from global label
767 // it doesn't belong there - if margin on labels
777 // it doesn't belong there - if margin on labels
768 // are needed for a form they should be defined
778 // are needed for a form they should be defined
769 // in the form's class
779 // in the form's class
770 }
780 }
771 /* END OVERRIDES */
781 /* END OVERRIDES */
772
782
773 * {
783 * {
774 box-sizing: border-box;
784 box-sizing: border-box;
775 }
785 }
776 .filediff-anchor {
786 .filediff-anchor {
777 visibility: hidden;
787 visibility: hidden;
778 }
788 }
779 &:hover {
789 &:hover {
780 .filediff-anchor {
790 .filediff-anchor {
781 visibility: visible;
791 visibility: visible;
782 }
792 }
783 }
793 }
784
794
785 .filediff-collapse-indicator {
795 .filediff-collapse-indicator {
786 border-style: solid;
796 border-style: solid;
787 float: left;
797 float: left;
788 margin: 4px 0px 0 0;
798 margin: 4px 0px 0 0;
789 cursor: pointer;
799 cursor: pointer;
790 }
800 }
791
801
792 .filediff-heading {
802 .filediff-heading {
793 background: @grey7;
803 background: @grey7;
794 cursor: pointer;
804 cursor: pointer;
795 display: block;
805 display: block;
796 padding: 5px 10px;
806 padding: 5px 10px;
797 }
807 }
798 .filediff-heading:after {
808 .filediff-heading:after {
799 content: "";
809 content: "";
800 display: table;
810 display: table;
801 clear: both;
811 clear: both;
802 }
812 }
803 .filediff-heading:hover {
813 .filediff-heading:hover {
804 background: #e1e9f4 !important;
814 background: #e1e9f4 !important;
805 }
815 }
806
816
807 .filediff-menu {
817 .filediff-menu {
808 float: right;
818 float: right;
809 text-align: right;
819 text-align: right;
810 padding: 5px 5px 5px 0px;
820 padding: 5px 5px 5px 0px;
811
821
812 &> a,
822 &> a,
813 &> span {
823 &> span {
814 padding: 1px;
824 padding: 1px;
815 }
825 }
816 }
826 }
817
827
828 .filediff-collapse-button, .filediff-expand-button {
829 cursor: pointer;
830 }
831 .filediff-collapse-button {
832 display: inline;
833 }
834 .filediff-expand-button {
835 display: none;
836 }
837 .filediff-collapsed .filediff-collapse-button {
838 display: none;
839 }
840 .filediff-collapsed .filediff-expand-button {
841 display: inline;
842 }
843
844 /**** COMMENTS ****/
845
846 .filediff-menu {
847 .show-comment-button {
848 display: none;
849 }
850 }
851 &.hide-comments {
852 .inline-comments {
853 display: none;
854 }
855 .filediff-menu {
856 .show-comment-button {
857 display: inline;
858 }
859 .hide-comment-button {
860 display: none;
861 }
862 }
863 }
864
865 .hide-line-comments {
866 .inline-comments {
867 display: none;
868 }
869 }
870
871 /**** END COMMENTS ****/
872
873 }
874
875
876
877 .filediff, .filelist {
818 .pill {
878 .pill {
819 &[op="name"] {
879 &[op="name"] {
820 background: none;
880 background: none;
821 opacity: 1;
881 opacity: 1;
822 color: white;
882 color: white;
823 }
883 }
824 &[op="limited"] {
884 &[op="limited"] {
825 background: @grey2;
885 background: @grey2;
826 color: white;
886 color: white;
827 }
887 }
828 &[op="binary"] {
888 &[op="binary"] {
829 background: @color7;
889 background: @color7;
830 color: white;
890 color: white;
831 }
891 }
832 &[op="modified"] {
892 &[op="modified"] {
833 background: @alert1;
893 background: @alert1;
834 color: white;
894 color: white;
835 }
895 }
836 &[op="renamed"] {
896 &[op="renamed"] {
837 background: @color4;
897 background: @color4;
838 color: white;
898 color: white;
839 }
899 }
840 &[op="copied"] {
900 &[op="copied"] {
841 background: @color4;
901 background: @color4;
842 color: white;
902 color: white;
843 }
903 }
844 &[op="mode"] {
904 &[op="mode"] {
845 background: @grey3;
905 background: @grey3;
846 color: white;
906 color: white;
847 }
907 }
848 &[op="symlink"] {
908 &[op="symlink"] {
849 background: @color8;
909 background: @color8;
850 color: white;
910 color: white;
851 }
911 }
852
912
853 &[op="added"] { /* added lines */
913 &[op="added"] { /* added lines */
854 background: @alert1;
914 background: @alert1;
855 color: white;
915 color: white;
856 }
916 }
857 &[op="deleted"] { /* deleted lines */
917 &[op="deleted"] { /* deleted lines */
858 background: @alert2;
918 background: @alert2;
859 color: white;
919 color: white;
860 }
920 }
861
921
862 &[op="created"] { /* created file */
922 &[op="created"] { /* created file */
863 background: @alert1;
923 background: @alert1;
864 color: white;
924 color: white;
865 }
925 }
866 &[op="removed"] { /* deleted file */
926 &[op="removed"] { /* deleted file */
867 background: @color5;
927 background: @color5;
868 color: white;
928 color: white;
869 }
929 }
870 }
930 }
871
872 .filediff-collapse-button, .filediff-expand-button {
873 cursor: pointer;
874 }
875 .filediff-collapse-button {
876 display: inline;
877 }
878 .filediff-expand-button {
879 display: none;
880 }
881 .filediff-collapsed .filediff-collapse-button {
882 display: none;
883 }
884 .filediff-collapsed .filediff-expand-button {
885 display: inline;
886 }
931 }
887
932
888 /**** COMMENTS ****/
889
890 .filediff-menu {
891 .show-comment-button {
892 display: none;
893 }
894 }
895 &.hide-comments {
896 .inline-comments {
897 display: none;
898 }
899 .filediff-menu {
900 .show-comment-button {
901 display: inline;
902 }
903 .hide-comment-button {
904 display: none;
905 }
906 }
907 }
908
909 .hide-line-comments {
910 .inline-comments {
911 display: none;
912 }
913 }
914
915 /**** END COMMENTS ****/
916
917 }
918
933
919 .filediff-outdated {
934 .filediff-outdated {
920 padding: 8px 0;
935 padding: 8px 0;
921
936
922 .filediff-heading {
937 .filediff-heading {
923 opacity: .5;
938 opacity: .5;
924 }
939 }
925 }
940 }
926
941
927 table.cb {
942 table.cb {
928 width: 100%;
943 width: 100%;
929 border-collapse: collapse;
944 border-collapse: collapse;
930
945
931 .cb-text {
946 .cb-text {
932 padding: @cb-text-padding;
947 padding: @cb-text-padding;
933 }
948 }
934 .cb-hunk {
949 .cb-hunk {
935 padding: @cb-text-padding;
950 padding: @cb-text-padding;
936 }
951 }
937 .cb-expand {
952 .cb-expand {
938 display: none;
953 display: none;
939 }
954 }
940 .cb-collapse {
955 .cb-collapse {
941 display: inline;
956 display: inline;
942 }
957 }
943 &.cb-collapsed {
958 &.cb-collapsed {
944 .cb-line {
959 .cb-line {
945 display: none;
960 display: none;
946 }
961 }
947 .cb-expand {
962 .cb-expand {
948 display: inline;
963 display: inline;
949 }
964 }
950 .cb-collapse {
965 .cb-collapse {
951 display: none;
966 display: none;
952 }
967 }
953 }
968 }
954
969
955 /* intentionally general selector since .cb-line-selected must override it
970 /* intentionally general selector since .cb-line-selected must override it
956 and they both use !important since the td itself may have a random color
971 and they both use !important since the td itself may have a random color
957 generated by annotation blocks. TLDR: if you change it, make sure
972 generated by annotation blocks. TLDR: if you change it, make sure
958 annotated block selection and line selection in file view still work */
973 annotated block selection and line selection in file view still work */
959 .cb-line-fresh .cb-content {
974 .cb-line-fresh .cb-content {
960 background: white !important;
975 background: white !important;
961 }
976 }
962 .cb-warning {
977 .cb-warning {
963 background: #fff4dd;
978 background: #fff4dd;
964 }
979 }
965
980
966 &.cb-diff-sideside {
981 &.cb-diff-sideside {
967 td {
982 td {
968 &.cb-content {
983 &.cb-content {
969 width: 50%;
984 width: 50%;
970 }
985 }
971 }
986 }
972 }
987 }
973
988
974 tr {
989 tr {
975 &.cb-annotate {
990 &.cb-annotate {
976 border-top: 1px solid #eee;
991 border-top: 1px solid #eee;
977 }
992 }
978
993
979 &.cb-comment-info {
994 &.cb-comment-info {
980 border-top: 1px solid #eee;
995 border-top: 1px solid #eee;
981 color: rgba(0, 0, 0, 0.3);
996 color: rgba(0, 0, 0, 0.3);
982 background: #edf2f9;
997 background: #edf2f9;
983
998
984 td {
999 td {
985
1000
986 }
1001 }
987 }
1002 }
988
1003
989 &.cb-hunk {
1004 &.cb-hunk {
990 font-family: @font-family-monospace;
1005 font-family: @font-family-monospace;
991 color: rgba(0, 0, 0, 0.3);
1006 color: rgba(0, 0, 0, 0.3);
992
1007
993 td {
1008 td {
994 &:first-child {
1009 &:first-child {
995 background: #edf2f9;
1010 background: #edf2f9;
996 }
1011 }
997 &:last-child {
1012 &:last-child {
998 background: #f4f7fb;
1013 background: #f4f7fb;
999 }
1014 }
1000 }
1015 }
1001 }
1016 }
1002 }
1017 }
1003
1018
1004
1019
1005 td {
1020 td {
1006 vertical-align: top;
1021 vertical-align: top;
1007 padding: 0;
1022 padding: 0;
1008
1023
1009 &.cb-content {
1024 &.cb-content {
1010 font-size: 12.35px;
1025 font-size: 12.35px;
1011
1026
1012 &.cb-line-selected .cb-code {
1027 &.cb-line-selected .cb-code {
1013 background: @comment-highlight-color !important;
1028 background: @comment-highlight-color !important;
1014 }
1029 }
1015
1030
1016 span.cb-code {
1031 span.cb-code {
1017 line-height: @cb-line-height;
1032 line-height: @cb-line-height;
1018 padding-left: @cb-line-code-padding;
1033 padding-left: @cb-line-code-padding;
1019 padding-right: @cb-line-code-padding;
1034 padding-right: @cb-line-code-padding;
1020 display: block;
1035 display: block;
1021 white-space: pre-wrap;
1036 white-space: pre-wrap;
1022 font-family: @font-family-monospace;
1037 font-family: @font-family-monospace;
1023 word-break: break-all;
1038 word-break: break-all;
1024 .nonl {
1039 .nonl {
1025 color: @color5;
1040 color: @color5;
1026 }
1041 }
1027 }
1042 }
1028
1043
1029 &> button.cb-comment-box-opener {
1044 &> button.cb-comment-box-opener {
1030
1045
1031 padding: 2px 2px 1px 3px;
1046 padding: 2px 2px 1px 3px;
1032 margin-left: -6px;
1047 margin-left: -6px;
1033 margin-top: -1px;
1048 margin-top: -1px;
1034
1049
1035 border-radius: @border-radius;
1050 border-radius: @border-radius;
1036 position: absolute;
1051 position: absolute;
1037 display: none;
1052 display: none;
1038 }
1053 }
1039 .cb-comment {
1054 .cb-comment {
1040 margin-top: 10px;
1055 margin-top: 10px;
1041 white-space: normal;
1056 white-space: normal;
1042 }
1057 }
1043 }
1058 }
1044 &:hover {
1059 &:hover {
1045 button.cb-comment-box-opener {
1060 button.cb-comment-box-opener {
1046 display: block;
1061 display: block;
1047 }
1062 }
1048 &+ td button.cb-comment-box-opener {
1063 &+ td button.cb-comment-box-opener {
1049 display: block
1064 display: block
1050 }
1065 }
1051 }
1066 }
1052
1067
1053 &.cb-data {
1068 &.cb-data {
1054 text-align: right;
1069 text-align: right;
1055 width: 30px;
1070 width: 30px;
1056 font-family: @font-family-monospace;
1071 font-family: @font-family-monospace;
1057
1072
1058 .icon-comment {
1073 .icon-comment {
1059 cursor: pointer;
1074 cursor: pointer;
1060 }
1075 }
1061 &.cb-line-selected > div {
1076 &.cb-line-selected > div {
1062 display: block;
1077 display: block;
1063 background: @comment-highlight-color !important;
1078 background: @comment-highlight-color !important;
1064 line-height: @cb-line-height;
1079 line-height: @cb-line-height;
1065 color: rgba(0, 0, 0, 0.3);
1080 color: rgba(0, 0, 0, 0.3);
1066 }
1081 }
1067 }
1082 }
1068
1083
1069 &.cb-lineno {
1084 &.cb-lineno {
1070 padding: 0;
1085 padding: 0;
1071 width: 50px;
1086 width: 50px;
1072 color: rgba(0, 0, 0, 0.3);
1087 color: rgba(0, 0, 0, 0.3);
1073 text-align: right;
1088 text-align: right;
1074 border-right: 1px solid #eee;
1089 border-right: 1px solid #eee;
1075 font-family: @font-family-monospace;
1090 font-family: @font-family-monospace;
1076 user-select: none;
1091 user-select: none;
1077
1092
1078 a::before {
1093 a::before {
1079 content: attr(data-line-no);
1094 content: attr(data-line-no);
1080 }
1095 }
1081 &.cb-line-selected a {
1096 &.cb-line-selected a {
1082 background: @comment-highlight-color !important;
1097 background: @comment-highlight-color !important;
1083 }
1098 }
1084
1099
1085 a {
1100 a {
1086 display: block;
1101 display: block;
1087 padding-right: @cb-line-code-padding;
1102 padding-right: @cb-line-code-padding;
1088 padding-left: @cb-line-code-padding;
1103 padding-left: @cb-line-code-padding;
1089 line-height: @cb-line-height;
1104 line-height: @cb-line-height;
1090 color: rgba(0, 0, 0, 0.3);
1105 color: rgba(0, 0, 0, 0.3);
1091 }
1106 }
1092 }
1107 }
1093
1108
1094 &.cb-empty {
1109 &.cb-empty {
1095 background: @grey7;
1110 background: @grey7;
1096 }
1111 }
1097
1112
1098 ins {
1113 ins {
1099 color: black;
1114 color: black;
1100 background: #a6f3a6;
1115 background: #a6f3a6;
1101 text-decoration: none;
1116 text-decoration: none;
1102 }
1117 }
1103 del {
1118 del {
1104 color: black;
1119 color: black;
1105 background: #f8cbcb;
1120 background: #f8cbcb;
1106 text-decoration: none;
1121 text-decoration: none;
1107 }
1122 }
1108 &.cb-addition {
1123 &.cb-addition {
1109 background: #ecffec;
1124 background: #ecffec;
1110
1125
1111 &.blob-lineno {
1126 &.blob-lineno {
1112 background: #ddffdd;
1127 background: #ddffdd;
1113 }
1128 }
1114 }
1129 }
1115 &.cb-deletion {
1130 &.cb-deletion {
1116 background: #ffecec;
1131 background: #ffecec;
1117
1132
1118 &.blob-lineno {
1133 &.blob-lineno {
1119 background: #ffdddd;
1134 background: #ffdddd;
1120 }
1135 }
1121 }
1136 }
1122 &.cb-annotate-message-spacer {
1137 &.cb-annotate-message-spacer {
1123 width:8px;
1138 width:8px;
1124 padding: 1px 0px 0px 3px;
1139 padding: 1px 0px 0px 3px;
1125 }
1140 }
1126 &.cb-annotate-info {
1141 &.cb-annotate-info {
1127 width: 320px;
1142 width: 320px;
1128 min-width: 320px;
1143 min-width: 320px;
1129 max-width: 320px;
1144 max-width: 320px;
1130 padding: 5px 2px;
1145 padding: 5px 2px;
1131 font-size: 13px;
1146 font-size: 13px;
1132
1147
1133 .cb-annotate-message {
1148 .cb-annotate-message {
1134 padding: 2px 0px 0px 0px;
1149 padding: 2px 0px 0px 0px;
1135 white-space: pre-line;
1150 white-space: pre-line;
1136 overflow: hidden;
1151 overflow: hidden;
1137 }
1152 }
1138 .rc-user {
1153 .rc-user {
1139 float: none;
1154 float: none;
1140 padding: 0 6px 0 17px;
1155 padding: 0 6px 0 17px;
1141 min-width: unset;
1156 min-width: unset;
1142 min-height: unset;
1157 min-height: unset;
1143 }
1158 }
1144 }
1159 }
1145
1160
1146 &.cb-annotate-revision {
1161 &.cb-annotate-revision {
1147 cursor: pointer;
1162 cursor: pointer;
1148 text-align: right;
1163 text-align: right;
1149 padding: 1px 3px 0px 3px;
1164 padding: 1px 3px 0px 3px;
1150 }
1165 }
1151 }
1166 }
1152 }
1167 }
@@ -1,354 +1,354 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 <%inherit file="/base/base.mako"/>
3 <%inherit file="/base/base.mako"/>
4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
5
5
6 <%def name="title()">
6 <%def name="title()">
7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
8 %if c.rhodecode_name:
8 %if c.rhodecode_name:
9 &middot; ${h.branding(c.rhodecode_name)}
9 &middot; ${h.branding(c.rhodecode_name)}
10 %endif
10 %endif
11 </%def>
11 </%def>
12
12
13 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='repositories')}
14 ${self.menu_items(active='repositories')}
15 </%def>
15 </%def>
16
16
17 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='changelog')}
18 ${self.repo_menu(active='changelog')}
19 </%def>
19 </%def>
20
20
21 <%def name="main()">
21 <%def name="main()">
22 <script>
22 <script>
23 // TODO: marcink switch this to pyroutes
23 // TODO: marcink switch this to pyroutes
24 AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}";
24 AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}";
25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 </script>
26 </script>
27 <div class="box">
27 <div class="box">
28 <div class="title">
28 <div class="title">
29 ${self.repo_page_title(c.rhodecode_db_repo)}
29 ${self.repo_page_title(c.rhodecode_db_repo)}
30 </div>
30 </div>
31
31
32 <div id="changeset_compare_view_content" class="summary changeset">
32 <div id="changeset_compare_view_content" class="summary changeset">
33 <div class="summary-detail">
33 <div class="summary-detail">
34 <div class="summary-detail-header">
34 <div class="summary-detail-header">
35 <div class="breadcrumbs files_location">
35 <div class="breadcrumbs files_location">
36 <h4>
36 <h4>
37 ${_('Commit')}
37 ${_('Commit')}
38
38
39 <code>
39 <code>
40 ${h.show_id(c.commit)}
40 ${h.show_id(c.commit)}
41 </code>
41 </code>
42 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
42 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
43 % if hasattr(c.commit, 'phase'):
43 % if hasattr(c.commit, 'phase'):
44 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
44 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
45 % endif
45 % endif
46
46
47 ## obsolete commits
47 ## obsolete commits
48 % if hasattr(c.commit, 'obsolete'):
48 % if hasattr(c.commit, 'obsolete'):
49 % if c.commit.obsolete:
49 % if c.commit.obsolete:
50 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
50 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
51 % endif
51 % endif
52 % endif
52 % endif
53
53
54 ## hidden commits
54 ## hidden commits
55 % if hasattr(c.commit, 'hidden'):
55 % if hasattr(c.commit, 'hidden'):
56 % if c.commit.hidden:
56 % if c.commit.hidden:
57 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
57 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
58 % endif
58 % endif
59 % endif
59 % endif
60 </h4>
60 </h4>
61
61
62 </div>
62 </div>
63 <div class="pull-right">
63 <div class="pull-right">
64 <span id="parent_link">
64 <span id="parent_link">
65 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
65 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
66 </span>
66 </span>
67 |
67 |
68 <span id="child_link">
68 <span id="child_link">
69 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
69 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
70 </span>
70 </span>
71 </div>
71 </div>
72 </div>
72 </div>
73
73
74 <div class="fieldset">
74 <div class="fieldset">
75 <div class="left-label">
75 <div class="left-label">
76 ${_('Description')}:
76 ${_('Description')}:
77 </div>
77 </div>
78 <div class="right-content">
78 <div class="right-content">
79 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
79 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
80 <div id="message_expand" style="display:none;">
80 <div id="message_expand" style="display:none;">
81 ${_('Expand')}
81 ${_('Expand')}
82 </div>
82 </div>
83 </div>
83 </div>
84 </div>
84 </div>
85
85
86 %if c.statuses:
86 %if c.statuses:
87 <div class="fieldset">
87 <div class="fieldset">
88 <div class="left-label">
88 <div class="left-label">
89 ${_('Commit status')}:
89 ${_('Commit status')}:
90 </div>
90 </div>
91 <div class="right-content">
91 <div class="right-content">
92 <div class="changeset-status-ico">
92 <div class="changeset-status-ico">
93 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
93 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
94 </div>
94 </div>
95 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
95 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
96 </div>
96 </div>
97 </div>
97 </div>
98 %endif
98 %endif
99
99
100 <div class="fieldset">
100 <div class="fieldset">
101 <div class="left-label">
101 <div class="left-label">
102 ${_('References')}:
102 ${_('References')}:
103 </div>
103 </div>
104 <div class="right-content">
104 <div class="right-content">
105 <div class="tags">
105 <div class="tags">
106
106
107 %if c.commit.merge:
107 %if c.commit.merge:
108 <span class="mergetag tag">
108 <span class="mergetag tag">
109 <i class="icon-merge"></i>${_('merge')}
109 <i class="icon-merge"></i>${_('merge')}
110 </span>
110 </span>
111 %endif
111 %endif
112
112
113 %if h.is_hg(c.rhodecode_repo):
113 %if h.is_hg(c.rhodecode_repo):
114 %for book in c.commit.bookmarks:
114 %for book in c.commit.bookmarks:
115 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
115 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
116 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
116 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
117 </span>
117 </span>
118 %endfor
118 %endfor
119 %endif
119 %endif
120
120
121 %for tag in c.commit.tags:
121 %for tag in c.commit.tags:
122 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
122 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
123 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
123 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
124 </span>
124 </span>
125 %endfor
125 %endfor
126
126
127 %if c.commit.branch:
127 %if c.commit.branch:
128 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}">
128 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}">
129 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
129 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
130 </span>
130 </span>
131 %endif
131 %endif
132 </div>
132 </div>
133 </div>
133 </div>
134 </div>
134 </div>
135
135
136 <div class="fieldset">
136 <div class="fieldset">
137 <div class="left-label">
137 <div class="left-label">
138 ${_('Diff options')}:
138 ${_('Diff options')}:
139 </div>
139 </div>
140 <div class="right-content">
140 <div class="right-content">
141 <div class="diff-actions">
141 <div class="diff-actions">
142 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
142 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
143 ${_('Raw Diff')}
143 ${_('Raw Diff')}
144 </a>
144 </a>
145 |
145 |
146 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
146 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
147 ${_('Patch Diff')}
147 ${_('Patch Diff')}
148 </a>
148 </a>
149 |
149 |
150 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
150 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
151 ${_('Download Diff')}
151 ${_('Download Diff')}
152 </a>
152 </a>
153 |
153 |
154 ${c.ignorews_url(request)}
154 ${c.ignorews_url(request)}
155 |
155 |
156 ${c.context_url(request)}
156 ${c.context_url(request)}
157 </div>
157 </div>
158 </div>
158 </div>
159 </div>
159 </div>
160
160
161 <div class="fieldset">
161 <div class="fieldset">
162 <div class="left-label">
162 <div class="left-label">
163 ${_('Comments')}:
163 ${_('Comments')}:
164 </div>
164 </div>
165 <div class="right-content">
165 <div class="right-content">
166 <div class="comments-number">
166 <div class="comments-number">
167 %if c.comments:
167 %if c.comments:
168 <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
168 <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
169 %else:
169 %else:
170 ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
170 ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
171 %endif
171 %endif
172 %if c.inline_cnt:
172 %if c.inline_cnt:
173 <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
173 <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
174 %else:
174 %else:
175 ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
175 ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
176 %endif
176 %endif
177 </div>
177 </div>
178 </div>
178 </div>
179 </div>
179 </div>
180
180
181 <div class="fieldset">
181 <div class="fieldset">
182 <div class="left-label">
182 <div class="left-label">
183 ${_('Unresolved TODOs')}:
183 ${_('Unresolved TODOs')}:
184 </div>
184 </div>
185 <div class="right-content">
185 <div class="right-content">
186 <div class="comments-number">
186 <div class="comments-number">
187 % if c.unresolved_comments:
187 % if c.unresolved_comments:
188 % for co in c.unresolved_comments:
188 % for co in c.unresolved_comments:
189 <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','}
189 <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','}
190 % endfor
190 % endfor
191 % else:
191 % else:
192 ${_('There are no unresolved TODOs')}
192 ${_('There are no unresolved TODOs')}
193 % endif
193 % endif
194 </div>
194 </div>
195 </div>
195 </div>
196 </div>
196 </div>
197
197
198 </div> <!-- end summary-detail -->
198 </div> <!-- end summary-detail -->
199
199
200 <div id="commit-stats" class="sidebar-right">
200 <div id="commit-stats" class="sidebar-right">
201 <div class="summary-detail-header">
201 <div class="summary-detail-header">
202 <h4 class="item">
202 <h4 class="item">
203 ${_('Author')}
203 ${_('Author')}
204 </h4>
204 </h4>
205 </div>
205 </div>
206 <div class="sidebar-right-content">
206 <div class="sidebar-right-content">
207 ${self.gravatar_with_user(c.commit.author)}
207 ${self.gravatar_with_user(c.commit.author)}
208 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
208 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
209 </div>
209 </div>
210 </div><!-- end sidebar -->
210 </div><!-- end sidebar -->
211 </div> <!-- end summary -->
211 </div> <!-- end summary -->
212 <div class="cs_files">
212 <div class="cs_files">
213 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
213 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
214 ${cbdiffs.render_diffset_menu()}
214 ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])}
215 ${cbdiffs.render_diffset(
215 ${cbdiffs.render_diffset(
216 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )}
216 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )}
217 </div>
217 </div>
218
218
219 ## template for inline comment form
219 ## template for inline comment form
220 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
220 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
221
221
222 ## render comments
222 ## render comments
223 ${comment.generate_comments(c.comments)}
223 ${comment.generate_comments(c.comments)}
224
224
225 ## main comment form and it status
225 ## main comment form and it status
226 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
226 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
227 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
227 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
228 </div>
228 </div>
229
229
230 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
230 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
231 <script type="text/javascript">
231 <script type="text/javascript">
232
232
233 $(document).ready(function() {
233 $(document).ready(function() {
234
234
235 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
235 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
236 if($('#trimmed_message_box').height() === boxmax){
236 if($('#trimmed_message_box').height() === boxmax){
237 $('#message_expand').show();
237 $('#message_expand').show();
238 }
238 }
239
239
240 $('#message_expand').on('click', function(e){
240 $('#message_expand').on('click', function(e){
241 $('#trimmed_message_box').css('max-height', 'none');
241 $('#trimmed_message_box').css('max-height', 'none');
242 $(this).hide();
242 $(this).hide();
243 });
243 });
244
244
245 $('.show-inline-comments').on('click', function(e){
245 $('.show-inline-comments').on('click', function(e){
246 var boxid = $(this).attr('data-comment-id');
246 var boxid = $(this).attr('data-comment-id');
247 var button = $(this);
247 var button = $(this);
248
248
249 if(button.hasClass("comments-visible")) {
249 if(button.hasClass("comments-visible")) {
250 $('#{0} .inline-comments'.format(boxid)).each(function(index){
250 $('#{0} .inline-comments'.format(boxid)).each(function(index){
251 $(this).hide();
251 $(this).hide();
252 });
252 });
253 button.removeClass("comments-visible");
253 button.removeClass("comments-visible");
254 } else {
254 } else {
255 $('#{0} .inline-comments'.format(boxid)).each(function(index){
255 $('#{0} .inline-comments'.format(boxid)).each(function(index){
256 $(this).show();
256 $(this).show();
257 });
257 });
258 button.addClass("comments-visible");
258 button.addClass("comments-visible");
259 }
259 }
260 });
260 });
261
261
262
262
263 // next links
263 // next links
264 $('#child_link').on('click', function(e){
264 $('#child_link').on('click', function(e){
265 // fetch via ajax what is going to be the next link, if we have
265 // fetch via ajax what is going to be the next link, if we have
266 // >1 links show them to user to choose
266 // >1 links show them to user to choose
267 if(!$('#child_link').hasClass('disabled')){
267 if(!$('#child_link').hasClass('disabled')){
268 $.ajax({
268 $.ajax({
269 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
269 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
270 success: function(data) {
270 success: function(data) {
271 if(data.results.length === 0){
271 if(data.results.length === 0){
272 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
272 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
273 }
273 }
274 if(data.results.length === 1){
274 if(data.results.length === 1){
275 var commit = data.results[0];
275 var commit = data.results[0];
276 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
276 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
277 }
277 }
278 else if(data.results.length === 2){
278 else if(data.results.length === 2){
279 $('#child_link').addClass('disabled');
279 $('#child_link').addClass('disabled');
280 $('#child_link').addClass('double');
280 $('#child_link').addClass('double');
281 var _html = '';
281 var _html = '';
282 _html +='<a title="__title__" href="__url__">__rev__</a> '
282 _html +='<a title="__title__" href="__url__">__rev__</a> '
283 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
283 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
284 .replace('__title__', data.results[0].message)
284 .replace('__title__', data.results[0].message)
285 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
285 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
286 _html +=' | ';
286 _html +=' | ';
287 _html +='<a title="__title__" href="__url__">__rev__</a> '
287 _html +='<a title="__title__" href="__url__">__rev__</a> '
288 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
288 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
289 .replace('__title__', data.results[1].message)
289 .replace('__title__', data.results[1].message)
290 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
290 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
291 $('#child_link').html(_html);
291 $('#child_link').html(_html);
292 }
292 }
293 }
293 }
294 });
294 });
295 e.preventDefault();
295 e.preventDefault();
296 }
296 }
297 });
297 });
298
298
299 // prev links
299 // prev links
300 $('#parent_link').on('click', function(e){
300 $('#parent_link').on('click', function(e){
301 // fetch via ajax what is going to be the next link, if we have
301 // fetch via ajax what is going to be the next link, if we have
302 // >1 links show them to user to choose
302 // >1 links show them to user to choose
303 if(!$('#parent_link').hasClass('disabled')){
303 if(!$('#parent_link').hasClass('disabled')){
304 $.ajax({
304 $.ajax({
305 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
305 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
306 success: function(data) {
306 success: function(data) {
307 if(data.results.length === 0){
307 if(data.results.length === 0){
308 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
308 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
309 }
309 }
310 if(data.results.length === 1){
310 if(data.results.length === 1){
311 var commit = data.results[0];
311 var commit = data.results[0];
312 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
312 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
313 }
313 }
314 else if(data.results.length === 2){
314 else if(data.results.length === 2){
315 $('#parent_link').addClass('disabled');
315 $('#parent_link').addClass('disabled');
316 $('#parent_link').addClass('double');
316 $('#parent_link').addClass('double');
317 var _html = '';
317 var _html = '';
318 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
318 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
319 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
319 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
320 .replace('__title__', data.results[0].message)
320 .replace('__title__', data.results[0].message)
321 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
321 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
322 _html +=' | ';
322 _html +=' | ';
323 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
323 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
324 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
324 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
325 .replace('__title__', data.results[1].message)
325 .replace('__title__', data.results[1].message)
326 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
326 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
327 $('#parent_link').html(_html);
327 $('#parent_link').html(_html);
328 }
328 }
329 }
329 }
330 });
330 });
331 e.preventDefault();
331 e.preventDefault();
332 }
332 }
333 });
333 });
334
334
335 if (location.hash) {
335 if (location.hash) {
336 var result = splitDelimitedHash(location.hash);
336 var result = splitDelimitedHash(location.hash);
337 var line = $('html').find(result.loc);
337 var line = $('html').find(result.loc);
338 if (line.length > 0){
338 if (line.length > 0){
339 offsetScroll(line, 70);
339 offsetScroll(line, 70);
340 }
340 }
341 }
341 }
342
342
343 // browse tree @ revision
343 // browse tree @ revision
344 $('#files_link').on('click', function(e){
344 $('#files_link').on('click', function(e){
345 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
345 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
346 e.preventDefault();
346 e.preventDefault();
347 });
347 });
348
348
349 // inject comments into their proper positions
349 // inject comments into their proper positions
350 var file_comments = $('.inline-comment-placeholder');
350 var file_comments = $('.inline-comment-placeholder');
351 })
351 })
352 </script>
352 </script>
353
353
354 </%def>
354 </%def>
@@ -1,131 +1,131 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('%s Commits') % c.repo_name} -
5 ${_('%s Commits') % c.repo_name} -
6 r${c.commit_ranges[0].revision}:${h.short_id(c.commit_ranges[0].raw_id)}
6 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
7 ...
7 ...
8 r${c.commit_ranges[-1].revision}:${h.short_id(c.commit_ranges[-1].raw_id)}
8 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
9 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
9 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
10 %if c.rhodecode_name:
10 %if c.rhodecode_name:
11 &middot; ${h.branding(c.rhodecode_name)}
11 &middot; ${h.branding(c.rhodecode_name)}
12 %endif
12 %endif
13 </%def>
13 </%def>
14
14
15 <%def name="breadcrumbs_links()">
15 <%def name="breadcrumbs_links()">
16 ${_('Commits')} -
16 ${_('Commits')} -
17 r${c.commit_ranges[0].revision}:${h.short_id(c.commit_ranges[0].raw_id)}
17 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}
18 ...
18 ...
19 r${c.commit_ranges[-1].revision}:${h.short_id(c.commit_ranges[-1].raw_id)}
19 r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
20 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
20 ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)}
21 </%def>
21 </%def>
22
22
23 <%def name="menu_bar_nav()">
23 <%def name="menu_bar_nav()">
24 ${self.menu_items(active='repositories')}
24 ${self.menu_items(active='repositories')}
25 </%def>
25 </%def>
26
26
27 <%def name="menu_bar_subnav()">
27 <%def name="menu_bar_subnav()">
28 ${self.repo_menu(active='changelog')}
28 ${self.repo_menu(active='changelog')}
29 </%def>
29 </%def>
30
30
31 <%def name="main()">
31 <%def name="main()">
32 <div class="summary-header">
32 <div class="summary-header">
33 <div class="title">
33 <div class="title">
34 ${self.repo_page_title(c.rhodecode_db_repo)}
34 ${self.repo_page_title(c.rhodecode_db_repo)}
35 </div>
35 </div>
36 </div>
36 </div>
37
37
38
38
39 <div class="summary changeset">
39 <div class="summary changeset">
40 <div class="summary-detail">
40 <div class="summary-detail">
41 <div class="summary-detail-header">
41 <div class="summary-detail-header">
42 <span class="breadcrumbs files_location">
42 <span class="breadcrumbs files_location">
43 <h4>
43 <h4>
44 ${_('Commit Range')}
44 ${_('Commit Range')}
45 <code>
45 <code>
46 r${c.commit_ranges[0].revision}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].revision}:${h.short_id(c.commit_ranges[-1].raw_id)}
46 r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)}
47 </code>
47 </code>
48 </h4>
48 </h4>
49 </span>
49 </span>
50 </div>
50 </div>
51
51
52 <div class="fieldset">
52 <div class="fieldset">
53 <div class="left-label">
53 <div class="left-label">
54 ${_('Diff option')}:
54 ${_('Diff option')}:
55 </div>
55 </div>
56 <div class="right-content">
56 <div class="right-content">
57 <div class="header-buttons">
57 <div class="btn btn-primary">
58 <a href="${h.route_path('repo_compare',
58 <a href="${h.route_path('repo_compare',
59 repo_name=c.repo_name,
59 repo_name=c.repo_name,
60 source_ref_type='rev',
60 source_ref_type='rev',
61 source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'),
61 source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'),
62 target_ref_type='rev',
62 target_ref_type='rev',
63 target_ref=c.commit_ranges[-1].raw_id)}"
63 target_ref=c.commit_ranges[-1].raw_id)}"
64 >
64 >
65 ${_('Show combined compare')}
65 ${_('Show combined compare')}
66 </a>
66 </a>
67 </div>
67 </div>
68 </div>
68 </div>
69 </div>
69 </div>
70
70
71 <%doc>
71 <%doc>
72 ##TODO(marcink): implement this and diff menus
72 ##TODO(marcink): implement this and diff menus
73 <div class="fieldset">
73 <div class="fieldset">
74 <div class="left-label">
74 <div class="left-label">
75 ${_('Diff options')}:
75 ${_('Diff options')}:
76 </div>
76 </div>
77 <div class="right-content">
77 <div class="right-content">
78 <div class="diff-actions">
78 <div class="diff-actions">
79 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
79 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
80 ${_('Raw Diff')}
80 ${_('Raw Diff')}
81 </a>
81 </a>
82 |
82 |
83 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
83 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
84 ${_('Patch Diff')}
84 ${_('Patch Diff')}
85 </a>
85 </a>
86 |
86 |
87 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
87 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
88 ${_('Download Diff')}
88 ${_('Download Diff')}
89 </a>
89 </a>
90 </div>
90 </div>
91 </div>
91 </div>
92 </div>
92 </div>
93 </%doc>
93 </%doc>
94 </div> <!-- end summary-detail -->
94 </div> <!-- end summary-detail -->
95
95
96 </div> <!-- end summary -->
96 </div> <!-- end summary -->
97
97
98 <div id="changeset_compare_view_content">
98 <div id="changeset_compare_view_content">
99 <div class="pull-left">
99 <div class="pull-left">
100 <div class="btn-group">
100 <div class="btn-group">
101 <a
101 <a
102 class="btn"
102 class="btn"
103 href="#"
103 href="#"
104 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
104 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
105 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
105 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
106 </a>
106 </a>
107 <a
107 <a
108 class="btn"
108 class="btn"
109 href="#"
109 href="#"
110 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
110 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
111 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
111 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
112 </a>
112 </a>
113 </div>
113 </div>
114 </div>
114 </div>
115 ## Commit range generated below
115 ## Commit range generated below
116 <%include file="../compare/compare_commits.mako"/>
116 <%include file="../compare/compare_commits.mako"/>
117 <div class="cs_files">
117 <div class="cs_files">
118 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
118 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
119 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
119 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
120 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
120 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
121 ${cbdiffs.render_diffset_menu()}
121 ${cbdiffs.render_diffset_menu()}
122 %for commit in c.commit_ranges:
122 %for commit in c.commit_ranges:
123 ${cbdiffs.render_diffset(
123 ${cbdiffs.render_diffset(
124 diffset=c.changes[commit.raw_id],
124 diffset=c.changes[commit.raw_id],
125 collapse_when_files_over=5,
125 collapse_when_files_over=5,
126 commit=commit,
126 commit=commit,
127 )}
127 )}
128 %endfor
128 %endfor
129 </div>
129 </div>
130 </div>
130 </div>
131 </%def>
131 </%def>
@@ -1,767 +1,870 b''
1 <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/>
1 <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/>
2
2
3 <%def name="diff_line_anchor(filename, line, type)"><%
3 <%def name="diff_line_anchor(filename, line, type)"><%
4 return '%s_%s_%i' % (h.safeid(filename), type, line)
4 return '%s_%s_%i' % (h.safeid(filename), type, line)
5 %></%def>
5 %></%def>
6
6
7 <%def name="action_class(action)">
7 <%def name="action_class(action)">
8 <%
8 <%
9 return {
9 return {
10 '-': 'cb-deletion',
10 '-': 'cb-deletion',
11 '+': 'cb-addition',
11 '+': 'cb-addition',
12 ' ': 'cb-context',
12 ' ': 'cb-context',
13 }.get(action, 'cb-empty')
13 }.get(action, 'cb-empty')
14 %>
14 %>
15 </%def>
15 </%def>
16
16
17 <%def name="op_class(op_id)">
17 <%def name="op_class(op_id)">
18 <%
18 <%
19 return {
19 return {
20 DEL_FILENODE: 'deletion', # file deleted
20 DEL_FILENODE: 'deletion', # file deleted
21 BIN_FILENODE: 'warning' # binary diff hidden
21 BIN_FILENODE: 'warning' # binary diff hidden
22 }.get(op_id, 'addition')
22 }.get(op_id, 'addition')
23 %>
23 %>
24 </%def>
24 </%def>
25
25
26
26
27
27
28 <%def name="render_diffset(diffset, commit=None,
28 <%def name="render_diffset(diffset, commit=None,
29
29
30 # collapse all file diff entries when there are more than this amount of files in the diff
30 # collapse all file diff entries when there are more than this amount of files in the diff
31 collapse_when_files_over=20,
31 collapse_when_files_over=20,
32
32
33 # collapse lines in the diff when more than this amount of lines changed in the file diff
33 # collapse lines in the diff when more than this amount of lines changed in the file diff
34 lines_changed_limit=500,
34 lines_changed_limit=500,
35
35
36 # add a ruler at to the output
36 # add a ruler at to the output
37 ruler_at_chars=0,
37 ruler_at_chars=0,
38
38
39 # show inline comments
39 # show inline comments
40 use_comments=False,
40 use_comments=False,
41
41
42 # disable new comments
42 # disable new comments
43 disable_new_comments=False,
43 disable_new_comments=False,
44
44
45 # special file-comments that were deleted in previous versions
45 # special file-comments that were deleted in previous versions
46 # it's used for showing outdated comments for deleted files in a PR
46 # it's used for showing outdated comments for deleted files in a PR
47 deleted_files_comments=None,
47 deleted_files_comments=None,
48
48
49 # for cache purpose
49 # for cache purpose
50 inline_comments=None
50 inline_comments=None
51
51
52 )">
52 )">
53 %if use_comments:
53 %if use_comments:
54 <div id="cb-comments-inline-container-template" class="js-template">
54 <div id="cb-comments-inline-container-template" class="js-template">
55 ${inline_comments_container([], inline_comments)}
55 ${inline_comments_container([], inline_comments)}
56 </div>
56 </div>
57 <div class="js-template" id="cb-comment-inline-form-template">
57 <div class="js-template" id="cb-comment-inline-form-template">
58 <div class="comment-inline-form ac">
58 <div class="comment-inline-form ac">
59
59
60 %if c.rhodecode_user.username != h.DEFAULT_USER:
60 %if c.rhodecode_user.username != h.DEFAULT_USER:
61 ## render template for inline comments
61 ## render template for inline comments
62 ${commentblock.comment_form(form_type='inline')}
62 ${commentblock.comment_form(form_type='inline')}
63 %else:
63 %else:
64 ${h.form('', class_='inline-form comment-form-login', method='get')}
64 ${h.form('', class_='inline-form comment-form-login', method='get')}
65 <div class="pull-left">
65 <div class="pull-left">
66 <div class="comment-help pull-right">
66 <div class="comment-help pull-right">
67 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
67 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
68 </div>
68 </div>
69 </div>
69 </div>
70 <div class="comment-button pull-right">
70 <div class="comment-button pull-right">
71 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
71 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
72 ${_('Cancel')}
72 ${_('Cancel')}
73 </button>
73 </button>
74 </div>
74 </div>
75 <div class="clearfix"></div>
75 <div class="clearfix"></div>
76 ${h.end_form()}
76 ${h.end_form()}
77 %endif
77 %endif
78 </div>
78 </div>
79 </div>
79 </div>
80
80
81 %endif
81 %endif
82 <%
82 <%
83 collapse_all = len(diffset.files) > collapse_when_files_over
83 collapse_all = len(diffset.files) > collapse_when_files_over
84 %>
84 %>
85
85
86 %if c.user_session_attrs["diffmode"] == 'sideside':
86 %if c.user_session_attrs["diffmode"] == 'sideside':
87 <style>
87 <style>
88 .wrapper {
88 .wrapper {
89 max-width: 1600px !important;
89 max-width: 1600px !important;
90 }
90 }
91 </style>
91 </style>
92 %endif
92 %endif
93
93
94 %if ruler_at_chars:
94 %if ruler_at_chars:
95 <style>
95 <style>
96 .diff table.cb .cb-content:after {
96 .diff table.cb .cb-content:after {
97 content: "";
97 content: "";
98 border-left: 1px solid blue;
98 border-left: 1px solid blue;
99 position: absolute;
99 position: absolute;
100 top: 0;
100 top: 0;
101 height: 18px;
101 height: 18px;
102 opacity: .2;
102 opacity: .2;
103 z-index: 10;
103 z-index: 10;
104 //## +5 to account for diff action (+/-)
104 //## +5 to account for diff action (+/-)
105 left: ${ruler_at_chars + 5}ch;
105 left: ${ruler_at_chars + 5}ch;
106 </style>
106 </style>
107 %endif
107 %endif
108
108
109 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
109 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
110 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
110 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
111 %if commit:
111 %if commit:
112 <div class="pull-right">
112 <div class="pull-right">
113 <a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.route_path('repo_files',repo_name=diffset.repo_name, commit_id=commit.raw_id, f_path='')}">
113 <a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.route_path('repo_files',repo_name=diffset.repo_name, commit_id=commit.raw_id, f_path='')}">
114 ${_('Browse Files')}
114 ${_('Browse Files')}
115 </a>
115 </a>
116 </div>
116 </div>
117 %endif
117 %endif
118 <h2 class="clearinner">
118 <h2 class="clearinner">
119 ## invidual commit
119 %if commit:
120 % if commit:
120 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
121 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a> -
121 ${h.age_component(commit.date)} -
122 ${h.age_component(commit.date)}
122 %endif
123
124 %if diffset.limited_diff:
123 % if diffset.limited_diff:
125 ${_('The requested commit is too big and content was truncated.')}
124 - ${_('The requested commit is too big and content was truncated.')}
126
127 ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
125 ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
128 <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
126 <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
127 % elif hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1:
128 ## compare diff, has no file-selector and we want to show stats anyway
129 ${_ungettext('{num} file changed: {linesadd} inserted, ''{linesdel} deleted',
130 '{num} files changed: {linesadd} inserted, {linesdel} deleted', diffset.changed_files) \
131 .format(num=diffset.changed_files, linesadd=diffset.lines_added, linesdel=diffset.lines_deleted)}
132 % endif
129 %else:
133 % else:
130 ${_ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
134 ## pull requests/compare
131 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
135 ${_('File Changes')}
132 %endif
136 % endif
133
137
134 </h2>
138 </h2>
135 </div>
139 </div>
136
140
137 %if diffset.has_hidden_changes:
141 %if diffset.has_hidden_changes:
138 <p class="empty_data">${_('Some changes may be hidden')}</p>
142 <p class="empty_data">${_('Some changes may be hidden')}</p>
139 %elif not diffset.files:
143 %elif not diffset.files:
140 <p class="empty_data">${_('No files')}</p>
144 <p class="empty_data">${_('No files')}</p>
141 %endif
145 %endif
142
146
143 <div class="filediffs">
147 <div class="filediffs">
144 ## initial value could be marked as False later on
148 ## initial value could be marked as False later on
145 <% over_lines_changed_limit = False %>
149 <% over_lines_changed_limit = False %>
146 %for i, filediff in enumerate(diffset.files):
150 %for i, filediff in enumerate(diffset.files):
147
151
148 <%
152 <%
149 lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
153 lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
150 over_lines_changed_limit = lines_changed > lines_changed_limit
154 over_lines_changed_limit = lines_changed > lines_changed_limit
151 %>
155 %>
152
156
153 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
157 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
154 <div
158 <div
155 class="filediff"
159 class="filediff"
156 data-f-path="${filediff.patch['filename']}"
160 data-f-path="${filediff.patch['filename']}"
157 id="a_${h.FID('', filediff.patch['filename'])}"
161 id="a_${h.FID('', filediff.patch['filename'])}"
158 >
162 >
159
163
160 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
164 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
161 <div class="filediff-collapse-indicator"></div>
165 <div class="filediff-collapse-indicator"></div>
162 ${diff_ops(filediff)}
166 ${diff_ops(filediff)}
163 </label>
167 </label>
164 ${diff_menu(filediff, use_comments=use_comments)}
168 ${diff_menu(filediff, use_comments=use_comments)}
165 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
169 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
166
170
167 ## new/deleted/empty content case
171 ## new/deleted/empty content case
168 % if not filediff.hunks:
172 % if not filediff.hunks:
169 ## Comment container, on "fakes" hunk that contains all data to render comments
173 ## Comment container, on "fakes" hunk that contains all data to render comments
170 ${render_hunk_lines(c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments)}
174 ${render_hunk_lines(c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments)}
171 % endif
175 % endif
172
176
173 %if filediff.limited_diff:
177 %if filediff.limited_diff:
174 <tr class="cb-warning cb-collapser">
178 <tr class="cb-warning cb-collapser">
175 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
179 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
176 ${_('The requested commit is too big and content was truncated.')} <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
180 ${_('The requested commit is too big and content was truncated.')} <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
177 </td>
181 </td>
178 </tr>
182 </tr>
179 %else:
183 %else:
180 %if over_lines_changed_limit:
184 %if over_lines_changed_limit:
181 <tr class="cb-warning cb-collapser">
185 <tr class="cb-warning cb-collapser">
182 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
186 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
183 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
187 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
184 <a href="#" class="cb-expand"
188 <a href="#" class="cb-expand"
185 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
189 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
186 </a>
190 </a>
187 <a href="#" class="cb-collapse"
191 <a href="#" class="cb-collapse"
188 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
192 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
189 </a>
193 </a>
190 </td>
194 </td>
191 </tr>
195 </tr>
192 %endif
196 %endif
193 %endif
197 %endif
194
198
195 % for hunk in filediff.hunks:
199 % for hunk in filediff.hunks:
196 <tr class="cb-hunk">
200 <tr class="cb-hunk">
197 <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}>
201 <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}>
198 ## TODO: dan: add ajax loading of more context here
202 ## TODO: dan: add ajax loading of more context here
199 ## <a href="#">
203 ## <a href="#">
200 <i class="icon-more"></i>
204 <i class="icon-more"></i>
201 ## </a>
205 ## </a>
202 </td>
206 </td>
203 <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}>
207 <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}>
204 @@
208 @@
205 -${hunk.source_start},${hunk.source_length}
209 -${hunk.source_start},${hunk.source_length}
206 +${hunk.target_start},${hunk.target_length}
210 +${hunk.target_start},${hunk.target_length}
207 ${hunk.section_header}
211 ${hunk.section_header}
208 </td>
212 </td>
209 </tr>
213 </tr>
210 ${render_hunk_lines(c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments)}
214 ${render_hunk_lines(c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments)}
211 % endfor
215 % endfor
212
216
213 <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %>
217 <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %>
214
218
215 ## outdated comments that do not fit into currently displayed lines
219 ## outdated comments that do not fit into currently displayed lines
216 % for lineno, comments in unmatched_comments.items():
220 % for lineno, comments in unmatched_comments.items():
217
221
218 %if c.user_session_attrs["diffmode"] == 'unified':
222 %if c.user_session_attrs["diffmode"] == 'unified':
219 % if loop.index == 0:
223 % if loop.index == 0:
220 <tr class="cb-hunk">
224 <tr class="cb-hunk">
221 <td colspan="3"></td>
225 <td colspan="3"></td>
222 <td>
226 <td>
223 <div>
227 <div>
224 ${_('Unmatched inline comments below')}
228 ${_('Unmatched inline comments below')}
225 </div>
229 </div>
226 </td>
230 </td>
227 </tr>
231 </tr>
228 % endif
232 % endif
229 <tr class="cb-line">
233 <tr class="cb-line">
230 <td class="cb-data cb-context"></td>
234 <td class="cb-data cb-context"></td>
231 <td class="cb-lineno cb-context"></td>
235 <td class="cb-lineno cb-context"></td>
232 <td class="cb-lineno cb-context"></td>
236 <td class="cb-lineno cb-context"></td>
233 <td class="cb-content cb-context">
237 <td class="cb-content cb-context">
234 ${inline_comments_container(comments, inline_comments)}
238 ${inline_comments_container(comments, inline_comments)}
235 </td>
239 </td>
236 </tr>
240 </tr>
237 %elif c.user_session_attrs["diffmode"] == 'sideside':
241 %elif c.user_session_attrs["diffmode"] == 'sideside':
238 % if loop.index == 0:
242 % if loop.index == 0:
239 <tr class="cb-comment-info">
243 <tr class="cb-comment-info">
240 <td colspan="2"></td>
244 <td colspan="2"></td>
241 <td class="cb-line">
245 <td class="cb-line">
242 <div>
246 <div>
243 ${_('Unmatched inline comments below')}
247 ${_('Unmatched inline comments below')}
244 </div>
248 </div>
245 </td>
249 </td>
246 <td colspan="2"></td>
250 <td colspan="2"></td>
247 <td class="cb-line">
251 <td class="cb-line">
248 <div>
252 <div>
249 ${_('Unmatched comments below')}
253 ${_('Unmatched comments below')}
250 </div>
254 </div>
251 </td>
255 </td>
252 </tr>
256 </tr>
253 % endif
257 % endif
254 <tr class="cb-line">
258 <tr class="cb-line">
255 <td class="cb-data cb-context"></td>
259 <td class="cb-data cb-context"></td>
256 <td class="cb-lineno cb-context"></td>
260 <td class="cb-lineno cb-context"></td>
257 <td class="cb-content cb-context">
261 <td class="cb-content cb-context">
258 % if lineno.startswith('o'):
262 % if lineno.startswith('o'):
259 ${inline_comments_container(comments, inline_comments)}
263 ${inline_comments_container(comments, inline_comments)}
260 % endif
264 % endif
261 </td>
265 </td>
262
266
263 <td class="cb-data cb-context"></td>
267 <td class="cb-data cb-context"></td>
264 <td class="cb-lineno cb-context"></td>
268 <td class="cb-lineno cb-context"></td>
265 <td class="cb-content cb-context">
269 <td class="cb-content cb-context">
266 % if lineno.startswith('n'):
270 % if lineno.startswith('n'):
267 ${inline_comments_container(comments, inline_comments)}
271 ${inline_comments_container(comments, inline_comments)}
268 % endif
272 % endif
269 </td>
273 </td>
270 </tr>
274 </tr>
271 %endif
275 %endif
272
276
273 % endfor
277 % endfor
274
278
275 </table>
279 </table>
276 </div>
280 </div>
277 %endfor
281 %endfor
278
282
279 ## outdated comments that are made for a file that has been deleted
283 ## outdated comments that are made for a file that has been deleted
280 % for filename, comments_dict in (deleted_files_comments or {}).items():
284 % for filename, comments_dict in (deleted_files_comments or {}).items():
281 <%
285 <%
282 display_state = 'display: none'
286 display_state = 'display: none'
283 open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False]
287 open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False]
284 if open_comments_in_file:
288 if open_comments_in_file:
285 display_state = ''
289 display_state = ''
286 %>
290 %>
287 <div class="filediffs filediff-outdated" style="${display_state}">
291 <div class="filediffs filediff-outdated" style="${display_state}">
288 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
292 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
289 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
293 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
290 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
294 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
291 <div class="filediff-collapse-indicator"></div>
295 <div class="filediff-collapse-indicator"></div>
292 <span class="pill">
296 <span class="pill">
293 ## file was deleted
297 ## file was deleted
294 <strong>${filename}</strong>
298 <strong>${filename}</strong>
295 </span>
299 </span>
296 <span class="pill-group" style="float: left">
300 <span class="pill-group" style="float: left">
297 ## file op, doesn't need translation
301 ## file op, doesn't need translation
298 <span class="pill" op="removed">removed in this version</span>
302 <span class="pill" op="removed">removed in this version</span>
299 </span>
303 </span>
300 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a>
304 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a>
301 <span class="pill-group" style="float: right">
305 <span class="pill-group" style="float: right">
302 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
306 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
303 </span>
307 </span>
304 </label>
308 </label>
305
309
306 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
310 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
307 <tr>
311 <tr>
308 % if c.user_session_attrs["diffmode"] == 'unified':
312 % if c.user_session_attrs["diffmode"] == 'unified':
309 <td></td>
313 <td></td>
310 %endif
314 %endif
311
315
312 <td></td>
316 <td></td>
313 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}>
317 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}>
314 ${_('File was deleted in this version. There are still outdated/unresolved comments attached to it.')}
318 ${_('File was deleted in this version. There are still outdated/unresolved comments attached to it.')}
315 </td>
319 </td>
316 </tr>
320 </tr>
317 %if c.user_session_attrs["diffmode"] == 'unified':
321 %if c.user_session_attrs["diffmode"] == 'unified':
318 <tr class="cb-line">
322 <tr class="cb-line">
319 <td class="cb-data cb-context"></td>
323 <td class="cb-data cb-context"></td>
320 <td class="cb-lineno cb-context"></td>
324 <td class="cb-lineno cb-context"></td>
321 <td class="cb-lineno cb-context"></td>
325 <td class="cb-lineno cb-context"></td>
322 <td class="cb-content cb-context">
326 <td class="cb-content cb-context">
323 ${inline_comments_container(comments_dict['comments'], inline_comments)}
327 ${inline_comments_container(comments_dict['comments'], inline_comments)}
324 </td>
328 </td>
325 </tr>
329 </tr>
326 %elif c.user_session_attrs["diffmode"] == 'sideside':
330 %elif c.user_session_attrs["diffmode"] == 'sideside':
327 <tr class="cb-line">
331 <tr class="cb-line">
328 <td class="cb-data cb-context"></td>
332 <td class="cb-data cb-context"></td>
329 <td class="cb-lineno cb-context"></td>
333 <td class="cb-lineno cb-context"></td>
330 <td class="cb-content cb-context"></td>
334 <td class="cb-content cb-context"></td>
331
335
332 <td class="cb-data cb-context"></td>
336 <td class="cb-data cb-context"></td>
333 <td class="cb-lineno cb-context"></td>
337 <td class="cb-lineno cb-context"></td>
334 <td class="cb-content cb-context">
338 <td class="cb-content cb-context">
335 ${inline_comments_container(comments_dict['comments'], inline_comments)}
339 ${inline_comments_container(comments_dict['comments'], inline_comments)}
336 </td>
340 </td>
337 </tr>
341 </tr>
338 %endif
342 %endif
339 </table>
343 </table>
340 </div>
344 </div>
341 </div>
345 </div>
342 % endfor
346 % endfor
343
347
344 </div>
348 </div>
345 </div>
349 </div>
346 </%def>
350 </%def>
347
351
348 <%def name="diff_ops(filediff)">
352 <%def name="diff_ops(filediff)">
349 <%
353 <%
350 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
354 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
351 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
355 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
352 %>
356 %>
353 <span class="pill">
357 <span class="pill">
354 %if filediff.source_file_path and filediff.target_file_path:
358 %if filediff.source_file_path and filediff.target_file_path:
355 %if filediff.source_file_path != filediff.target_file_path:
359 %if filediff.source_file_path != filediff.target_file_path:
356 ## file was renamed, or copied
360 ## file was renamed, or copied
357 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
361 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
358 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
362 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
359 <% final_path = filediff.target_file_path %>
363 <% final_path = filediff.target_file_path %>
360 %elif COPIED_FILENODE in filediff.patch['stats']['ops']:
364 %elif COPIED_FILENODE in filediff.patch['stats']['ops']:
361 <strong>${filediff.target_file_path}</strong> β¬… ${filediff.source_file_path}
365 <strong>${filediff.target_file_path}</strong> β¬… ${filediff.source_file_path}
362 <% final_path = filediff.target_file_path %>
366 <% final_path = filediff.target_file_path %>
363 %endif
367 %endif
364 %else:
368 %else:
365 ## file was modified
369 ## file was modified
366 <strong>${filediff.source_file_path}</strong>
370 <strong>${filediff.source_file_path}</strong>
367 <% final_path = filediff.source_file_path %>
371 <% final_path = filediff.source_file_path %>
368 %endif
372 %endif
369 %else:
373 %else:
370 %if filediff.source_file_path:
374 %if filediff.source_file_path:
371 ## file was deleted
375 ## file was deleted
372 <strong>${filediff.source_file_path}</strong>
376 <strong>${filediff.source_file_path}</strong>
373 <% final_path = filediff.source_file_path %>
377 <% final_path = filediff.source_file_path %>
374 %else:
378 %else:
375 ## file was added
379 ## file was added
376 <strong>${filediff.target_file_path}</strong>
380 <strong>${filediff.target_file_path}</strong>
377 <% final_path = filediff.target_file_path %>
381 <% final_path = filediff.target_file_path %>
378 %endif
382 %endif
379 %endif
383 %endif
380 <i style="color: #aaa" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy the full path')}" onclick="return false;"></i>
384 <i style="color: #aaa" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy the full path')}" onclick="return false;"></i>
381 </span>
385 </span>
382 <span class="pill-group" style="float: left">
386 <span class="pill-group" style="float: left">
383 %if filediff.limited_diff:
387 %if filediff.limited_diff:
384 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
388 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
385 %endif
389 %endif
386
390
387 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
391 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
388 <span class="pill" op="renamed">renamed</span>
392 <span class="pill" op="renamed">renamed</span>
389 %endif
393 %endif
390
394
391 %if COPIED_FILENODE in filediff.patch['stats']['ops']:
395 %if COPIED_FILENODE in filediff.patch['stats']['ops']:
392 <span class="pill" op="copied">copied</span>
396 <span class="pill" op="copied">copied</span>
393 %endif
397 %endif
394
398
395 %if NEW_FILENODE in filediff.patch['stats']['ops']:
399 %if NEW_FILENODE in filediff.patch['stats']['ops']:
396 <span class="pill" op="created">created</span>
400 <span class="pill" op="created">created</span>
397 %if filediff['target_mode'].startswith('120'):
401 %if filediff['target_mode'].startswith('120'):
398 <span class="pill" op="symlink">symlink</span>
402 <span class="pill" op="symlink">symlink</span>
399 %else:
403 %else:
400 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
404 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
401 %endif
405 %endif
402 %endif
406 %endif
403
407
404 %if DEL_FILENODE in filediff.patch['stats']['ops']:
408 %if DEL_FILENODE in filediff.patch['stats']['ops']:
405 <span class="pill" op="removed">removed</span>
409 <span class="pill" op="removed">removed</span>
406 %endif
410 %endif
407
411
408 %if CHMOD_FILENODE in filediff.patch['stats']['ops']:
412 %if CHMOD_FILENODE in filediff.patch['stats']['ops']:
409 <span class="pill" op="mode">
413 <span class="pill" op="mode">
410 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
414 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
411 </span>
415 </span>
412 %endif
416 %endif
413 </span>
417 </span>
414
418
415 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
419 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
416
420
417 <span class="pill-group" style="float: right">
421 <span class="pill-group" style="float: right">
418 %if BIN_FILENODE in filediff.patch['stats']['ops']:
422 %if BIN_FILENODE in filediff.patch['stats']['ops']:
419 <span class="pill" op="binary">binary</span>
423 <span class="pill" op="binary">binary</span>
420 %if MOD_FILENODE in filediff.patch['stats']['ops']:
424 %if MOD_FILENODE in filediff.patch['stats']['ops']:
421 <span class="pill" op="modified">modified</span>
425 <span class="pill" op="modified">modified</span>
422 %endif
426 %endif
423 %endif
427 %endif
424 %if filediff.patch['stats']['added']:
428 %if filediff.patch['stats']['added']:
425 <span class="pill" op="added">+${filediff.patch['stats']['added']}</span>
429 <span class="pill" op="added">+${filediff.patch['stats']['added']}</span>
426 %endif
430 %endif
427 %if filediff.patch['stats']['deleted']:
431 %if filediff.patch['stats']['deleted']:
428 <span class="pill" op="deleted">-${filediff.patch['stats']['deleted']}</span>
432 <span class="pill" op="deleted">-${filediff.patch['stats']['deleted']}</span>
429 %endif
433 %endif
430 </span>
434 </span>
431
435
432 </%def>
436 </%def>
433
437
434 <%def name="nice_mode(filemode)">
438 <%def name="nice_mode(filemode)">
435 ${filemode.startswith('100') and filemode[3:] or filemode}
439 ${(filemode.startswith('100') and filemode[3:] or filemode)}
436 </%def>
440 </%def>
437
441
438 <%def name="diff_menu(filediff, use_comments=False)">
442 <%def name="diff_menu(filediff, use_comments=False)">
439 <div class="filediff-menu">
443 <div class="filediff-menu">
440 %if filediff.diffset.source_ref:
444 %if filediff.diffset.source_ref:
441 %if filediff.operation in ['D', 'M']:
445 %if filediff.operation in ['D', 'M']:
442 <a
446 <a
443 class="tooltip"
447 class="tooltip"
444 href="${h.route_path('repo_files',repo_name=filediff.diffset.repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
448 href="${h.route_path('repo_files',repo_name=filediff.diffset.repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
445 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
449 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
446 >
450 >
447 ${_('Show file before')}
451 ${_('Show file before')}
448 </a> |
452 </a> |
449 %else:
453 %else:
450 <span
454 <span
451 class="tooltip"
455 class="tooltip"
452 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
456 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
453 >
457 >
454 ${_('Show file before')}
458 ${_('Show file before')}
455 </span> |
459 </span> |
456 %endif
460 %endif
457 %if filediff.operation in ['A', 'M']:
461 %if filediff.operation in ['A', 'M']:
458 <a
462 <a
459 class="tooltip"
463 class="tooltip"
460 href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}"
464 href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}"
461 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
465 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
462 >
466 >
463 ${_('Show file after')}
467 ${_('Show file after')}
464 </a> |
468 </a> |
465 %else:
469 %else:
466 <span
470 <span
467 class="tooltip"
471 class="tooltip"
468 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
472 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
469 >
473 >
470 ${_('Show file after')}
474 ${_('Show file after')}
471 </span> |
475 </span> |
472 %endif
476 %endif
473 <a
477 <a
474 class="tooltip"
478 class="tooltip"
475 title="${h.tooltip(_('Raw diff'))}"
479 title="${h.tooltip(_('Raw diff'))}"
476 href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw'))}"
480 href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw'))}"
477 >
481 >
478 ${_('Raw diff')}
482 ${_('Raw diff')}
479 </a> |
483 </a> |
480 <a
484 <a
481 class="tooltip"
485 class="tooltip"
482 title="${h.tooltip(_('Download diff'))}"
486 title="${h.tooltip(_('Download diff'))}"
483 href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download'))}"
487 href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download'))}"
484 >
488 >
485 ${_('Download diff')}
489 ${_('Download diff')}
486 </a>
490 </a>
487 % if use_comments:
491 % if use_comments:
488 |
492 |
489 % endif
493 % endif
490
494
491 ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
495 ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
492 %if hasattr(c, 'ignorews_url'):
496 %if hasattr(c, 'ignorews_url'):
493 ${c.ignorews_url(request, h.FID('', filediff.patch['filename']))}
497 ${c.ignorews_url(request, h.FID('', filediff.patch['filename']))}
494 %endif
498 %endif
495 %if hasattr(c, 'context_url'):
499 %if hasattr(c, 'context_url'):
496 ${c.context_url(request, h.FID('', filediff.patch['filename']))}
500 ${c.context_url(request, h.FID('', filediff.patch['filename']))}
497 %endif
501 %endif
498
502
499 %if use_comments:
503 %if use_comments:
500 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
504 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
501 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
505 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
502 </a>
506 </a>
503 %endif
507 %endif
504 %endif
508 %endif
505 </div>
509 </div>
506 </%def>
510 </%def>
507
511
508
512
509 <%def name="inline_comments_container(comments, inline_comments)">
513 <%def name="inline_comments_container(comments, inline_comments)">
510 <div class="inline-comments">
514 <div class="inline-comments">
511 %for comment in comments:
515 %for comment in comments:
512 ${commentblock.comment_block(comment, inline=True)}
516 ${commentblock.comment_block(comment, inline=True)}
513 %endfor
517 %endfor
514 % if comments and comments[-1].outdated:
518 % if comments and comments[-1].outdated:
515 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
519 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
516 style="display: none;}">
520 style="display: none;}">
517 ${_('Add another comment')}
521 ${_('Add another comment')}
518 </span>
522 </span>
519 % else:
523 % else:
520 <span onclick="return Rhodecode.comments.createComment(this)"
524 <span onclick="return Rhodecode.comments.createComment(this)"
521 class="btn btn-secondary cb-comment-add-button">
525 class="btn btn-secondary cb-comment-add-button">
522 ${_('Add another comment')}
526 ${_('Add another comment')}
523 </span>
527 </span>
524 % endif
528 % endif
525
529
526 </div>
530 </div>
527 </%def>
531 </%def>
528
532
529 <%!
533 <%!
530 def get_comments_for(diff_type, comments, filename, line_version, line_number):
534 def get_comments_for(diff_type, comments, filename, line_version, line_number):
531 if hasattr(filename, 'unicode_path'):
535 if hasattr(filename, 'unicode_path'):
532 filename = filename.unicode_path
536 filename = filename.unicode_path
533
537
534 if not isinstance(filename, basestring):
538 if not isinstance(filename, basestring):
535 return None
539 return None
536
540
537 line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12
541 line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12
538
542
539 if comments and filename in comments:
543 if comments and filename in comments:
540 file_comments = comments[filename]
544 file_comments = comments[filename]
541 if line_key in file_comments:
545 if line_key in file_comments:
542 data = file_comments.pop(line_key)
546 data = file_comments.pop(line_key)
543 return data
547 return data
544 %>
548 %>
545
549
546 <%def name="render_hunk_lines_sideside(hunk, use_comments=False, inline_comments=None)">
550 <%def name="render_hunk_lines_sideside(hunk, use_comments=False, inline_comments=None)">
547
551
548 %for i, line in enumerate(hunk.sideside):
552 %for i, line in enumerate(hunk.sideside):
549 <%
553 <%
550 old_line_anchor, new_line_anchor = None, None
554 old_line_anchor, new_line_anchor = None, None
551 if line.original.lineno:
555 if line.original.lineno:
552 old_line_anchor = diff_line_anchor(hunk.source_file_path, line.original.lineno, 'o')
556 old_line_anchor = diff_line_anchor(hunk.source_file_path, line.original.lineno, 'o')
553 if line.modified.lineno:
557 if line.modified.lineno:
554 new_line_anchor = diff_line_anchor(hunk.target_file_path, line.modified.lineno, 'n')
558 new_line_anchor = diff_line_anchor(hunk.target_file_path, line.modified.lineno, 'n')
555 %>
559 %>
556
560
557 <tr class="cb-line">
561 <tr class="cb-line">
558 <td class="cb-data ${action_class(line.original.action)}"
562 <td class="cb-data ${action_class(line.original.action)}"
559 data-line-no="${line.original.lineno}"
563 data-line-no="${line.original.lineno}"
560 >
564 >
561 <div>
565 <div>
562
566
563 <% line_old_comments = None %>
567 <% line_old_comments = None %>
564 %if line.original.get_comment_args:
568 %if line.original.get_comment_args:
565 <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %>
569 <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %>
566 %endif
570 %endif
567 %if line_old_comments:
571 %if line_old_comments:
568 <% has_outdated = any([x.outdated for x in line_old_comments]) %>
572 <% has_outdated = any([x.outdated for x in line_old_comments]) %>
569 % if has_outdated:
573 % if has_outdated:
570 <i title="${_('comments including outdated')}:${len(line_old_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
574 <i title="${_('comments including outdated')}:${len(line_old_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
571 % else:
575 % else:
572 <i title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
576 <i title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
573 % endif
577 % endif
574 %endif
578 %endif
575 </div>
579 </div>
576 </td>
580 </td>
577 <td class="cb-lineno ${action_class(line.original.action)}"
581 <td class="cb-lineno ${action_class(line.original.action)}"
578 data-line-no="${line.original.lineno}"
582 data-line-no="${line.original.lineno}"
579 %if old_line_anchor:
583 %if old_line_anchor:
580 id="${old_line_anchor}"
584 id="${old_line_anchor}"
581 %endif
585 %endif
582 >
586 >
583 %if line.original.lineno:
587 %if line.original.lineno:
584 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
588 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
585 %endif
589 %endif
586 </td>
590 </td>
587 <td class="cb-content ${action_class(line.original.action)}"
591 <td class="cb-content ${action_class(line.original.action)}"
588 data-line-no="o${line.original.lineno}"
592 data-line-no="o${line.original.lineno}"
589 >
593 >
590 %if use_comments and line.original.lineno:
594 %if use_comments and line.original.lineno:
591 ${render_add_comment_button()}
595 ${render_add_comment_button()}
592 %endif
596 %endif
593 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
597 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
594
598
595 %if use_comments and line.original.lineno and line_old_comments:
599 %if use_comments and line.original.lineno and line_old_comments:
596 ${inline_comments_container(line_old_comments, inline_comments)}
600 ${inline_comments_container(line_old_comments, inline_comments)}
597 %endif
601 %endif
598
602
599 </td>
603 </td>
600 <td class="cb-data ${action_class(line.modified.action)}"
604 <td class="cb-data ${action_class(line.modified.action)}"
601 data-line-no="${line.modified.lineno}"
605 data-line-no="${line.modified.lineno}"
602 >
606 >
603 <div>
607 <div>
604
608
605 %if line.modified.get_comment_args:
609 %if line.modified.get_comment_args:
606 <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %>
610 <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %>
607 %else:
611 %else:
608 <% line_new_comments = None%>
612 <% line_new_comments = None%>
609 %endif
613 %endif
610 %if line_new_comments:
614 %if line_new_comments:
611 <% has_outdated = any([x.outdated for x in line_new_comments]) %>
615 <% has_outdated = any([x.outdated for x in line_new_comments]) %>
612 % if has_outdated:
616 % if has_outdated:
613 <i title="${_('comments including outdated')}:${len(line_new_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
617 <i title="${_('comments including outdated')}:${len(line_new_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
614 % else:
618 % else:
615 <i title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
619 <i title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
616 % endif
620 % endif
617 %endif
621 %endif
618 </div>
622 </div>
619 </td>
623 </td>
620 <td class="cb-lineno ${action_class(line.modified.action)}"
624 <td class="cb-lineno ${action_class(line.modified.action)}"
621 data-line-no="${line.modified.lineno}"
625 data-line-no="${line.modified.lineno}"
622 %if new_line_anchor:
626 %if new_line_anchor:
623 id="${new_line_anchor}"
627 id="${new_line_anchor}"
624 %endif
628 %endif
625 >
629 >
626 %if line.modified.lineno:
630 %if line.modified.lineno:
627 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
631 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
628 %endif
632 %endif
629 </td>
633 </td>
630 <td class="cb-content ${action_class(line.modified.action)}"
634 <td class="cb-content ${action_class(line.modified.action)}"
631 data-line-no="n${line.modified.lineno}"
635 data-line-no="n${line.modified.lineno}"
632 >
636 >
633 %if use_comments and line.modified.lineno:
637 %if use_comments and line.modified.lineno:
634 ${render_add_comment_button()}
638 ${render_add_comment_button()}
635 %endif
639 %endif
636 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
640 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
637 %if use_comments and line.modified.lineno and line_new_comments:
641 %if use_comments and line.modified.lineno and line_new_comments:
638 ${inline_comments_container(line_new_comments, inline_comments)}
642 ${inline_comments_container(line_new_comments, inline_comments)}
639 %endif
643 %endif
640 </td>
644 </td>
641 </tr>
645 </tr>
642 %endfor
646 %endfor
643 </%def>
647 </%def>
644
648
645
649
646 <%def name="render_hunk_lines_unified(hunk, use_comments=False, inline_comments=None)">
650 <%def name="render_hunk_lines_unified(hunk, use_comments=False, inline_comments=None)">
647 %for old_line_no, new_line_no, action, content, comments_args in hunk.unified:
651 %for old_line_no, new_line_no, action, content, comments_args in hunk.unified:
648 <%
652 <%
649 old_line_anchor, new_line_anchor = None, None
653 old_line_anchor, new_line_anchor = None, None
650 if old_line_no:
654 if old_line_no:
651 old_line_anchor = diff_line_anchor(hunk.source_file_path, old_line_no, 'o')
655 old_line_anchor = diff_line_anchor(hunk.source_file_path, old_line_no, 'o')
652 if new_line_no:
656 if new_line_no:
653 new_line_anchor = diff_line_anchor(hunk.target_file_path, new_line_no, 'n')
657 new_line_anchor = diff_line_anchor(hunk.target_file_path, new_line_no, 'n')
654 %>
658 %>
655 <tr class="cb-line">
659 <tr class="cb-line">
656 <td class="cb-data ${action_class(action)}">
660 <td class="cb-data ${action_class(action)}">
657 <div>
661 <div>
658
662
659 %if comments_args:
663 %if comments_args:
660 <% comments = get_comments_for('unified', inline_comments, *comments_args) %>
664 <% comments = get_comments_for('unified', inline_comments, *comments_args) %>
661 %else:
665 %else:
662 <% comments = None %>
666 <% comments = None %>
663 %endif
667 %endif
664
668
665 % if comments:
669 % if comments:
666 <% has_outdated = any([x.outdated for x in comments]) %>
670 <% has_outdated = any([x.outdated for x in comments]) %>
667 % if has_outdated:
671 % if has_outdated:
668 <i title="${_('comments including outdated')}:${len(comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
672 <i title="${_('comments including outdated')}:${len(comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
669 % else:
673 % else:
670 <i title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
674 <i title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
671 % endif
675 % endif
672 % endif
676 % endif
673 </div>
677 </div>
674 </td>
678 </td>
675 <td class="cb-lineno ${action_class(action)}"
679 <td class="cb-lineno ${action_class(action)}"
676 data-line-no="${old_line_no}"
680 data-line-no="${old_line_no}"
677 %if old_line_anchor:
681 %if old_line_anchor:
678 id="${old_line_anchor}"
682 id="${old_line_anchor}"
679 %endif
683 %endif
680 >
684 >
681 %if old_line_anchor:
685 %if old_line_anchor:
682 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
686 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
683 %endif
687 %endif
684 </td>
688 </td>
685 <td class="cb-lineno ${action_class(action)}"
689 <td class="cb-lineno ${action_class(action)}"
686 data-line-no="${new_line_no}"
690 data-line-no="${new_line_no}"
687 %if new_line_anchor:
691 %if new_line_anchor:
688 id="${new_line_anchor}"
692 id="${new_line_anchor}"
689 %endif
693 %endif
690 >
694 >
691 %if new_line_anchor:
695 %if new_line_anchor:
692 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
696 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
693 %endif
697 %endif
694 </td>
698 </td>
695 <td class="cb-content ${action_class(action)}"
699 <td class="cb-content ${action_class(action)}"
696 data-line-no="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
700 data-line-no="${(new_line_no and 'n' or 'o')}${(new_line_no or old_line_no)}"
697 >
701 >
698 %if use_comments:
702 %if use_comments:
699 ${render_add_comment_button()}
703 ${render_add_comment_button()}
700 %endif
704 %endif
701 <span class="cb-code">${action} ${content or '' | n}</span>
705 <span class="cb-code">${action} ${content or '' | n}</span>
702 %if use_comments and comments:
706 %if use_comments and comments:
703 ${inline_comments_container(comments, inline_comments)}
707 ${inline_comments_container(comments, inline_comments)}
704 %endif
708 %endif
705 </td>
709 </td>
706 </tr>
710 </tr>
707 %endfor
711 %endfor
708 </%def>
712 </%def>
709
713
710
714
711 <%def name="render_hunk_lines(diff_mode, hunk, use_comments, inline_comments)">
715 <%def name="render_hunk_lines(diff_mode, hunk, use_comments, inline_comments)">
712 % if diff_mode == 'unified':
716 % if diff_mode == 'unified':
713 ${render_hunk_lines_unified(hunk, use_comments=use_comments, inline_comments=inline_comments)}
717 ${render_hunk_lines_unified(hunk, use_comments=use_comments, inline_comments=inline_comments)}
714 % elif diff_mode == 'sideside':
718 % elif diff_mode == 'sideside':
715 ${render_hunk_lines_sideside(hunk, use_comments=use_comments, inline_comments=inline_comments)}
719 ${render_hunk_lines_sideside(hunk, use_comments=use_comments, inline_comments=inline_comments)}
716 % else:
720 % else:
717 <tr class="cb-line">
721 <tr class="cb-line">
718 <td>unknown diff mode</td>
722 <td>unknown diff mode</td>
719 </tr>
723 </tr>
720 % endif
724 % endif
721 </%def>
725 </%def>
722
726
723
727
724 <%def name="render_add_comment_button()">
728 <%def name="render_add_comment_button()">
725 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
729 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
726 <span><i class="icon-comment"></i></span>
730 <span><i class="icon-comment"></i></span>
727 </button>
731 </button>
728 </%def>
732 </%def>
729
733
730 <%def name="render_diffset_menu()">
734 <%def name="render_diffset_menu(diffset=None)">
731
735
732 <div class="diffset-menu clearinner">
736 <div class="diffset-menu clearinner">
733 <div class="pull-right">
737 <div class="pull-right">
734 <div class="btn-group">
738 <div class="btn-group">
735
739
736 <a
740 <a
737 class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-primary')} tooltip"
741 class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-primary')} tooltip"
738 title="${h.tooltip(_('View side by side'))}"
742 title="${h.tooltip(_('View side by side'))}"
739 href="${h.current_route_path(request, diffmode='sideside')}">
743 href="${h.current_route_path(request, diffmode='sideside')}">
740 <span>${_('Side by Side')}</span>
744 <span>${_('Side by Side')}</span>
741 </a>
745 </a>
742 <a
746 <a
743 class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-primary')} tooltip"
747 class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-primary')} tooltip"
744 title="${h.tooltip(_('View unified'))}" href="${h.current_route_path(request, diffmode='unified')}">
748 title="${h.tooltip(_('View unified'))}" href="${h.current_route_path(request, diffmode='unified')}">
745 <span>${_('Unified')}</span>
749 <span>${_('Unified')}</span>
746 </a>
750 </a>
747 </div>
751 </div>
748 </div>
752 </div>
749
753
750 <div class="pull-left">
754 <div class="pull-left">
751 <div class="btn-group">
755 <div class="btn-group">
756 <div class="pull-left">
757 ${h.hidden('file_filter')}
758 </div>
752 <a
759 <a
753 class="btn"
760 class="btn"
754 href="#"
761 href="#"
755 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
762 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
756 <a
763 <a
757 class="btn"
764 class="btn"
758 href="#"
765 href="#"
759 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
766 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
760 <a
767 <a
761 class="btn"
768 class="btn"
762 href="#"
769 href="#"
763 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
770 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
771
764 </div>
772 </div>
765 </div>
773 </div>
766 </div>
774 </div>
775
776 % if diffset:
777
778 %if diffset.limited_diff:
779 <% file_placeholder = _ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}%>
780 %else:
781 <% file_placeholder = _ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}%>
782 %endif
783
784 <script>
785
786 var feedFilesOptions = function (query, initialData) {
787 var data = {results: []};
788 var isQuery = typeof query.term !== 'undefined';
789
790 var section = _gettext('Changed files');
791 var filteredData = [];
792
793 //filter results
794 $.each(initialData.results, function (idx, value) {
795
796 if (!isQuery || query.term.length === 0 || value.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
797 filteredData.push({
798 'id': this.id,
799 'text': this.text,
800 "ops": this.ops,
801 })
802 }
803
804 });
805
806 data.results = filteredData;
807
808 query.callback(data);
809 };
810
811 var formatFileResult = function(result, container, query, escapeMarkup) {
812 return function(data, escapeMarkup) {
813 var container = '<div class="filelist" style="padding-right:100px">{0}</div>';
814 var tmpl = '<span style="margin-right:-50px"><strong>{0}</strong></span>'.format(escapeMarkup(data['text']));
815 var pill = '<span class="pill-group" style="float: right;margin-right: -100px">' +
816 '<span class="pill" op="added">{0}</span>' +
817 '<span class="pill" op="deleted">{1}</span>' +
818 '</span>'
819 ;
820 var added = data['ops']['added'];
821 if (added === 0) {
822 // don't show +0
823 added = 0;
824 } else {
825 added = '+' + added;
826 }
827
828 var deleted = -1*data['ops']['deleted'];
829
830 tmpl += pill.format(added, deleted);
831 return container.format(tmpl);
832
833 }(result, escapeMarkup);
834 };
835 var preloadData = {
836 results: [
837 % for filediff in diffset.files:
838 {id:"a_${h.FID('', filediff.patch['filename'])}",
839 text:"${filediff.patch['filename']}",
840 ops:${h.json.dumps(filediff.patch['stats'])|n}}${('' if loop.last else ',')}
841 % endfor
842 ]
843 };
844
845 $("#file_filter").select2({
846 'dropdownAutoWidth': true,
847 'width': 'auto',
848 'placeholder': "${file_placeholder}",
849 containerCssClass: "drop-menu",
850 dropdownCssClass: "drop-menu-dropdown",
851 data: preloadData,
852 query: function(query) {
853 feedFilesOptions(query, preloadData);
854 },
855 formatResult: formatFileResult
856 });
857
858 $("#file_filter").on('click', function (e) {
859 e.preventDefault();
860 var selected = $('#file_filter').select2('data');
861 var idSelector = "#"+selected.id;
862 window.location.hash = idSelector;
863 // expand the container if we quick-select the field
864 $(idSelector).prev().prop('checked', false);
865 })
866
867 </script>
868 % endif
869
767 </%def>
870 </%def>
@@ -1,117 +1,117 b''
1 ## Changesets table !
1 ## Changesets table !
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3
3
4 %if c.ancestor:
4 %if c.ancestor:
5 <div class="ancestor">${_('Common Ancestor Commit')}:
5 <div class="ancestor">${_('Common Ancestor Commit')}:
6 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=c.ancestor)}">
6 <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=c.ancestor)}">
7 ${h.short_id(c.ancestor)}
7 ${h.short_id(c.ancestor)}
8 </a>. ${_('Compare was calculated based on this shared commit.')}
8 </a>. ${_('Compare was calculated based on this shared commit.')}
9 <input id="common_ancestor" type="hidden" name="common_ancestor" value="${c.ancestor}">
9 <input id="common_ancestor" type="hidden" name="common_ancestor" value="${c.ancestor}">
10 </div>
10 </div>
11 %endif
11 %endif
12
12
13 <div class="container">
13 <div class="container">
14 <input type="hidden" name="__start__" value="revisions:sequence">
14 <input type="hidden" name="__start__" value="revisions:sequence">
15 <table class="rctable compare_view_commits">
15 <table class="rctable compare_view_commits">
16 <tr>
16 <tr>
17 <th>${_('Time')}</th>
17 <th>${_('Time')}</th>
18 <th>${_('Author')}</th>
18 <th>${_('Author')}</th>
19 <th>${_('Commit')}</th>
19 <th>${_('Commit')}</th>
20 <th></th>
20 <th></th>
21 <th>${_('Description')}</th>
21 <th>${_('Description')}</th>
22 </tr>
22 </tr>
23 ## to speed up lookups cache some functions before the loop
23 ## to speed up lookups cache some functions before the loop
24 <%
24 <%
25 active_patterns = h.get_active_pattern_entries(c.repo_name)
25 active_patterns = h.get_active_pattern_entries(c.repo_name)
26 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
26 urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns)
27 %>
27 %>
28 %for commit in c.commit_ranges:
28 %for commit in c.commit_ranges:
29 <tr id="row-${commit.raw_id}"
29 <tr id="row-${commit.raw_id}"
30 commit_id="${commit.raw_id}"
30 commit_id="${commit.raw_id}"
31 class="compare_select"
31 class="compare_select"
32 style="${'display: none' if c.collapse_all_commits else ''}"
32 style="${'display: none' if c.collapse_all_commits else ''}"
33 >
33 >
34 <td class="td-time">
34 <td class="td-time">
35 ${h.age_component(commit.date)}
35 ${h.age_component(commit.date)}
36 </td>
36 </td>
37 <td class="td-user">
37 <td class="td-user">
38 ${base.gravatar_with_user(commit.author, 16)}
38 ${base.gravatar_with_user(commit.author, 16)}
39 </td>
39 </td>
40 <td class="td-hash">
40 <td class="td-hash">
41 <code>
41 <code>
42 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
42 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
43 r${commit.revision}:${h.short_id(commit.raw_id)}
43 r${commit.idx}:${h.short_id(commit.raw_id)}
44 </a>
44 </a>
45 ${h.hidden('revisions',commit.raw_id)}
45 ${h.hidden('revisions',commit.raw_id)}
46 </code>
46 </code>
47 </td>
47 </td>
48 <td class="expand_commit"
48 <td class="expand_commit"
49 data-commit-id="${commit.raw_id}"
49 data-commit-id="${commit.raw_id}"
50 title="${_( 'Expand commit message')}"
50 title="${_( 'Expand commit message')}"
51 >
51 >
52 <div class="show_more_col">
52 <div class="show_more_col">
53 <i class="show_more"></i>
53 <i class="show_more"></i>
54 </div>
54 </div>
55 </td>
55 </td>
56 <td class="mid td-description">
56 <td class="mid td-description">
57 <div class="log-container truncate-wrap">
57 <div class="log-container truncate-wrap">
58 <div
58 <div
59 id="c-${commit.raw_id}"
59 id="c-${commit.raw_id}"
60 class="message truncate"
60 class="message truncate"
61 data-message-raw="${commit.message}"
61 data-message-raw="${commit.message}"
62 >
62 >
63 ${urlify_commit_message(commit.message, c.repo_name)}
63 ${urlify_commit_message(commit.message, c.repo_name)}
64 </div>
64 </div>
65 </div>
65 </div>
66 </td>
66 </td>
67 </tr>
67 </tr>
68 %endfor
68 %endfor
69 <tr class="compare_select_hidden" style="${'' if c.collapse_all_commits else 'display: none'}">
69 <tr class="compare_select_hidden" style="${'' if c.collapse_all_commits else 'display: none'}">
70 <td colspan="5">
70 <td colspan="5">
71 ${_ungettext('%s commit hidden','%s commits hidden', len(c.commit_ranges)) % len(c.commit_ranges)},
71 ${_ungettext('%s commit hidden','%s commits hidden', len(c.commit_ranges)) % len(c.commit_ranges)},
72 <a href="#" onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">${_ungettext('show it','show them', len(c.commit_ranges))}</a>
72 <a href="#" onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">${_ungettext('show it','show them', len(c.commit_ranges))}</a>
73 </td>
73 </td>
74 </tr>
74 </tr>
75 % if not c.commit_ranges:
75 % if not c.commit_ranges:
76 <tr class="compare_select">
76 <tr class="compare_select">
77 <td colspan="5">
77 <td colspan="5">
78 ${_('No commits in this compare')}
78 ${_('No commits in this compare')}
79 </td>
79 </td>
80 </tr>
80 </tr>
81 % endif
81 % endif
82 </table>
82 </table>
83 <input type="hidden" name="__end__" value="revisions:sequence">
83 <input type="hidden" name="__end__" value="revisions:sequence">
84
84
85 </div>
85 </div>
86
86
87 <script>
87 <script>
88 $('.expand_commit').on('click',function(e){
88 $('.expand_commit').on('click',function(e){
89 var target_expand = $(this);
89 var target_expand = $(this);
90 var cid = target_expand.data('commitId');
90 var cid = target_expand.data('commitId');
91
91
92 // ## TODO: dan: extract styles into css, and just toggleClass('open') here
92 // ## TODO: dan: extract styles into css, and just toggleClass('open') here
93 if (target_expand.hasClass('open')){
93 if (target_expand.hasClass('open')){
94 $('#c-'+cid).css({
94 $('#c-'+cid).css({
95 'height': '1.5em',
95 'height': '1.5em',
96 'white-space': 'nowrap',
96 'white-space': 'nowrap',
97 'text-overflow': 'ellipsis',
97 'text-overflow': 'ellipsis',
98 'overflow':'hidden'
98 'overflow':'hidden'
99 });
99 });
100 target_expand.removeClass('open');
100 target_expand.removeClass('open');
101 }
101 }
102 else {
102 else {
103 $('#c-'+cid).css({
103 $('#c-'+cid).css({
104 'height': 'auto',
104 'height': 'auto',
105 'white-space': 'pre-line',
105 'white-space': 'pre-line',
106 'text-overflow': 'initial',
106 'text-overflow': 'initial',
107 'overflow':'visible'
107 'overflow':'visible'
108 });
108 });
109 target_expand.addClass('open');
109 target_expand.addClass('open');
110 }
110 }
111 });
111 });
112
112
113 $('.compare_select').on('click',function(e){
113 $('.compare_select').on('click',function(e){
114 var cid = $(this).attr('commit_id');
114 var cid = $(this).attr('commit_id');
115 $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl'));
115 $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl'));
116 });
116 });
117 </script>
117 </script>
@@ -1,333 +1,333 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
3 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
4
4
5 <%def name="title()">
5 <%def name="title()">
6 %if c.compare_home:
6 %if c.compare_home:
7 ${_('%s Compare') % c.repo_name}
7 ${_('%s Compare') % c.repo_name}
8 %else:
8 %else:
9 ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} &gt; ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}
9 ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} &gt; ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}
10 %endif
10 %endif
11 %if c.rhodecode_name:
11 %if c.rhodecode_name:
12 &middot; ${h.branding(c.rhodecode_name)}
12 &middot; ${h.branding(c.rhodecode_name)}
13 %endif
13 %endif
14 </%def>
14 </%def>
15
15
16 <%def name="breadcrumbs_links()">
16 <%def name="breadcrumbs_links()">
17 ${_ungettext('%s commit','%s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
17 ${_ungettext('%s commit','%s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
18 </%def>
18 </%def>
19
19
20 <%def name="menu_bar_nav()">
20 <%def name="menu_bar_nav()">
21 ${self.menu_items(active='repositories')}
21 ${self.menu_items(active='repositories')}
22 </%def>
22 </%def>
23
23
24 <%def name="menu_bar_subnav()">
24 <%def name="menu_bar_subnav()">
25 ${self.repo_menu(active='compare')}
25 ${self.repo_menu(active='compare')}
26 </%def>
26 </%def>
27
27
28 <%def name="main()">
28 <%def name="main()">
29 <script type="text/javascript">
29 <script type="text/javascript">
30 // set fake commitId on this commit-range page
30 // set fake commitId on this commit-range page
31 templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}";
31 templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}";
32 </script>
32 </script>
33
33
34 <div class="box">
34 <div class="box">
35 <div class="title">
35 <div class="title">
36 ${self.repo_page_title(c.rhodecode_db_repo)}
36 ${self.repo_page_title(c.rhodecode_db_repo)}
37 </div>
37 </div>
38
38
39 <div class="summary changeset">
39 <div class="summary changeset">
40 <div class="summary-detail">
40 <div class="summary-detail">
41 <div class="summary-detail-header">
41 <div class="summary-detail-header">
42 <span class="breadcrumbs files_location">
42 <span class="breadcrumbs files_location">
43 <h4>
43 <h4>
44 ${_('Compare Commits')}
44 ${_('Compare Commits')}
45 % if c.file_path:
45 % if c.file_path:
46 ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a>
46 ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a>
47 % endif
47 % endif
48
48
49 % if c.commit_ranges:
49 % if c.commit_ranges:
50 <code>
50 <code>
51 r${c.source_commit.revision}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.revision}:${h.short_id(c.target_commit.raw_id)}
51 r${c.source_commit.revision}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.revision}:${h.short_id(c.target_commit.raw_id)}
52 </code>
52 </code>
53 % endif
53 % endif
54 </h4>
54 </h4>
55 </span>
55 </span>
56 </div>
56 </div>
57
57
58 <div class="fieldset">
58 <div class="fieldset">
59 <div class="left-label">
59 <div class="left-label">
60 ${_('Target')}:
60 ${_('Target')}:
61 </div>
61 </div>
62 <div class="right-content">
62 <div class="right-content">
63 <div>
63 <div>
64 <div class="code-header" >
64 <div class="code-header" >
65 <div class="compare_header">
65 <div class="compare_header">
66 ## The hidden elements are replaced with a select2 widget
66 ## The hidden elements are replaced with a select2 widget
67 ${h.hidden('compare_source')}
67 ${h.hidden('compare_source')}
68 </div>
68 </div>
69 </div>
69 </div>
70 </div>
70 </div>
71 </div>
71 </div>
72 </div>
72 </div>
73
73
74 <div class="fieldset">
74 <div class="fieldset">
75 <div class="left-label">
75 <div class="left-label">
76 ${_('Source')}:
76 ${_('Source')}:
77 </div>
77 </div>
78 <div class="right-content">
78 <div class="right-content">
79 <div>
79 <div>
80 <div class="code-header" >
80 <div class="code-header" >
81 <div class="compare_header">
81 <div class="compare_header">
82 ## The hidden elements are replaced with a select2 widget
82 ## The hidden elements are replaced with a select2 widget
83 ${h.hidden('compare_target')}
83 ${h.hidden('compare_target')}
84 </div>
84 </div>
85 </div>
85 </div>
86 </div>
86 </div>
87 </div>
87 </div>
88 </div>
88 </div>
89
89
90 <div class="fieldset">
90 <div class="fieldset">
91 <div class="left-label">
91 <div class="left-label">
92 ${_('Actions')}:
92 ${_('Actions')}:
93 </div>
93 </div>
94 <div class="right-content">
94 <div class="right-content">
95 <div>
95 <div>
96 <div class="code-header" >
96 <div class="code-header" >
97 <div class="compare_header">
97 <div class="compare_header">
98
98
99 <div class="compare-buttons">
99 <div class="compare-buttons">
100 % if c.compare_home:
100 % if c.compare_home:
101 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
101 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
102
102
103 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
103 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
104 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
104 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
105 <div id="changeset_compare_view_content">
105 <div id="changeset_compare_view_content">
106 <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div>
106 <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div>
107 </div>
107 </div>
108
108
109 % elif c.preview_mode:
109 % elif c.preview_mode:
110 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a>
110 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a>
111 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
111 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a>
112 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
112 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
113
113
114 % else:
114 % else:
115 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
115 <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a>
116 <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a>
116 <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a>
117
117
118 ## allow comment only if there are commits to comment on
118 ## allow comment only if there are commits to comment on
119 % if c.diffset and c.diffset.files and c.commit_ranges:
119 % if c.diffset and c.diffset.files and c.commit_ranges:
120 <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a>
120 <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a>
121 % else:
121 % else:
122 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
122 <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a>
123 % endif
123 % endif
124 % endif
124 % endif
125 </div>
125 </div>
126 </div>
126 </div>
127 </div>
127 </div>
128 </div>
128 </div>
129 </div>
129 </div>
130 </div>
130 </div>
131
131
132 <%doc>
132 <%doc>
133 ##TODO(marcink): implement this and diff menus
133 ##TODO(marcink): implement this and diff menus
134 <div class="fieldset">
134 <div class="fieldset">
135 <div class="left-label">
135 <div class="left-label">
136 ${_('Diff options')}:
136 ${_('Diff options')}:
137 </div>
137 </div>
138 <div class="right-content">
138 <div class="right-content">
139 <div class="diff-actions">
139 <div class="diff-actions">
140 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
140 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
141 ${_('Raw Diff')}
141 ${_('Raw Diff')}
142 </a>
142 </a>
143 |
143 |
144 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
144 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
145 ${_('Patch Diff')}
145 ${_('Patch Diff')}
146 </a>
146 </a>
147 |
147 |
148 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
148 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
149 ${_('Download Diff')}
149 ${_('Download Diff')}
150 </a>
150 </a>
151 </div>
151 </div>
152 </div>
152 </div>
153 </div>
153 </div>
154 </%doc>
154 </%doc>
155
155
156 ## commit status form
156 ## commit status form
157 <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;">
157 <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;">
158 <div class="left-label">
158 <div class="left-label">
159 ${_('Commit status')}:
159 ${_('Commit status')}:
160 </div>
160 </div>
161 <div class="right-content">
161 <div class="right-content">
162 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
162 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
163 ## main comment form and it status
163 ## main comment form and it status
164 <%
164 <%
165 def revs(_revs):
165 def revs(_revs):
166 form_inputs = []
166 form_inputs = []
167 for cs in _revs:
167 for cs in _revs:
168 tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id}
168 tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id}
169 form_inputs.append(tmpl)
169 form_inputs.append(tmpl)
170 return form_inputs
170 return form_inputs
171 %>
171 %>
172 <div>
172 <div>
173 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))}
173 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))}
174 </div>
174 </div>
175 </div>
175 </div>
176 </div>
176 </div>
177
177
178 </div> <!-- end summary-detail -->
178 </div> <!-- end summary-detail -->
179 </div> <!-- end summary -->
179 </div> <!-- end summary -->
180
180
181 ## use JS script to load it quickly before potentially large diffs render long time
181 ## use JS script to load it quickly before potentially large diffs render long time
182 ## this prevents from situation when large diffs block rendering of select2 fields
182 ## this prevents from situation when large diffs block rendering of select2 fields
183 <script type="text/javascript">
183 <script type="text/javascript">
184
184
185 var cache = {};
185 var cache = {};
186
186
187 var formatSelection = function(repoName){
187 var formatSelection = function(repoName){
188 return function(data, container, escapeMarkup) {
188 return function(data, container, escapeMarkup) {
189 var selection = data ? this.text(data) : "";
189 var selection = data ? this.text(data) : "";
190 return escapeMarkup('{0}@{1}'.format(repoName, selection));
190 return escapeMarkup('{0}@{1}'.format(repoName, selection));
191 }
191 }
192 };
192 };
193
193
194 var feedCompareData = function(query, cachedValue){
194 var feedCompareData = function(query, cachedValue){
195 var data = {results: []};
195 var data = {results: []};
196 //filter results
196 //filter results
197 $.each(cachedValue.results, function() {
197 $.each(cachedValue.results, function() {
198 var section = this.text;
198 var section = this.text;
199 var children = [];
199 var children = [];
200 $.each(this.children, function() {
200 $.each(this.children, function() {
201 if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
201 if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
202 children.push({
202 children.push({
203 'id': this.id,
203 'id': this.id,
204 'text': this.text,
204 'text': this.text,
205 'type': this.type
205 'type': this.type
206 })
206 })
207 }
207 }
208 });
208 });
209 data.results.push({
209 data.results.push({
210 'text': section,
210 'text': section,
211 'children': children
211 'children': children
212 })
212 })
213 });
213 });
214 //push the typed in changeset
214 //push the typed in changeset
215 data.results.push({
215 data.results.push({
216 'text': _gettext('specify commit'),
216 'text': _gettext('specify commit'),
217 'children': [{
217 'children': [{
218 'id': query.term,
218 'id': query.term,
219 'text': query.term,
219 'text': query.term,
220 'type': 'rev'
220 'type': 'rev'
221 }]
221 }]
222 });
222 });
223 query.callback(data);
223 query.callback(data);
224 };
224 };
225
225
226 var loadCompareData = function(repoName, query, cache){
226 var loadCompareData = function(repoName, query, cache){
227 $.ajax({
227 $.ajax({
228 url: pyroutes.url('repo_refs_data', {'repo_name': repoName}),
228 url: pyroutes.url('repo_refs_data', {'repo_name': repoName}),
229 data: {},
229 data: {},
230 dataType: 'json',
230 dataType: 'json',
231 type: 'GET',
231 type: 'GET',
232 success: function(data) {
232 success: function(data) {
233 cache[repoName] = data;
233 cache[repoName] = data;
234 query.callback({results: data.results});
234 query.callback({results: data.results});
235 }
235 }
236 })
236 })
237 };
237 };
238
238
239 var enable_fields = ${"false" if c.preview_mode else "true"};
239 var enable_fields = ${"false" if c.preview_mode else "true"};
240 $("#compare_source").select2({
240 $("#compare_source").select2({
241 placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}",
241 placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}",
242 containerCssClass: "drop-menu",
242 containerCssClass: "drop-menu",
243 dropdownCssClass: "drop-menu-dropdown",
243 dropdownCssClass: "drop-menu-dropdown",
244 formatSelection: formatSelection("${c.source_repo.repo_name}"),
244 formatSelection: formatSelection("${c.source_repo.repo_name}"),
245 dropdownAutoWidth: true,
245 dropdownAutoWidth: true,
246 query: function(query) {
246 query: function(query) {
247 var repoName = '${c.source_repo.repo_name}';
247 var repoName = '${c.source_repo.repo_name}';
248 var cachedValue = cache[repoName];
248 var cachedValue = cache[repoName];
249
249
250 if (cachedValue){
250 if (cachedValue){
251 feedCompareData(query, cachedValue);
251 feedCompareData(query, cachedValue);
252 }
252 }
253 else {
253 else {
254 loadCompareData(repoName, query, cache);
254 loadCompareData(repoName, query, cache);
255 }
255 }
256 }
256 }
257 }).select2("enable", enable_fields);
257 }).select2("enable", enable_fields);
258
258
259 $("#compare_target").select2({
259 $("#compare_target").select2({
260 placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}",
260 placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}",
261 dropdownAutoWidth: true,
261 dropdownAutoWidth: true,
262 containerCssClass: "drop-menu",
262 containerCssClass: "drop-menu",
263 dropdownCssClass: "drop-menu-dropdown",
263 dropdownCssClass: "drop-menu-dropdown",
264 formatSelection: formatSelection("${c.target_repo.repo_name}"),
264 formatSelection: formatSelection("${c.target_repo.repo_name}"),
265 query: function(query) {
265 query: function(query) {
266 var repoName = '${c.target_repo.repo_name}';
266 var repoName = '${c.target_repo.repo_name}';
267 var cachedValue = cache[repoName];
267 var cachedValue = cache[repoName];
268
268
269 if (cachedValue){
269 if (cachedValue){
270 feedCompareData(query, cachedValue);
270 feedCompareData(query, cachedValue);
271 }
271 }
272 else {
272 else {
273 loadCompareData(repoName, query, cache);
273 loadCompareData(repoName, query, cache);
274 }
274 }
275 }
275 }
276 }).select2("enable", enable_fields);
276 }).select2("enable", enable_fields);
277 var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"};
277 var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"};
278 var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"};
278 var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"};
279
279
280 $('#compare_revs').on('click', function(e) {
280 $('#compare_revs').on('click', function(e) {
281 var source = $('#compare_source').select2('data') || initial_compare_source;
281 var source = $('#compare_source').select2('data') || initial_compare_source;
282 var target = $('#compare_target').select2('data') || initial_compare_target;
282 var target = $('#compare_target').select2('data') || initial_compare_target;
283 if (source && target) {
283 if (source && target) {
284 var url_data = {
284 var url_data = {
285 repo_name: "${c.repo_name}",
285 repo_name: "${c.repo_name}",
286 source_ref: source.id,
286 source_ref: source.id,
287 source_ref_type: source.type,
287 source_ref_type: source.type,
288 target_ref: target.id,
288 target_ref: target.id,
289 target_ref_type: target.type
289 target_ref_type: target.type
290 };
290 };
291 window.location = pyroutes.url('repo_compare', url_data);
291 window.location = pyroutes.url('repo_compare', url_data);
292 }
292 }
293 });
293 });
294 $('#compare_changeset_status_toggle').on('click', function(e) {
294 $('#compare_changeset_status_toggle').on('click', function(e) {
295 $('#compare_changeset_status').toggle();
295 $('#compare_changeset_status').toggle();
296 });
296 });
297
297
298 </script>
298 </script>
299
299
300 ## table diff data
300 ## table diff data
301 <div class="table">
301 <div class="table">
302
302
303
303
304 % if not c.compare_home:
304 % if not c.compare_home:
305 <div id="changeset_compare_view_content">
305 <div id="changeset_compare_view_content">
306 <div class="pull-left">
306 <div class="pull-left">
307 <div class="btn-group">
307 <div class="btn-group">
308 <a
308 <a
309 class="btn"
309 class="btn"
310 href="#"
310 href="#"
311 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
311 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
312 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
312 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
313 </a>
313 </a>
314 <a
314 <a
315 class="btn"
315 class="btn"
316 href="#"
316 href="#"
317 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
317 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
318 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
318 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
319 </a>
319 </a>
320 </div>
320 </div>
321 </div>
321 </div>
322 <div style="padding:0 10px 10px 0px" class="pull-left"></div>
322 <div style="padding:0 10px 10px 0px" class="pull-left"></div>
323 ## commit compare generated below
323 ## commit compare generated below
324 <%include file="compare_commits.mako"/>
324 <%include file="compare_commits.mako"/>
325 ${cbdiffs.render_diffset_menu()}
325 ${cbdiffs.render_diffset_menu(c.diffset)}
326 ${cbdiffs.render_diffset(c.diffset)}
326 ${cbdiffs.render_diffset(c.diffset)}
327 </div>
327 </div>
328 % endif
328 % endif
329
329
330 </div>
330 </div>
331 </div>
331 </div>
332
332
333 </%def> No newline at end of file
333 </%def>
@@ -1,859 +1,859 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 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
6 ${_('%s Pull Request #%s') % (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 <div class="title">
41 <div class="title">
42 ${self.repo_page_title(c.rhodecode_db_repo)}
42 ${self.repo_page_title(c.rhodecode_db_repo)}
43 </div>
43 </div>
44
44
45 ${self.breadcrumbs()}
45 ${self.breadcrumbs()}
46
46
47 <div class="box pr-summary">
47 <div class="box pr-summary">
48
48
49 <div class="summary-details block-left">
49 <div class="summary-details block-left">
50 <% summary = lambda n:{False:'summary-short'}.get(n) %>
50 <% summary = lambda n:{False:'summary-short'}.get(n) %>
51 <div class="pr-details-title">
51 <div class="pr-details-title">
52 <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)}
52 <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)}
53 %if c.allowed_to_update:
53 %if c.allowed_to_update:
54 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
54 <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
55 % if c.allowed_to_delete:
55 % if c.allowed_to_delete:
56 ${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)}
56 ${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)}
57 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
57 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
58 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
58 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
59 ${h.end_form()}
59 ${h.end_form()}
60 % else:
60 % else:
61 ${_('Delete')}
61 ${_('Delete')}
62 % endif
62 % endif
63 </div>
63 </div>
64 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
64 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
65 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
65 <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
66 %endif
66 %endif
67 </div>
67 </div>
68
68
69 <div id="summary" class="fields pr-details-content">
69 <div id="summary" class="fields pr-details-content">
70 <div class="field">
70 <div class="field">
71 <div class="label-summary">
71 <div class="label-summary">
72 <label>${_('Source')}:</label>
72 <label>${_('Source')}:</label>
73 </div>
73 </div>
74 <div class="input">
74 <div class="input">
75 <div class="pr-origininfo">
75 <div class="pr-origininfo">
76 ## branch link is only valid if it is a branch
76 ## branch link is only valid if it is a branch
77 <span class="tag">
77 <span class="tag">
78 %if c.pull_request.source_ref_parts.type == 'branch':
78 %if c.pull_request.source_ref_parts.type == 'branch':
79 <a href="${h.route_path('repo_changelog', 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>
79 <a href="${h.route_path('repo_changelog', 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>
80 %else:
80 %else:
81 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
81 ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
82 %endif
82 %endif
83 </span>
83 </span>
84 <span class="clone-url">
84 <span class="clone-url">
85 <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
85 <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a>
86 </span>
86 </span>
87 <br/>
87 <br/>
88 % if c.ancestor_commit:
88 % if c.ancestor_commit:
89 ${_('Common ancestor')}:
89 ${_('Common ancestor')}:
90 <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>
90 <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>
91 % endif
91 % endif
92 </div>
92 </div>
93 %if h.is_hg(c.pull_request.source_repo):
93 %if h.is_hg(c.pull_request.source_repo):
94 <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
94 <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
95 %elif h.is_git(c.pull_request.source_repo):
95 %elif h.is_git(c.pull_request.source_repo):
96 <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
96 <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
97 %endif
97 %endif
98
98
99 <div class="">
99 <div class="">
100 <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
100 <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
101 <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
101 <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
102 </div>
102 </div>
103
103
104 </div>
104 </div>
105 </div>
105 </div>
106 <div class="field">
106 <div class="field">
107 <div class="label-summary">
107 <div class="label-summary">
108 <label>${_('Target')}:</label>
108 <label>${_('Target')}:</label>
109 </div>
109 </div>
110 <div class="input">
110 <div class="input">
111 <div class="pr-targetinfo">
111 <div class="pr-targetinfo">
112 ## branch link is only valid if it is a branch
112 ## branch link is only valid if it is a branch
113 <span class="tag">
113 <span class="tag">
114 %if c.pull_request.target_ref_parts.type == 'branch':
114 %if c.pull_request.target_ref_parts.type == 'branch':
115 <a href="${h.route_path('repo_changelog', 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>
115 <a href="${h.route_path('repo_changelog', 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>
116 %else:
116 %else:
117 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
117 ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
118 %endif
118 %endif
119 </span>
119 </span>
120 <span class="clone-url">
120 <span class="clone-url">
121 <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a>
121 <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a>
122 </span>
122 </span>
123 </div>
123 </div>
124 </div>
124 </div>
125 </div>
125 </div>
126
126
127 ## Link to the shadow repository.
127 ## Link to the shadow repository.
128 <div class="field">
128 <div class="field">
129 <div class="label-summary">
129 <div class="label-summary">
130 <label>${_('Merge')}:</label>
130 <label>${_('Merge')}:</label>
131 </div>
131 </div>
132 <div class="input">
132 <div class="input">
133 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
133 % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref:
134 %if h.is_hg(c.pull_request.target_repo):
134 %if h.is_hg(c.pull_request.target_repo):
135 <% 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) %>
135 <% 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) %>
136 %elif h.is_git(c.pull_request.target_repo):
136 %elif h.is_git(c.pull_request.target_repo):
137 <% 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) %>
137 <% 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) %>
138 %endif
138 %endif
139 <div class="">
139 <div class="">
140 <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly">
140 <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly">
141 <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i>
141 <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i>
142 </div>
142 </div>
143 % else:
143 % else:
144 <div class="">
144 <div class="">
145 ${_('Shadow repository data not available')}.
145 ${_('Shadow repository data not available')}.
146 </div>
146 </div>
147 % endif
147 % endif
148 </div>
148 </div>
149 </div>
149 </div>
150
150
151 <div class="field">
151 <div class="field">
152 <div class="label-summary">
152 <div class="label-summary">
153 <label>${_('Review')}:</label>
153 <label>${_('Review')}:</label>
154 </div>
154 </div>
155 <div class="input">
155 <div class="input">
156 %if c.pull_request_review_status:
156 %if c.pull_request_review_status:
157 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
157 <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div>
158 <span class="changeset-status-lbl tooltip">
158 <span class="changeset-status-lbl tooltip">
159 %if c.pull_request.is_closed():
159 %if c.pull_request.is_closed():
160 ${_('Closed')},
160 ${_('Closed')},
161 %endif
161 %endif
162 ${h.commit_status_lbl(c.pull_request_review_status)}
162 ${h.commit_status_lbl(c.pull_request_review_status)}
163 </span>
163 </span>
164 - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)}
164 - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)}
165 %endif
165 %endif
166 </div>
166 </div>
167 </div>
167 </div>
168 <div class="field">
168 <div class="field">
169 <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}">
169 <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}">
170 <label>${_('Description')}:</label>
170 <label>${_('Description')}:</label>
171 </div>
171 </div>
172 <div id="pr-desc" class="input">
172 <div id="pr-desc" class="input">
173 <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer)}</div>
173 <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer)}</div>
174 </div>
174 </div>
175 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
175 <div id="pr-desc-edit" class="input textarea editor" style="display: none;">
176 <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}">
176 <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}">
177 ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)}
177 ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)}
178 </div>
178 </div>
179 </div>
179 </div>
180
180
181 <div class="field">
181 <div class="field">
182 <div class="label-summary">
182 <div class="label-summary">
183 <label>${_('Versions')}:</label>
183 <label>${_('Versions')}:</label>
184 </div>
184 </div>
185
185
186 <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
186 <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
187 <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
187 <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
188
188
189 <div class="pr-versions">
189 <div class="pr-versions">
190 % if c.show_version_changes:
190 % if c.show_version_changes:
191 <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
191 <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
192 <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
192 <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
193 <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions"
193 <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions"
194 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))}"
194 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))}"
195 data-toggle-off="${_('Hide all versions of this pull request')}">
195 data-toggle-off="${_('Hide all versions of this pull request')}">
196 ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}
196 ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}
197 </a>
197 </a>
198 <table>
198 <table>
199 ## SHOW ALL VERSIONS OF PR
199 ## SHOW ALL VERSIONS OF PR
200 <% ver_pr = None %>
200 <% ver_pr = None %>
201
201
202 % for data in reversed(list(enumerate(c.versions, 1))):
202 % for data in reversed(list(enumerate(c.versions, 1))):
203 <% ver_pos = data[0] %>
203 <% ver_pos = data[0] %>
204 <% ver = data[1] %>
204 <% ver = data[1] %>
205 <% ver_pr = ver.pull_request_version_id %>
205 <% ver_pr = ver.pull_request_version_id %>
206 <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
206 <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
207
207
208 <tr class="version-pr" style="display: ${display_row}">
208 <tr class="version-pr" style="display: ${display_row}">
209 <td>
209 <td>
210 <code>
210 <code>
211 <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
211 <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
212 </code>
212 </code>
213 </td>
213 </td>
214 <td>
214 <td>
215 <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}"/>
215 <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}"/>
216 <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}"/>
216 <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}"/>
217 </td>
217 </td>
218 <td>
218 <td>
219 <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
219 <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
220 <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}">
220 <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}">
221 </div>
221 </div>
222 </td>
222 </td>
223 <td>
223 <td>
224 % if c.at_version_num != ver_pr:
224 % if c.at_version_num != ver_pr:
225 <i class="icon-comment"></i>
225 <i class="icon-comment"></i>
226 <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']))}">
226 <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']))}">
227 G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])}
227 G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])}
228 </code>
228 </code>
229 % endif
229 % endif
230 </td>
230 </td>
231 <td>
231 <td>
232 ##<code>${ver.source_ref_parts.commit_id[:6]}</code>
232 ##<code>${ver.source_ref_parts.commit_id[:6]}</code>
233 </td>
233 </td>
234 <td>
234 <td>
235 ${h.age_component(ver.updated_on, time_is_local=True)}
235 ${h.age_component(ver.updated_on, time_is_local=True)}
236 </td>
236 </td>
237 </tr>
237 </tr>
238 % endfor
238 % endfor
239
239
240 <tr>
240 <tr>
241 <td colspan="6">
241 <td colspan="6">
242 <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
242 <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
243 data-label-text-locked="${_('select versions to show changes')}"
243 data-label-text-locked="${_('select versions to show changes')}"
244 data-label-text-diff="${_('show changes between versions')}"
244 data-label-text-diff="${_('show changes between versions')}"
245 data-label-text-show="${_('show pull request for this version')}"
245 data-label-text-show="${_('show pull request for this version')}"
246 >
246 >
247 ${_('select versions to show changes')}
247 ${_('select versions to show changes')}
248 </button>
248 </button>
249 </td>
249 </td>
250 </tr>
250 </tr>
251
251
252 ## show comment/inline comments summary
252 ## show comment/inline comments summary
253 <%def name="comments_summary()">
253 <%def name="comments_summary()">
254 <tr>
254 <tr>
255 <td colspan="6" class="comments-summary-td">
255 <td colspan="6" class="comments-summary-td">
256
256
257 % if c.at_version:
257 % if c.at_version:
258 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %>
258 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %>
259 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %>
259 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %>
260 ${_('Comments at this version')}:
260 ${_('Comments at this version')}:
261 % else:
261 % else:
262 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %>
262 <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %>
263 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %>
263 <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %>
264 ${_('Comments for this pull request')}:
264 ${_('Comments for this pull request')}:
265 % endif
265 % endif
266
266
267
267
268 %if general_comm_count_ver:
268 %if general_comm_count_ver:
269 <a href="#comments">${_("%d General ") % general_comm_count_ver}</a>
269 <a href="#comments">${_("%d General ") % general_comm_count_ver}</a>
270 %else:
270 %else:
271 ${_("%d General ") % general_comm_count_ver}
271 ${_("%d General ") % general_comm_count_ver}
272 %endif
272 %endif
273
273
274 %if inline_comm_count_ver:
274 %if inline_comm_count_ver:
275 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
275 , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a>
276 %else:
276 %else:
277 , ${_("%d Inline") % inline_comm_count_ver}
277 , ${_("%d Inline") % inline_comm_count_ver}
278 %endif
278 %endif
279
279
280 %if outdated_comm_count_ver:
280 %if outdated_comm_count_ver:
281 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a>
281 , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a>
282 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
282 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a>
283 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
283 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a>
284 %else:
284 %else:
285 , ${_("%d Outdated") % outdated_comm_count_ver}
285 , ${_("%d Outdated") % outdated_comm_count_ver}
286 %endif
286 %endif
287 </td>
287 </td>
288 </tr>
288 </tr>
289 </%def>
289 </%def>
290 ${comments_summary()}
290 ${comments_summary()}
291 </table>
291 </table>
292 % else:
292 % else:
293 <div class="input">
293 <div class="input">
294 ${_('Pull request versions not available')}.
294 ${_('Pull request versions not available')}.
295 </div>
295 </div>
296 <div>
296 <div>
297 <table>
297 <table>
298 ${comments_summary()}
298 ${comments_summary()}
299 </table>
299 </table>
300 </div>
300 </div>
301 % endif
301 % endif
302 </div>
302 </div>
303 </div>
303 </div>
304
304
305 <div id="pr-save" class="field" style="display: none;">
305 <div id="pr-save" class="field" style="display: none;">
306 <div class="label-summary"></div>
306 <div class="label-summary"></div>
307 <div class="input">
307 <div class="input">
308 <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span>
308 <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span>
309 </div>
309 </div>
310 </div>
310 </div>
311 </div>
311 </div>
312 </div>
312 </div>
313 <div>
313 <div>
314 ## AUTHOR
314 ## AUTHOR
315 <div class="reviewers-title block-right">
315 <div class="reviewers-title block-right">
316 <div class="pr-details-title">
316 <div class="pr-details-title">
317 ${_('Author of this pull request')}
317 ${_('Author of this pull request')}
318 </div>
318 </div>
319 </div>
319 </div>
320 <div class="block-right pr-details-content reviewers">
320 <div class="block-right pr-details-content reviewers">
321 <ul class="group_members">
321 <ul class="group_members">
322 <li>
322 <li>
323 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
323 ${self.gravatar_with_user(c.pull_request.author.email, 16)}
324 </li>
324 </li>
325 </ul>
325 </ul>
326 </div>
326 </div>
327
327
328 ## REVIEW RULES
328 ## REVIEW RULES
329 <div id="review_rules" style="display: none" class="reviewers-title block-right">
329 <div id="review_rules" style="display: none" class="reviewers-title block-right">
330 <div class="pr-details-title">
330 <div class="pr-details-title">
331 ${_('Reviewer rules')}
331 ${_('Reviewer rules')}
332 %if c.allowed_to_update:
332 %if c.allowed_to_update:
333 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
333 <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
334 %endif
334 %endif
335 </div>
335 </div>
336 <div class="pr-reviewer-rules">
336 <div class="pr-reviewer-rules">
337 ## review rules will be appended here, by default reviewers logic
337 ## review rules will be appended here, by default reviewers logic
338 </div>
338 </div>
339 <input id="review_data" type="hidden" name="review_data" value="">
339 <input id="review_data" type="hidden" name="review_data" value="">
340 </div>
340 </div>
341
341
342 ## REVIEWERS
342 ## REVIEWERS
343 <div class="reviewers-title block-right">
343 <div class="reviewers-title block-right">
344 <div class="pr-details-title">
344 <div class="pr-details-title">
345 ${_('Pull request reviewers')}
345 ${_('Pull request reviewers')}
346 %if c.allowed_to_update:
346 %if c.allowed_to_update:
347 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
347 <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
348 %endif
348 %endif
349 </div>
349 </div>
350 </div>
350 </div>
351 <div id="reviewers" class="block-right pr-details-content reviewers">
351 <div id="reviewers" class="block-right pr-details-content reviewers">
352
352
353 ## members redering block
353 ## members redering block
354 <input type="hidden" name="__start__" value="review_members:sequence">
354 <input type="hidden" name="__start__" value="review_members:sequence">
355 <ul id="review_members" class="group_members">
355 <ul id="review_members" class="group_members">
356
356
357 % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers:
357 % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers:
358 <script>
358 <script>
359 var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n};
359 var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n};
360 var status = "${(status[0][1].status if status else 'not_reviewed')}";
360 var status = "${(status[0][1].status if status else 'not_reviewed')}";
361 var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}";
361 var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}";
362 var allowed_to_update = ${h.json.dumps(c.allowed_to_update)};
362 var allowed_to_update = ${h.json.dumps(c.allowed_to_update)};
363
363
364 var entry = renderTemplate('reviewMemberEntry', {
364 var entry = renderTemplate('reviewMemberEntry', {
365 'member': member,
365 'member': member,
366 'mandatory': member.mandatory,
366 'mandatory': member.mandatory,
367 'reasons': member.reasons,
367 'reasons': member.reasons,
368 'allowed_to_update': allowed_to_update,
368 'allowed_to_update': allowed_to_update,
369 'review_status': status,
369 'review_status': status,
370 'review_status_label': status_lbl,
370 'review_status_label': status_lbl,
371 'user_group': member.user_group,
371 'user_group': member.user_group,
372 'create': false
372 'create': false
373 });
373 });
374 $('#review_members').append(entry)
374 $('#review_members').append(entry)
375 </script>
375 </script>
376
376
377 % endfor
377 % endfor
378
378
379 </ul>
379 </ul>
380 <input type="hidden" name="__end__" value="review_members:sequence">
380 <input type="hidden" name="__end__" value="review_members:sequence">
381 ## end members redering block
381 ## end members redering block
382
382
383 %if not c.pull_request.is_closed():
383 %if not c.pull_request.is_closed():
384 <div id="add_reviewer" class="ac" style="display: none;">
384 <div id="add_reviewer" class="ac" style="display: none;">
385 %if c.allowed_to_update:
385 %if c.allowed_to_update:
386 % if not c.forbid_adding_reviewers:
386 % if not c.forbid_adding_reviewers:
387 <div id="add_reviewer_input" class="reviewer_ac">
387 <div id="add_reviewer_input" class="reviewer_ac">
388 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))}
388 ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))}
389 <div id="reviewers_container"></div>
389 <div id="reviewers_container"></div>
390 </div>
390 </div>
391 % endif
391 % endif
392 <div class="pull-right">
392 <div class="pull-right">
393 <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button>
393 <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button>
394 </div>
394 </div>
395 %endif
395 %endif
396 </div>
396 </div>
397 %endif
397 %endif
398 </div>
398 </div>
399 </div>
399 </div>
400 </div>
400 </div>
401 <div class="box">
401 <div class="box">
402 ##DIFF
402 ##DIFF
403 <div class="table" >
403 <div class="table" >
404 <div id="changeset_compare_view_content">
404 <div id="changeset_compare_view_content">
405 ##CS
405 ##CS
406 % if c.missing_requirements:
406 % if c.missing_requirements:
407 <div class="box">
407 <div class="box">
408 <div class="alert alert-warning">
408 <div class="alert alert-warning">
409 <div>
409 <div>
410 <strong>${_('Missing requirements:')}</strong>
410 <strong>${_('Missing requirements:')}</strong>
411 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
411 ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
412 </div>
412 </div>
413 </div>
413 </div>
414 </div>
414 </div>
415 % elif c.missing_commits:
415 % elif c.missing_commits:
416 <div class="box">
416 <div class="box">
417 <div class="alert alert-warning">
417 <div class="alert alert-warning">
418 <div>
418 <div>
419 <strong>${_('Missing commits')}:</strong>
419 <strong>${_('Missing commits')}:</strong>
420 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
420 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
421 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
421 ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
422 ${_('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}
422 ${_('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}
423 </div>
423 </div>
424 </div>
424 </div>
425 </div>
425 </div>
426 % endif
426 % endif
427
427
428 <div class="compare_view_commits_title">
428 <div class="compare_view_commits_title">
429 % if not c.compare_mode:
429 % if not c.compare_mode:
430
430
431 % if c.at_version_pos:
431 % if c.at_version_pos:
432 <h4>
432 <h4>
433 ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos}
433 ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos}
434 </h4>
434 </h4>
435 % endif
435 % endif
436
436
437 <div class="pull-left">
437 <div class="pull-left">
438 <div class="btn-group">
438 <div class="btn-group">
439 <a
439 <a
440 class="btn"
440 class="btn"
441 href="#"
441 href="#"
442 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
442 onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">
443 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
443 ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
444 </a>
444 </a>
445 <a
445 <a
446 class="btn"
446 class="btn"
447 href="#"
447 href="#"
448 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
448 onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false">
449 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
449 ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)}
450 </a>
450 </a>
451 </div>
451 </div>
452 </div>
452 </div>
453
453
454 <div class="pull-right">
454 <div class="pull-right">
455 % if c.allowed_to_update and not c.pull_request.is_closed():
455 % if c.allowed_to_update and not c.pull_request.is_closed():
456 <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a>
456 <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a>
457 % else:
457 % else:
458 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
458 <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a>
459 % endif
459 % endif
460
460
461 </div>
461 </div>
462 % endif
462 % endif
463 </div>
463 </div>
464
464
465 % if not c.missing_commits:
465 % if not c.missing_commits:
466 % if c.compare_mode:
466 % if c.compare_mode:
467 % if c.at_version:
467 % if c.at_version:
468 <h4>
468 <h4>
469 ${_('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')}:
469 ${_('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')}:
470 </h4>
470 </h4>
471
471
472 <div class="subtitle-compare">
472 <div class="subtitle-compare">
473 ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
473 ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
474 </div>
474 </div>
475
475
476 <div class="container">
476 <div class="container">
477 <table class="rctable compare_view_commits">
477 <table class="rctable compare_view_commits">
478 <tr>
478 <tr>
479 <th></th>
479 <th></th>
480 <th>${_('Time')}</th>
480 <th>${_('Time')}</th>
481 <th>${_('Author')}</th>
481 <th>${_('Author')}</th>
482 <th>${_('Commit')}</th>
482 <th>${_('Commit')}</th>
483 <th></th>
483 <th></th>
484 <th>${_('Description')}</th>
484 <th>${_('Description')}</th>
485 </tr>
485 </tr>
486
486
487 % for c_type, commit in c.commit_changes:
487 % for c_type, commit in c.commit_changes:
488 % if c_type in ['a', 'r']:
488 % if c_type in ['a', 'r']:
489 <%
489 <%
490 if c_type == 'a':
490 if c_type == 'a':
491 cc_title = _('Commit added in displayed changes')
491 cc_title = _('Commit added in displayed changes')
492 elif c_type == 'r':
492 elif c_type == 'r':
493 cc_title = _('Commit removed in displayed changes')
493 cc_title = _('Commit removed in displayed changes')
494 else:
494 else:
495 cc_title = ''
495 cc_title = ''
496 %>
496 %>
497 <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select">
497 <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select">
498 <td>
498 <td>
499 <div class="commit-change-indicator color-${c_type}-border">
499 <div class="commit-change-indicator color-${c_type}-border">
500 <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}">
500 <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}">
501 ${c_type.upper()}
501 ${c_type.upper()}
502 </div>
502 </div>
503 </div>
503 </div>
504 </td>
504 </td>
505 <td class="td-time">
505 <td class="td-time">
506 ${h.age_component(commit.date)}
506 ${h.age_component(commit.date)}
507 </td>
507 </td>
508 <td class="td-user">
508 <td class="td-user">
509 ${base.gravatar_with_user(commit.author, 16)}
509 ${base.gravatar_with_user(commit.author, 16)}
510 </td>
510 </td>
511 <td class="td-hash">
511 <td class="td-hash">
512 <code>
512 <code>
513 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
513 <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}">
514 r${commit.revision}:${h.short_id(commit.raw_id)}
514 r${commit.revision}:${h.short_id(commit.raw_id)}
515 </a>
515 </a>
516 ${h.hidden('revisions', commit.raw_id)}
516 ${h.hidden('revisions', commit.raw_id)}
517 </code>
517 </code>
518 </td>
518 </td>
519 <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}">
519 <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}">
520 <div class="show_more_col">
520 <div class="show_more_col">
521 <i class="show_more"></i>
521 <i class="show_more"></i>
522 </div>
522 </div>
523 </td>
523 </td>
524 <td class="mid td-description">
524 <td class="mid td-description">
525 <div class="log-container truncate-wrap">
525 <div class="log-container truncate-wrap">
526 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">
526 <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">
527 ${h.urlify_commit_message(commit.message, c.repo_name)}
527 ${h.urlify_commit_message(commit.message, c.repo_name)}
528 </div>
528 </div>
529 </div>
529 </div>
530 </td>
530 </td>
531 </tr>
531 </tr>
532 % endif
532 % endif
533 % endfor
533 % endfor
534 </table>
534 </table>
535 </div>
535 </div>
536
536
537 <script>
537 <script>
538 $('.expand_commit').on('click',function(e){
538 $('.expand_commit').on('click',function(e){
539 var target_expand = $(this);
539 var target_expand = $(this);
540 var cid = target_expand.data('commitId');
540 var cid = target_expand.data('commitId');
541
541
542 if (target_expand.hasClass('open')){
542 if (target_expand.hasClass('open')){
543 $('#c-'+cid).css({
543 $('#c-'+cid).css({
544 'height': '1.5em',
544 'height': '1.5em',
545 'white-space': 'nowrap',
545 'white-space': 'nowrap',
546 'text-overflow': 'ellipsis',
546 'text-overflow': 'ellipsis',
547 'overflow':'hidden'
547 'overflow':'hidden'
548 });
548 });
549 target_expand.removeClass('open');
549 target_expand.removeClass('open');
550 }
550 }
551 else {
551 else {
552 $('#c-'+cid).css({
552 $('#c-'+cid).css({
553 'height': 'auto',
553 'height': 'auto',
554 'white-space': 'pre-line',
554 'white-space': 'pre-line',
555 'text-overflow': 'initial',
555 'text-overflow': 'initial',
556 'overflow':'visible'
556 'overflow':'visible'
557 });
557 });
558 target_expand.addClass('open');
558 target_expand.addClass('open');
559 }
559 }
560 });
560 });
561 </script>
561 </script>
562
562
563 % endif
563 % endif
564
564
565 % else:
565 % else:
566 <%include file="/compare/compare_commits.mako" />
566 <%include file="/compare/compare_commits.mako" />
567 % endif
567 % endif
568
568
569 <div class="cs_files">
569 <div class="cs_files">
570 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
570 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
571 ${cbdiffs.render_diffset_menu()}
571 ${cbdiffs.render_diffset_menu(c.diffset)}
572 ${cbdiffs.render_diffset(
572 ${cbdiffs.render_diffset(
573 c.diffset, use_comments=True,
573 c.diffset, use_comments=True,
574 collapse_when_files_over=30,
574 collapse_when_files_over=30,
575 disable_new_comments=not c.allowed_to_comment,
575 disable_new_comments=not c.allowed_to_comment,
576 deleted_files_comments=c.deleted_files_comments,
576 deleted_files_comments=c.deleted_files_comments,
577 inline_comments=c.inline_comments)}
577 inline_comments=c.inline_comments)}
578 </div>
578 </div>
579 % else:
579 % else:
580 ## skipping commits we need to clear the view for missing commits
580 ## skipping commits we need to clear the view for missing commits
581 <div style="clear:both;"></div>
581 <div style="clear:both;"></div>
582 % endif
582 % endif
583
583
584 </div>
584 </div>
585 </div>
585 </div>
586
586
587 ## template for inline comment form
587 ## template for inline comment form
588 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
588 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
589
589
590 ## render general comments
590 ## render general comments
591
591
592 <div id="comment-tr-show">
592 <div id="comment-tr-show">
593 <div class="comment">
593 <div class="comment">
594 % if general_outdated_comm_count_ver:
594 % if general_outdated_comm_count_ver:
595 <div class="meta">
595 <div class="meta">
596 % if general_outdated_comm_count_ver == 1:
596 % if general_outdated_comm_count_ver == 1:
597 ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)},
597 ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)},
598 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a>
598 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a>
599 % else:
599 % else:
600 ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)},
600 ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)},
601 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a>
601 <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a>
602 % endif
602 % endif
603 </div>
603 </div>
604 % endif
604 % endif
605 </div>
605 </div>
606 </div>
606 </div>
607
607
608 ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)}
608 ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)}
609
609
610 % if not c.pull_request.is_closed():
610 % if not c.pull_request.is_closed():
611 ## merge status, and merge action
611 ## merge status, and merge action
612 <div class="pull-request-merge">
612 <div class="pull-request-merge">
613 <%include file="/pullrequests/pullrequest_merge_checks.mako"/>
613 <%include file="/pullrequests/pullrequest_merge_checks.mako"/>
614 </div>
614 </div>
615
615
616 ## main comment form and it status
616 ## main comment form and it status
617 ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name,
617 ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name,
618 pull_request_id=c.pull_request.pull_request_id),
618 pull_request_id=c.pull_request.pull_request_id),
619 c.pull_request_review_status,
619 c.pull_request_review_status,
620 is_pull_request=True, change_status=c.allowed_to_change_status)}
620 is_pull_request=True, change_status=c.allowed_to_change_status)}
621 %endif
621 %endif
622
622
623 <script type="text/javascript">
623 <script type="text/javascript">
624 if (location.hash) {
624 if (location.hash) {
625 var result = splitDelimitedHash(location.hash);
625 var result = splitDelimitedHash(location.hash);
626 var line = $('html').find(result.loc);
626 var line = $('html').find(result.loc);
627 // show hidden comments if we use location.hash
627 // show hidden comments if we use location.hash
628 if (line.hasClass('comment-general')) {
628 if (line.hasClass('comment-general')) {
629 $(line).show();
629 $(line).show();
630 } else if (line.hasClass('comment-inline')) {
630 } else if (line.hasClass('comment-inline')) {
631 $(line).show();
631 $(line).show();
632 var $cb = $(line).closest('.cb');
632 var $cb = $(line).closest('.cb');
633 $cb.removeClass('cb-collapsed')
633 $cb.removeClass('cb-collapsed')
634 }
634 }
635 if (line.length > 0){
635 if (line.length > 0){
636 offsetScroll(line, 70);
636 offsetScroll(line, 70);
637 }
637 }
638 }
638 }
639
639
640 versionController = new VersionController();
640 versionController = new VersionController();
641 versionController.init();
641 versionController.init();
642
642
643 reviewersController = new ReviewersController();
643 reviewersController = new ReviewersController();
644
644
645 $(function(){
645 $(function(){
646
646
647 // custom code mirror
647 // custom code mirror
648 var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
648 var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
649
649
650 var PRDetails = {
650 var PRDetails = {
651 editButton: $('#open_edit_pullrequest'),
651 editButton: $('#open_edit_pullrequest'),
652 closeButton: $('#close_edit_pullrequest'),
652 closeButton: $('#close_edit_pullrequest'),
653 deleteButton: $('#delete_pullrequest'),
653 deleteButton: $('#delete_pullrequest'),
654 viewFields: $('#pr-desc, #pr-title'),
654 viewFields: $('#pr-desc, #pr-title'),
655 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
655 editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'),
656
656
657 init: function() {
657 init: function() {
658 var that = this;
658 var that = this;
659 this.editButton.on('click', function(e) { that.edit(); });
659 this.editButton.on('click', function(e) { that.edit(); });
660 this.closeButton.on('click', function(e) { that.view(); });
660 this.closeButton.on('click', function(e) { that.view(); });
661 },
661 },
662
662
663 edit: function(event) {
663 edit: function(event) {
664 this.viewFields.hide();
664 this.viewFields.hide();
665 this.editButton.hide();
665 this.editButton.hide();
666 this.deleteButton.hide();
666 this.deleteButton.hide();
667 this.closeButton.show();
667 this.closeButton.show();
668 this.editFields.show();
668 this.editFields.show();
669 codeMirrorInstance.refresh();
669 codeMirrorInstance.refresh();
670 },
670 },
671
671
672 view: function(event) {
672 view: function(event) {
673 this.editButton.show();
673 this.editButton.show();
674 this.deleteButton.show();
674 this.deleteButton.show();
675 this.editFields.hide();
675 this.editFields.hide();
676 this.closeButton.hide();
676 this.closeButton.hide();
677 this.viewFields.show();
677 this.viewFields.show();
678 }
678 }
679 };
679 };
680
680
681 var ReviewersPanel = {
681 var ReviewersPanel = {
682 editButton: $('#open_edit_reviewers'),
682 editButton: $('#open_edit_reviewers'),
683 closeButton: $('#close_edit_reviewers'),
683 closeButton: $('#close_edit_reviewers'),
684 addButton: $('#add_reviewer'),
684 addButton: $('#add_reviewer'),
685 removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'),
685 removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'),
686
686
687 init: function() {
687 init: function() {
688 var self = this;
688 var self = this;
689 this.editButton.on('click', function(e) { self.edit(); });
689 this.editButton.on('click', function(e) { self.edit(); });
690 this.closeButton.on('click', function(e) { self.close(); });
690 this.closeButton.on('click', function(e) { self.close(); });
691 },
691 },
692
692
693 edit: function(event) {
693 edit: function(event) {
694 this.editButton.hide();
694 this.editButton.hide();
695 this.closeButton.show();
695 this.closeButton.show();
696 this.addButton.show();
696 this.addButton.show();
697 this.removeButtons.css('visibility', 'visible');
697 this.removeButtons.css('visibility', 'visible');
698 // review rules
698 // review rules
699 reviewersController.loadReviewRules(
699 reviewersController.loadReviewRules(
700 ${c.pull_request.reviewer_data_json | n});
700 ${c.pull_request.reviewer_data_json | n});
701 },
701 },
702
702
703 close: function(event) {
703 close: function(event) {
704 this.editButton.show();
704 this.editButton.show();
705 this.closeButton.hide();
705 this.closeButton.hide();
706 this.addButton.hide();
706 this.addButton.hide();
707 this.removeButtons.css('visibility', 'hidden');
707 this.removeButtons.css('visibility', 'hidden');
708 // hide review rules
708 // hide review rules
709 reviewersController.hideReviewRules()
709 reviewersController.hideReviewRules()
710 }
710 }
711 };
711 };
712
712
713 PRDetails.init();
713 PRDetails.init();
714 ReviewersPanel.init();
714 ReviewersPanel.init();
715
715
716 showOutdated = function(self){
716 showOutdated = function(self){
717 $('.comment-inline.comment-outdated').show();
717 $('.comment-inline.comment-outdated').show();
718 $('.filediff-outdated').show();
718 $('.filediff-outdated').show();
719 $('.showOutdatedComments').hide();
719 $('.showOutdatedComments').hide();
720 $('.hideOutdatedComments').show();
720 $('.hideOutdatedComments').show();
721 };
721 };
722
722
723 hideOutdated = function(self){
723 hideOutdated = function(self){
724 $('.comment-inline.comment-outdated').hide();
724 $('.comment-inline.comment-outdated').hide();
725 $('.filediff-outdated').hide();
725 $('.filediff-outdated').hide();
726 $('.hideOutdatedComments').hide();
726 $('.hideOutdatedComments').hide();
727 $('.showOutdatedComments').show();
727 $('.showOutdatedComments').show();
728 };
728 };
729
729
730 refreshMergeChecks = function(){
730 refreshMergeChecks = function(){
731 var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
731 var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
732 $('.pull-request-merge').css('opacity', 0.3);
732 $('.pull-request-merge').css('opacity', 0.3);
733 $('.action-buttons-extra').css('opacity', 0.3);
733 $('.action-buttons-extra').css('opacity', 0.3);
734
734
735 $('.pull-request-merge').load(
735 $('.pull-request-merge').load(
736 loadUrl, function() {
736 loadUrl, function() {
737 $('.pull-request-merge').css('opacity', 1);
737 $('.pull-request-merge').css('opacity', 1);
738
738
739 $('.action-buttons-extra').css('opacity', 1);
739 $('.action-buttons-extra').css('opacity', 1);
740 injectCloseAction();
740 injectCloseAction();
741 }
741 }
742 );
742 );
743 };
743 };
744
744
745 injectCloseAction = function() {
745 injectCloseAction = function() {
746 var closeAction = $('#close-pull-request-action').html();
746 var closeAction = $('#close-pull-request-action').html();
747 var $actionButtons = $('.action-buttons-extra');
747 var $actionButtons = $('.action-buttons-extra');
748 // clear the action before
748 // clear the action before
749 $actionButtons.html("");
749 $actionButtons.html("");
750 $actionButtons.html(closeAction);
750 $actionButtons.html(closeAction);
751 };
751 };
752
752
753 closePullRequest = function (status) {
753 closePullRequest = function (status) {
754 // inject closing flag
754 // inject closing flag
755 $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
755 $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
756 $(generalCommentForm.statusChange).select2("val", status).trigger('change');
756 $(generalCommentForm.statusChange).select2("val", status).trigger('change');
757 $(generalCommentForm.submitForm).submit();
757 $(generalCommentForm.submitForm).submit();
758 };
758 };
759
759
760 $('#show-outdated-comments').on('click', function(e){
760 $('#show-outdated-comments').on('click', function(e){
761 var button = $(this);
761 var button = $(this);
762 var outdated = $('.comment-outdated');
762 var outdated = $('.comment-outdated');
763
763
764 if (button.html() === "(Show)") {
764 if (button.html() === "(Show)") {
765 button.html("(Hide)");
765 button.html("(Hide)");
766 outdated.show();
766 outdated.show();
767 } else {
767 } else {
768 button.html("(Show)");
768 button.html("(Show)");
769 outdated.hide();
769 outdated.hide();
770 }
770 }
771 });
771 });
772
772
773 $('.show-inline-comments').on('change', function(e){
773 $('.show-inline-comments').on('change', function(e){
774 var show = 'none';
774 var show = 'none';
775 var target = e.currentTarget;
775 var target = e.currentTarget;
776 if(target.checked){
776 if(target.checked){
777 show = ''
777 show = ''
778 }
778 }
779 var boxid = $(target).attr('id_for');
779 var boxid = $(target).attr('id_for');
780 var comments = $('#{0} .inline-comments'.format(boxid));
780 var comments = $('#{0} .inline-comments'.format(boxid));
781 var fn_display = function(idx){
781 var fn_display = function(idx){
782 $(this).css('display', show);
782 $(this).css('display', show);
783 };
783 };
784 $(comments).each(fn_display);
784 $(comments).each(fn_display);
785 var btns = $('#{0} .inline-comments-button'.format(boxid));
785 var btns = $('#{0} .inline-comments-button'.format(boxid));
786 $(btns).each(fn_display);
786 $(btns).each(fn_display);
787 });
787 });
788
788
789 $('#merge_pull_request_form').submit(function() {
789 $('#merge_pull_request_form').submit(function() {
790 if (!$('#merge_pull_request').attr('disabled')) {
790 if (!$('#merge_pull_request').attr('disabled')) {
791 $('#merge_pull_request').attr('disabled', 'disabled');
791 $('#merge_pull_request').attr('disabled', 'disabled');
792 }
792 }
793 return true;
793 return true;
794 });
794 });
795
795
796 $('#edit_pull_request').on('click', function(e){
796 $('#edit_pull_request').on('click', function(e){
797 var title = $('#pr-title-input').val();
797 var title = $('#pr-title-input').val();
798 var description = codeMirrorInstance.getValue();
798 var description = codeMirrorInstance.getValue();
799 var renderer = $('#pr-renderer-input').val();
799 var renderer = $('#pr-renderer-input').val();
800 editPullRequest(
800 editPullRequest(
801 "${c.repo_name}", "${c.pull_request.pull_request_id}",
801 "${c.repo_name}", "${c.pull_request.pull_request_id}",
802 title, description, renderer);
802 title, description, renderer);
803 });
803 });
804
804
805 $('#update_pull_request').on('click', function(e){
805 $('#update_pull_request').on('click', function(e){
806 $(this).attr('disabled', 'disabled');
806 $(this).attr('disabled', 'disabled');
807 $(this).addClass('disabled');
807 $(this).addClass('disabled');
808 $(this).html(_gettext('Saving...'));
808 $(this).html(_gettext('Saving...'));
809 reviewersController.updateReviewers(
809 reviewersController.updateReviewers(
810 "${c.repo_name}", "${c.pull_request.pull_request_id}");
810 "${c.repo_name}", "${c.pull_request.pull_request_id}");
811 });
811 });
812
812
813 $('#update_commits').on('click', function(e){
813 $('#update_commits').on('click', function(e){
814 var isDisabled = !$(e.currentTarget).attr('disabled');
814 var isDisabled = !$(e.currentTarget).attr('disabled');
815 $(e.currentTarget).attr('disabled', 'disabled');
815 $(e.currentTarget).attr('disabled', 'disabled');
816 $(e.currentTarget).addClass('disabled');
816 $(e.currentTarget).addClass('disabled');
817 $(e.currentTarget).removeClass('btn-primary');
817 $(e.currentTarget).removeClass('btn-primary');
818 $(e.currentTarget).text(_gettext('Updating...'));
818 $(e.currentTarget).text(_gettext('Updating...'));
819 if(isDisabled){
819 if(isDisabled){
820 updateCommits(
820 updateCommits(
821 "${c.repo_name}", "${c.pull_request.pull_request_id}");
821 "${c.repo_name}", "${c.pull_request.pull_request_id}");
822 }
822 }
823 });
823 });
824 // fixing issue with caches on firefox
824 // fixing issue with caches on firefox
825 $('#update_commits').removeAttr("disabled");
825 $('#update_commits').removeAttr("disabled");
826
826
827 $('.show-inline-comments').on('click', function(e){
827 $('.show-inline-comments').on('click', function(e){
828 var boxid = $(this).attr('data-comment-id');
828 var boxid = $(this).attr('data-comment-id');
829 var button = $(this);
829 var button = $(this);
830
830
831 if(button.hasClass("comments-visible")) {
831 if(button.hasClass("comments-visible")) {
832 $('#{0} .inline-comments'.format(boxid)).each(function(index){
832 $('#{0} .inline-comments'.format(boxid)).each(function(index){
833 $(this).hide();
833 $(this).hide();
834 });
834 });
835 button.removeClass("comments-visible");
835 button.removeClass("comments-visible");
836 } else {
836 } else {
837 $('#{0} .inline-comments'.format(boxid)).each(function(index){
837 $('#{0} .inline-comments'.format(boxid)).each(function(index){
838 $(this).show();
838 $(this).show();
839 });
839 });
840 button.addClass("comments-visible");
840 button.addClass("comments-visible");
841 }
841 }
842 });
842 });
843
843
844 // register submit callback on commentForm form to track TODOs
844 // register submit callback on commentForm form to track TODOs
845 window.commentFormGlobalSubmitSuccessCallback = function(){
845 window.commentFormGlobalSubmitSuccessCallback = function(){
846 refreshMergeChecks();
846 refreshMergeChecks();
847 };
847 };
848 // initial injection
848 // initial injection
849 injectCloseAction();
849 injectCloseAction();
850
850
851 ReviewerAutoComplete('#user');
851 ReviewerAutoComplete('#user');
852
852
853 })
853 })
854 </script>
854 </script>
855
855
856 </div>
856 </div>
857 </div>
857 </div>
858
858
859 </%def>
859 </%def>
General Comments 0
You need to be logged in to leave comments. Login now