##// END OF EJS Templates
diffs: support mercurial copy in diffs details.
marcink -
r1582:dcac0725 default
parent child Browse files
Show More
@@ -1,1140 +1,1143 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 .compare_view_files {
21 .compare_view_files {
22
22
23 .diff-container {
23 .diff-container {
24
24
25 .diffblock {
25 .diffblock {
26 margin-bottom: 0;
26 margin-bottom: 0;
27 }
27 }
28 }
28 }
29 }
29 }
30
30
31 div.diffblock .sidebyside {
31 div.diffblock .sidebyside {
32 background: #ffffff;
32 background: #ffffff;
33 }
33 }
34
34
35 div.diffblock {
35 div.diffblock {
36 overflow-x: auto;
36 overflow-x: auto;
37 overflow-y: hidden;
37 overflow-y: hidden;
38 clear: both;
38 clear: both;
39 padding: 0px;
39 padding: 0px;
40 background: @grey6;
40 background: @grey6;
41 border: @border-thickness solid @grey5;
41 border: @border-thickness solid @grey5;
42 -webkit-border-radius: @border-radius @border-radius 0px 0px;
42 -webkit-border-radius: @border-radius @border-radius 0px 0px;
43 border-radius: @border-radius @border-radius 0px 0px;
43 border-radius: @border-radius @border-radius 0px 0px;
44
44
45
45
46 .comments-number {
46 .comments-number {
47 float: right;
47 float: right;
48 }
48 }
49
49
50 // BEGIN CODE-HEADER STYLES
50 // BEGIN CODE-HEADER STYLES
51
51
52 .code-header {
52 .code-header {
53 background: @grey6;
53 background: @grey6;
54 padding: 10px 0 10px 0;
54 padding: 10px 0 10px 0;
55 height: auto;
55 height: auto;
56 width: 100%;
56 width: 100%;
57
57
58 .hash {
58 .hash {
59 float: left;
59 float: left;
60 padding: 2px 0 0 2px;
60 padding: 2px 0 0 2px;
61 }
61 }
62
62
63 .date {
63 .date {
64 float: left;
64 float: left;
65 text-transform: uppercase;
65 text-transform: uppercase;
66 padding: 4px 0px 0px 2px;
66 padding: 4px 0px 0px 2px;
67 }
67 }
68
68
69 div {
69 div {
70 margin-left: 4px;
70 margin-left: 4px;
71 }
71 }
72
72
73 div.compare_header {
73 div.compare_header {
74 min-height: 40px;
74 min-height: 40px;
75 margin: 0;
75 margin: 0;
76 padding: 0 @padding;
76 padding: 0 @padding;
77
77
78 .drop-menu {
78 .drop-menu {
79 float:left;
79 float:left;
80 display: block;
80 display: block;
81 margin:0 0 @padding 0;
81 margin:0 0 @padding 0;
82 }
82 }
83
83
84 .compare-label {
84 .compare-label {
85 float: left;
85 float: left;
86 clear: both;
86 clear: both;
87 display: inline-block;
87 display: inline-block;
88 min-width: 5em;
88 min-width: 5em;
89 margin: 0;
89 margin: 0;
90 padding: @button-padding @button-padding @button-padding 0;
90 padding: @button-padding @button-padding @button-padding 0;
91 font-family: @text-semibold;
91 font-family: @text-semibold;
92 }
92 }
93
93
94 .compare-buttons {
94 .compare-buttons {
95 float: left;
95 float: left;
96 margin: 0;
96 margin: 0;
97 padding: 0 0 @padding;
97 padding: 0 0 @padding;
98
98
99 .btn {
99 .btn {
100 margin: 0 @padding 0 0;
100 margin: 0 @padding 0 0;
101 }
101 }
102 }
102 }
103 }
103 }
104
104
105 }
105 }
106
106
107 .parents {
107 .parents {
108 float: left;
108 float: left;
109 width: 100px;
109 width: 100px;
110 font-weight: 400;
110 font-weight: 400;
111 vertical-align: middle;
111 vertical-align: middle;
112 padding: 0px 2px 0px 2px;
112 padding: 0px 2px 0px 2px;
113 background-color: @grey6;
113 background-color: @grey6;
114
114
115 #parent_link {
115 #parent_link {
116 margin: 00px 2px;
116 margin: 00px 2px;
117
117
118 &.double {
118 &.double {
119 margin: 0px 2px;
119 margin: 0px 2px;
120 }
120 }
121
121
122 &.disabled{
122 &.disabled{
123 margin-right: @padding;
123 margin-right: @padding;
124 }
124 }
125 }
125 }
126 }
126 }
127
127
128 .children {
128 .children {
129 float: right;
129 float: right;
130 width: 100px;
130 width: 100px;
131 font-weight: 400;
131 font-weight: 400;
132 vertical-align: middle;
132 vertical-align: middle;
133 text-align: right;
133 text-align: right;
134 padding: 0px 2px 0px 2px;
134 padding: 0px 2px 0px 2px;
135 background-color: @grey6;
135 background-color: @grey6;
136
136
137 #child_link {
137 #child_link {
138 margin: 0px 2px;
138 margin: 0px 2px;
139
139
140 &.double {
140 &.double {
141 margin: 0px 2px;
141 margin: 0px 2px;
142 }
142 }
143
143
144 &.disabled{
144 &.disabled{
145 margin-right: @padding;
145 margin-right: @padding;
146 }
146 }
147 }
147 }
148 }
148 }
149
149
150 .changeset_header {
150 .changeset_header {
151 height: 16px;
151 height: 16px;
152
152
153 & > div{
153 & > div{
154 margin-right: @padding;
154 margin-right: @padding;
155 }
155 }
156 }
156 }
157
157
158 .changeset_file {
158 .changeset_file {
159 text-align: left;
159 text-align: left;
160 float: left;
160 float: left;
161 padding: 0;
161 padding: 0;
162
162
163 a{
163 a{
164 display: inline-block;
164 display: inline-block;
165 margin-right: 0.5em;
165 margin-right: 0.5em;
166 }
166 }
167
167
168 #selected_mode{
168 #selected_mode{
169 margin-left: 0;
169 margin-left: 0;
170 }
170 }
171 }
171 }
172
172
173 .diff-menu-wrapper {
173 .diff-menu-wrapper {
174 float: left;
174 float: left;
175 }
175 }
176
176
177 .diff-menu {
177 .diff-menu {
178 position: absolute;
178 position: absolute;
179 background: none repeat scroll 0 0 #FFFFFF;
179 background: none repeat scroll 0 0 #FFFFFF;
180 border-color: #003367 @grey3 @grey3;
180 border-color: #003367 @grey3 @grey3;
181 border-right: 1px solid @grey3;
181 border-right: 1px solid @grey3;
182 border-style: solid solid solid;
182 border-style: solid solid solid;
183 border-width: @border-thickness;
183 border-width: @border-thickness;
184 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
184 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
185 margin-top: 5px;
185 margin-top: 5px;
186 margin-left: 1px;
186 margin-left: 1px;
187 }
187 }
188
188
189 .diff-actions, .editor-actions {
189 .diff-actions, .editor-actions {
190 float: left;
190 float: left;
191
191
192 input{
192 input{
193 margin: 0 0.5em 0 0;
193 margin: 0 0.5em 0 0;
194 }
194 }
195 }
195 }
196
196
197 // END CODE-HEADER STYLES
197 // END CODE-HEADER STYLES
198
198
199 // BEGIN CODE-BODY STYLES
199 // BEGIN CODE-BODY STYLES
200
200
201 .code-body {
201 .code-body {
202 padding: 0;
202 padding: 0;
203 background-color: #ffffff;
203 background-color: #ffffff;
204 position: relative;
204 position: relative;
205 max-width: none;
205 max-width: none;
206 box-sizing: border-box;
206 box-sizing: border-box;
207 // TODO: johbo: Parent has overflow: auto, this forces the child here
207 // TODO: johbo: Parent has overflow: auto, this forces the child here
208 // to have the intended size and to scroll. Should be simplified.
208 // to have the intended size and to scroll. Should be simplified.
209 width: 100%;
209 width: 100%;
210 overflow-x: auto;
210 overflow-x: auto;
211 }
211 }
212
212
213 pre.raw {
213 pre.raw {
214 background: white;
214 background: white;
215 color: @grey1;
215 color: @grey1;
216 }
216 }
217 // END CODE-BODY STYLES
217 // END CODE-BODY STYLES
218
218
219 }
219 }
220
220
221
221
222 table.code-difftable {
222 table.code-difftable {
223 border-collapse: collapse;
223 border-collapse: collapse;
224 width: 99%;
224 width: 99%;
225 border-radius: 0px !important;
225 border-radius: 0px !important;
226
226
227 td {
227 td {
228 padding: 0 !important;
228 padding: 0 !important;
229 background: none !important;
229 background: none !important;
230 border: 0 !important;
230 border: 0 !important;
231 }
231 }
232
232
233 .context {
233 .context {
234 background: none repeat scroll 0 0 #DDE7EF;
234 background: none repeat scroll 0 0 #DDE7EF;
235 }
235 }
236
236
237 .add {
237 .add {
238 background: none repeat scroll 0 0 #DDFFDD;
238 background: none repeat scroll 0 0 #DDFFDD;
239
239
240 ins {
240 ins {
241 background: none repeat scroll 0 0 #AAFFAA;
241 background: none repeat scroll 0 0 #AAFFAA;
242 text-decoration: none;
242 text-decoration: none;
243 }
243 }
244 }
244 }
245
245
246 .del {
246 .del {
247 background: none repeat scroll 0 0 #FFDDDD;
247 background: none repeat scroll 0 0 #FFDDDD;
248
248
249 del {
249 del {
250 background: none repeat scroll 0 0 #FFAAAA;
250 background: none repeat scroll 0 0 #FFAAAA;
251 text-decoration: none;
251 text-decoration: none;
252 }
252 }
253 }
253 }
254
254
255 /** LINE NUMBERS **/
255 /** LINE NUMBERS **/
256 .lineno {
256 .lineno {
257 padding-left: 2px !important;
257 padding-left: 2px !important;
258 padding-right: 2px;
258 padding-right: 2px;
259 text-align: right;
259 text-align: right;
260 width: 32px;
260 width: 32px;
261 -moz-user-select: none;
261 -moz-user-select: none;
262 -webkit-user-select: none;
262 -webkit-user-select: none;
263 border-right: @border-thickness solid @grey5 !important;
263 border-right: @border-thickness solid @grey5 !important;
264 border-left: 0px solid #CCC !important;
264 border-left: 0px solid #CCC !important;
265 border-top: 0px solid #CCC !important;
265 border-top: 0px solid #CCC !important;
266 border-bottom: none !important;
266 border-bottom: none !important;
267
267
268 a {
268 a {
269 &:extend(pre);
269 &:extend(pre);
270 text-align: right;
270 text-align: right;
271 padding-right: 2px;
271 padding-right: 2px;
272 cursor: pointer;
272 cursor: pointer;
273 display: block;
273 display: block;
274 width: 32px;
274 width: 32px;
275 }
275 }
276 }
276 }
277
277
278 .context {
278 .context {
279 cursor: auto;
279 cursor: auto;
280 &:extend(pre);
280 &:extend(pre);
281 }
281 }
282
282
283 .lineno-inline {
283 .lineno-inline {
284 background: none repeat scroll 0 0 #FFF !important;
284 background: none repeat scroll 0 0 #FFF !important;
285 padding-left: 2px;
285 padding-left: 2px;
286 padding-right: 2px;
286 padding-right: 2px;
287 text-align: right;
287 text-align: right;
288 width: 30px;
288 width: 30px;
289 -moz-user-select: none;
289 -moz-user-select: none;
290 -webkit-user-select: none;
290 -webkit-user-select: none;
291 }
291 }
292
292
293 /** CODE **/
293 /** CODE **/
294 .code {
294 .code {
295 display: block;
295 display: block;
296 width: 100%;
296 width: 100%;
297
297
298 td {
298 td {
299 margin: 0;
299 margin: 0;
300 padding: 0;
300 padding: 0;
301 }
301 }
302
302
303 pre {
303 pre {
304 margin: 0;
304 margin: 0;
305 padding: 0;
305 padding: 0;
306 margin-left: .5em;
306 margin-left: .5em;
307 }
307 }
308 }
308 }
309 }
309 }
310
310
311
311
312 // Comments
312 // Comments
313
313
314 div.comment:target {
314 div.comment:target {
315 border-left: 6px solid @comment-highlight-color !important;
315 border-left: 6px solid @comment-highlight-color !important;
316 padding-left: 3px;
316 padding-left: 3px;
317 margin-left: -9px;
317 margin-left: -9px;
318 }
318 }
319
319
320 //TODO: anderson: can't get an absolute number out of anything, so had to put the
320 //TODO: anderson: can't get an absolute number out of anything, so had to put the
321 //current values that might change. But to make it clear I put as a calculation
321 //current values that might change. But to make it clear I put as a calculation
322 @comment-max-width: 1065px;
322 @comment-max-width: 1065px;
323 @pr-extra-margin: 34px;
323 @pr-extra-margin: 34px;
324 @pr-border-spacing: 4px;
324 @pr-border-spacing: 4px;
325 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
325 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
326
326
327 // Pull Request
327 // Pull Request
328 .cs_files .code-difftable {
328 .cs_files .code-difftable {
329 border: @border-thickness solid @grey5; //borders only on PRs
329 border: @border-thickness solid @grey5; //borders only on PRs
330
330
331 .comment-inline-form,
331 .comment-inline-form,
332 div.comment {
332 div.comment {
333 width: @pr-comment-width;
333 width: @pr-comment-width;
334 }
334 }
335 }
335 }
336
336
337 // Changeset
337 // Changeset
338 .code-difftable {
338 .code-difftable {
339 .comment-inline-form,
339 .comment-inline-form,
340 div.comment {
340 div.comment {
341 width: @comment-max-width;
341 width: @comment-max-width;
342 }
342 }
343 }
343 }
344
344
345 //Style page
345 //Style page
346 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
346 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
347 #style-page .code-difftable{
347 #style-page .code-difftable{
348 .comment-inline-form,
348 .comment-inline-form,
349 div.comment {
349 div.comment {
350 width: @comment-max-width - @style-extra-margin;
350 width: @comment-max-width - @style-extra-margin;
351 }
351 }
352 }
352 }
353
353
354 #context-bar > h2 {
354 #context-bar > h2 {
355 font-size: 20px;
355 font-size: 20px;
356 }
356 }
357
357
358 #context-bar > h2> a {
358 #context-bar > h2> a {
359 font-size: 20px;
359 font-size: 20px;
360 }
360 }
361 // end of defaults
361 // end of defaults
362
362
363 .file_diff_buttons {
363 .file_diff_buttons {
364 padding: 0 0 @padding;
364 padding: 0 0 @padding;
365
365
366 .drop-menu {
366 .drop-menu {
367 float: left;
367 float: left;
368 margin: 0 @padding 0 0;
368 margin: 0 @padding 0 0;
369 }
369 }
370 .btn {
370 .btn {
371 margin: 0 @padding 0 0;
371 margin: 0 @padding 0 0;
372 }
372 }
373 }
373 }
374
374
375 .code-body.textarea.editor {
375 .code-body.textarea.editor {
376 max-width: none;
376 max-width: none;
377 padding: 15px;
377 padding: 15px;
378 }
378 }
379
379
380 td.injected_diff{
380 td.injected_diff{
381 max-width: 1178px;
381 max-width: 1178px;
382 overflow-x: auto;
382 overflow-x: auto;
383 overflow-y: hidden;
383 overflow-y: hidden;
384
384
385 div.diff-container,
385 div.diff-container,
386 div.diffblock{
386 div.diffblock{
387 max-width: 100%;
387 max-width: 100%;
388 }
388 }
389
389
390 div.code-body {
390 div.code-body {
391 max-width: 1124px;
391 max-width: 1124px;
392 overflow-x: auto;
392 overflow-x: auto;
393 overflow-y: hidden;
393 overflow-y: hidden;
394 padding: 0;
394 padding: 0;
395 }
395 }
396 div.diffblock {
396 div.diffblock {
397 border: none;
397 border: none;
398 }
398 }
399
399
400 &.inline-form {
400 &.inline-form {
401 width: 99%
401 width: 99%
402 }
402 }
403 }
403 }
404
404
405
405
406 table.code-difftable {
406 table.code-difftable {
407 width: 100%;
407 width: 100%;
408 }
408 }
409
409
410 /** PYGMENTS COLORING **/
410 /** PYGMENTS COLORING **/
411 div.codeblock {
411 div.codeblock {
412
412
413 // TODO: johbo: Added interim to get rid of the margin around
413 // TODO: johbo: Added interim to get rid of the margin around
414 // Select2 widgets. This needs further cleanup.
414 // Select2 widgets. This needs further cleanup.
415 margin-top: @padding;
415 margin-top: @padding;
416
416
417 overflow: auto;
417 overflow: auto;
418 padding: 0px;
418 padding: 0px;
419 border: @border-thickness solid @grey5;
419 border: @border-thickness solid @grey5;
420 background: @grey6;
420 background: @grey6;
421 .border-radius(@border-radius);
421 .border-radius(@border-radius);
422
422
423 #remove_gist {
423 #remove_gist {
424 float: right;
424 float: right;
425 }
425 }
426
426
427 .author {
427 .author {
428 clear: both;
428 clear: both;
429 vertical-align: middle;
429 vertical-align: middle;
430 font-family: @text-bold;
430 font-family: @text-bold;
431 }
431 }
432
432
433 .btn-mini {
433 .btn-mini {
434 float: left;
434 float: left;
435 margin: 0 5px 0 0;
435 margin: 0 5px 0 0;
436 }
436 }
437
437
438 .code-header {
438 .code-header {
439 padding: @padding;
439 padding: @padding;
440 border-bottom: @border-thickness solid @grey5;
440 border-bottom: @border-thickness solid @grey5;
441
441
442 .rc-user {
442 .rc-user {
443 min-width: 0;
443 min-width: 0;
444 margin-right: .5em;
444 margin-right: .5em;
445 }
445 }
446
446
447 .stats {
447 .stats {
448 clear: both;
448 clear: both;
449 margin: 0 0 @padding 0;
449 margin: 0 0 @padding 0;
450 padding: 0;
450 padding: 0;
451 .left {
451 .left {
452 float: left;
452 float: left;
453 clear: left;
453 clear: left;
454 max-width: 75%;
454 max-width: 75%;
455 margin: 0 0 @padding 0;
455 margin: 0 0 @padding 0;
456
456
457 &.item {
457 &.item {
458 margin-right: @padding;
458 margin-right: @padding;
459 &.last { border-right: none; }
459 &.last { border-right: none; }
460 }
460 }
461 }
461 }
462 .buttons { float: right; }
462 .buttons { float: right; }
463 .author {
463 .author {
464 height: 25px; margin-left: 15px; font-weight: bold;
464 height: 25px; margin-left: 15px; font-weight: bold;
465 }
465 }
466 }
466 }
467
467
468 .commit {
468 .commit {
469 margin: 5px 0 0 26px;
469 margin: 5px 0 0 26px;
470 font-weight: normal;
470 font-weight: normal;
471 white-space: pre-wrap;
471 white-space: pre-wrap;
472 }
472 }
473 }
473 }
474
474
475 .message {
475 .message {
476 position: relative;
476 position: relative;
477 margin: @padding;
477 margin: @padding;
478
478
479 .codeblock-label {
479 .codeblock-label {
480 margin: 0 0 1em 0;
480 margin: 0 0 1em 0;
481 }
481 }
482 }
482 }
483
483
484 .code-body {
484 .code-body {
485 padding: @padding;
485 padding: @padding;
486 background-color: #ffffff;
486 background-color: #ffffff;
487 min-width: 100%;
487 min-width: 100%;
488 box-sizing: border-box;
488 box-sizing: border-box;
489 // TODO: johbo: Parent has overflow: auto, this forces the child here
489 // TODO: johbo: Parent has overflow: auto, this forces the child here
490 // to have the intended size and to scroll. Should be simplified.
490 // to have the intended size and to scroll. Should be simplified.
491 width: 100%;
491 width: 100%;
492 overflow-x: auto;
492 overflow-x: auto;
493
493
494 img.rendered-binary {
494 img.rendered-binary {
495 height: auto;
495 height: auto;
496 width: 100%;
496 width: 100%;
497 }
497 }
498 }
498 }
499 }
499 }
500
500
501 .code-highlighttable,
501 .code-highlighttable,
502 div.codeblock {
502 div.codeblock {
503
503
504 &.readme {
504 &.readme {
505 background-color: white;
505 background-color: white;
506 }
506 }
507
507
508 .markdown-block table {
508 .markdown-block table {
509 border-collapse: collapse;
509 border-collapse: collapse;
510
510
511 th,
511 th,
512 td {
512 td {
513 padding: .5em;
513 padding: .5em;
514 border: @border-thickness solid @border-default-color;
514 border: @border-thickness solid @border-default-color;
515 }
515 }
516 }
516 }
517
517
518 table {
518 table {
519 border: 0px;
519 border: 0px;
520 margin: 0;
520 margin: 0;
521 letter-spacing: normal;
521 letter-spacing: normal;
522
522
523
523
524 td {
524 td {
525 border: 0px;
525 border: 0px;
526 vertical-align: top;
526 vertical-align: top;
527 }
527 }
528 }
528 }
529 }
529 }
530
530
531 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
531 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
532 div.search-code-body {
532 div.search-code-body {
533 background-color: #ffffff; padding: 5px 0 5px 10px;
533 background-color: #ffffff; padding: 5px 0 5px 10px;
534 pre {
534 pre {
535 .match { background-color: #faffa6;}
535 .match { background-color: #faffa6;}
536 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
536 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
537 }
537 }
538 .code-highlighttable {
538 .code-highlighttable {
539 border-collapse: collapse;
539 border-collapse: collapse;
540
540
541 tr:hover {
541 tr:hover {
542 background: #fafafa;
542 background: #fafafa;
543 }
543 }
544 td.code {
544 td.code {
545 padding-left: 10px;
545 padding-left: 10px;
546 }
546 }
547 td.line {
547 td.line {
548 border-right: 1px solid #ccc !important;
548 border-right: 1px solid #ccc !important;
549 padding-right: 10px;
549 padding-right: 10px;
550 text-align: right;
550 text-align: right;
551 font-family: "Lucida Console",Monaco,monospace;
551 font-family: "Lucida Console",Monaco,monospace;
552 span {
552 span {
553 white-space: pre-wrap;
553 white-space: pre-wrap;
554 color: #666666;
554 color: #666666;
555 }
555 }
556 }
556 }
557 }
557 }
558 }
558 }
559
559
560 div.annotatediv { margin-left: 2px; margin-right: 4px; }
560 div.annotatediv { margin-left: 2px; margin-right: 4px; }
561 .code-highlight {
561 .code-highlight {
562 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
562 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
563 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
563 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
564 pre div:target {background-color: @comment-highlight-color !important;}
564 pre div:target {background-color: @comment-highlight-color !important;}
565 }
565 }
566
566
567 .linenos a { text-decoration: none; }
567 .linenos a { text-decoration: none; }
568
568
569 .CodeMirror-selected { background: @rchighlightblue; }
569 .CodeMirror-selected { background: @rchighlightblue; }
570 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
570 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
571 .CodeMirror ::selection { background: @rchighlightblue; }
571 .CodeMirror ::selection { background: @rchighlightblue; }
572 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
572 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
573
573
574 .code { display: block; border:0px !important; }
574 .code { display: block; border:0px !important; }
575 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
575 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
576 .codehilite {
576 .codehilite {
577 .hll { background-color: #ffffcc }
577 .hll { background-color: #ffffcc }
578 .c { color: #408080; font-style: italic } /* Comment */
578 .c { color: #408080; font-style: italic } /* Comment */
579 .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */
579 .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */
580 .k { color: #008000; font-weight: bold } /* Keyword */
580 .k { color: #008000; font-weight: bold } /* Keyword */
581 .o { color: #666666 } /* Operator */
581 .o { color: #666666 } /* Operator */
582 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
582 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
583 .cp { color: #BC7A00 } /* Comment.Preproc */
583 .cp { color: #BC7A00 } /* Comment.Preproc */
584 .c1 { color: #408080; font-style: italic } /* Comment.Single */
584 .c1 { color: #408080; font-style: italic } /* Comment.Single */
585 .cs { color: #408080; font-style: italic } /* Comment.Special */
585 .cs { color: #408080; font-style: italic } /* Comment.Special */
586 .gd { color: #A00000 } /* Generic.Deleted */
586 .gd { color: #A00000 } /* Generic.Deleted */
587 .ge { font-style: italic } /* Generic.Emph */
587 .ge { font-style: italic } /* Generic.Emph */
588 .gr { color: #FF0000 } /* Generic.Error */
588 .gr { color: #FF0000 } /* Generic.Error */
589 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
589 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
590 .gi { color: #00A000 } /* Generic.Inserted */
590 .gi { color: #00A000 } /* Generic.Inserted */
591 .go { color: #808080 } /* Generic.Output */
591 .go { color: #808080 } /* Generic.Output */
592 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
592 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
593 .gs { font-weight: bold } /* Generic.Strong */
593 .gs { font-weight: bold } /* Generic.Strong */
594 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
594 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
595 .gt { color: #0040D0 } /* Generic.Traceback */
595 .gt { color: #0040D0 } /* Generic.Traceback */
596 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
596 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
597 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
597 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
598 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
598 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
599 .kp { color: #008000 } /* Keyword.Pseudo */
599 .kp { color: #008000 } /* Keyword.Pseudo */
600 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
600 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
601 .kt { color: #B00040 } /* Keyword.Type */
601 .kt { color: #B00040 } /* Keyword.Type */
602 .m { color: #666666 } /* Literal.Number */
602 .m { color: #666666 } /* Literal.Number */
603 .s { color: #BA2121 } /* Literal.String */
603 .s { color: #BA2121 } /* Literal.String */
604 .na { color: #7D9029 } /* Name.Attribute */
604 .na { color: #7D9029 } /* Name.Attribute */
605 .nb { color: #008000 } /* Name.Builtin */
605 .nb { color: #008000 } /* Name.Builtin */
606 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
606 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
607 .no { color: #880000 } /* Name.Constant */
607 .no { color: #880000 } /* Name.Constant */
608 .nd { color: #AA22FF } /* Name.Decorator */
608 .nd { color: #AA22FF } /* Name.Decorator */
609 .ni { color: #999999; font-weight: bold } /* Name.Entity */
609 .ni { color: #999999; font-weight: bold } /* Name.Entity */
610 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
610 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
611 .nf { color: #0000FF } /* Name.Function */
611 .nf { color: #0000FF } /* Name.Function */
612 .nl { color: #A0A000 } /* Name.Label */
612 .nl { color: #A0A000 } /* Name.Label */
613 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
613 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
614 .nt { color: #008000; font-weight: bold } /* Name.Tag */
614 .nt { color: #008000; font-weight: bold } /* Name.Tag */
615 .nv { color: #19177C } /* Name.Variable */
615 .nv { color: #19177C } /* Name.Variable */
616 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
616 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
617 .w { color: #bbbbbb } /* Text.Whitespace */
617 .w { color: #bbbbbb } /* Text.Whitespace */
618 .mf { color: #666666 } /* Literal.Number.Float */
618 .mf { color: #666666 } /* Literal.Number.Float */
619 .mh { color: #666666 } /* Literal.Number.Hex */
619 .mh { color: #666666 } /* Literal.Number.Hex */
620 .mi { color: #666666 } /* Literal.Number.Integer */
620 .mi { color: #666666 } /* Literal.Number.Integer */
621 .mo { color: #666666 } /* Literal.Number.Oct */
621 .mo { color: #666666 } /* Literal.Number.Oct */
622 .sb { color: #BA2121 } /* Literal.String.Backtick */
622 .sb { color: #BA2121 } /* Literal.String.Backtick */
623 .sc { color: #BA2121 } /* Literal.String.Char */
623 .sc { color: #BA2121 } /* Literal.String.Char */
624 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
624 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
625 .s2 { color: #BA2121 } /* Literal.String.Double */
625 .s2 { color: #BA2121 } /* Literal.String.Double */
626 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
626 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
627 .sh { color: #BA2121 } /* Literal.String.Heredoc */
627 .sh { color: #BA2121 } /* Literal.String.Heredoc */
628 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
628 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
629 .sx { color: #008000 } /* Literal.String.Other */
629 .sx { color: #008000 } /* Literal.String.Other */
630 .sr { color: #BB6688 } /* Literal.String.Regex */
630 .sr { color: #BB6688 } /* Literal.String.Regex */
631 .s1 { color: #BA2121 } /* Literal.String.Single */
631 .s1 { color: #BA2121 } /* Literal.String.Single */
632 .ss { color: #19177C } /* Literal.String.Symbol */
632 .ss { color: #19177C } /* Literal.String.Symbol */
633 .bp { color: #008000 } /* Name.Builtin.Pseudo */
633 .bp { color: #008000 } /* Name.Builtin.Pseudo */
634 .vc { color: #19177C } /* Name.Variable.Class */
634 .vc { color: #19177C } /* Name.Variable.Class */
635 .vg { color: #19177C } /* Name.Variable.Global */
635 .vg { color: #19177C } /* Name.Variable.Global */
636 .vi { color: #19177C } /* Name.Variable.Instance */
636 .vi { color: #19177C } /* Name.Variable.Instance */
637 .il { color: #666666 } /* Literal.Number.Integer.Long */
637 .il { color: #666666 } /* Literal.Number.Integer.Long */
638 }
638 }
639
639
640 /* customized pre blocks for markdown/rst */
640 /* customized pre blocks for markdown/rst */
641 pre.literal-block, .codehilite pre{
641 pre.literal-block, .codehilite pre{
642 padding: @padding;
642 padding: @padding;
643 border: 1px solid @grey6;
643 border: 1px solid @grey6;
644 .border-radius(@border-radius);
644 .border-radius(@border-radius);
645 background-color: @grey7;
645 background-color: @grey7;
646 }
646 }
647
647
648
648
649 /* START NEW CODE BLOCK CSS */
649 /* START NEW CODE BLOCK CSS */
650
650
651 @cb-line-height: 18px;
651 @cb-line-height: 18px;
652 @cb-line-code-padding: 10px;
652 @cb-line-code-padding: 10px;
653 @cb-text-padding: 5px;
653 @cb-text-padding: 5px;
654
654
655 @pill-padding: 2px 7px;
655 @pill-padding: 2px 7px;
656
656
657 input.filediff-collapse-state {
657 input.filediff-collapse-state {
658 display: none;
658 display: none;
659
659
660 &:checked + .filediff { /* file diff is collapsed */
660 &:checked + .filediff { /* file diff is collapsed */
661 .cb {
661 .cb {
662 display: none
662 display: none
663 }
663 }
664 .filediff-collapse-indicator {
664 .filediff-collapse-indicator {
665 width: 0;
665 width: 0;
666 height: 0;
666 height: 0;
667 border-style: solid;
667 border-style: solid;
668 border-width: 6.5px 0 6.5px 11.3px;
668 border-width: 6.5px 0 6.5px 11.3px;
669 border-color: transparent transparent transparent #ccc;
669 border-color: transparent transparent transparent #ccc;
670 }
670 }
671 .filediff-menu {
671 .filediff-menu {
672 display: none;
672 display: none;
673 }
673 }
674 margin: 10px 0 0 0;
674 margin: 10px 0 0 0;
675 }
675 }
676
676
677 &+ .filediff { /* file diff is expanded */
677 &+ .filediff { /* file diff is expanded */
678 .filediff-collapse-indicator {
678 .filediff-collapse-indicator {
679 width: 0;
679 width: 0;
680 height: 0;
680 height: 0;
681 border-style: solid;
681 border-style: solid;
682 border-width: 11.3px 6.5px 0 6.5px;
682 border-width: 11.3px 6.5px 0 6.5px;
683 border-color: #ccc transparent transparent transparent;
683 border-color: #ccc transparent transparent transparent;
684 }
684 }
685 .filediff-menu {
685 .filediff-menu {
686 display: block;
686 display: block;
687 }
687 }
688 margin: 10px 0;
688 margin: 10px 0;
689 &:nth-child(2) {
689 &:nth-child(2) {
690 margin: 0;
690 margin: 0;
691 }
691 }
692 }
692 }
693 }
693 }
694 .cs_files {
694 .cs_files {
695 clear: both;
695 clear: both;
696 }
696 }
697
697
698 .diffset-menu {
698 .diffset-menu {
699 margin-bottom: 20px;
699 margin-bottom: 20px;
700 }
700 }
701 .diffset {
701 .diffset {
702 margin: 20px auto;
702 margin: 20px auto;
703 .diffset-heading {
703 .diffset-heading {
704 border: 1px solid @grey5;
704 border: 1px solid @grey5;
705 margin-bottom: -1px;
705 margin-bottom: -1px;
706 // margin-top: 20px;
706 // margin-top: 20px;
707 h2 {
707 h2 {
708 margin: 0;
708 margin: 0;
709 line-height: 38px;
709 line-height: 38px;
710 padding-left: 10px;
710 padding-left: 10px;
711 }
711 }
712 .btn {
712 .btn {
713 margin: 0;
713 margin: 0;
714 }
714 }
715 background: @grey6;
715 background: @grey6;
716 display: block;
716 display: block;
717 padding: 5px;
717 padding: 5px;
718 }
718 }
719 .diffset-heading-warning {
719 .diffset-heading-warning {
720 background: @alert3-inner;
720 background: @alert3-inner;
721 border: 1px solid @alert3;
721 border: 1px solid @alert3;
722 }
722 }
723 &.diffset-comments-disabled {
723 &.diffset-comments-disabled {
724 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
724 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
725 display: none !important;
725 display: none !important;
726 }
726 }
727 }
727 }
728 }
728 }
729
729
730 .pill {
730 .pill {
731 display: block;
731 display: block;
732 float: left;
732 float: left;
733 padding: @pill-padding;
733 padding: @pill-padding;
734 }
734 }
735 .pill-group {
735 .pill-group {
736 .pill {
736 .pill {
737 opacity: .8;
737 opacity: .8;
738 &:first-child {
738 &:first-child {
739 border-radius: @border-radius 0 0 @border-radius;
739 border-radius: @border-radius 0 0 @border-radius;
740 }
740 }
741 &:last-child {
741 &:last-child {
742 border-radius: 0 @border-radius @border-radius 0;
742 border-radius: 0 @border-radius @border-radius 0;
743 }
743 }
744 &:only-child {
744 &:only-child {
745 border-radius: @border-radius;
745 border-radius: @border-radius;
746 }
746 }
747 }
747 }
748 }
748 }
749
749
750 /* Main comments*/
750 /* Main comments*/
751 #comments {
751 #comments {
752 .comment-selected {
752 .comment-selected {
753 border-left: 6px solid @comment-highlight-color;
753 border-left: 6px solid @comment-highlight-color;
754 padding-left: 3px;
754 padding-left: 3px;
755 margin-left: -9px;
755 margin-left: -9px;
756 }
756 }
757 }
757 }
758
758
759 .filediff {
759 .filediff {
760 border: 1px solid @grey5;
760 border: 1px solid @grey5;
761
761
762 /* START OVERRIDES */
762 /* START OVERRIDES */
763 .code-highlight {
763 .code-highlight {
764 border: none; // TODO: remove this border from the global
764 border: none; // TODO: remove this border from the global
765 // .code-highlight, it doesn't belong there
765 // .code-highlight, it doesn't belong there
766 }
766 }
767 label {
767 label {
768 margin: 0; // TODO: remove this margin definition from global label
768 margin: 0; // TODO: remove this margin definition from global label
769 // it doesn't belong there - if margin on labels
769 // it doesn't belong there - if margin on labels
770 // are needed for a form they should be defined
770 // are needed for a form they should be defined
771 // in the form's class
771 // in the form's class
772 }
772 }
773 /* END OVERRIDES */
773 /* END OVERRIDES */
774
774
775 * {
775 * {
776 box-sizing: border-box;
776 box-sizing: border-box;
777 }
777 }
778 .filediff-anchor {
778 .filediff-anchor {
779 visibility: hidden;
779 visibility: hidden;
780 }
780 }
781 &:hover {
781 &:hover {
782 .filediff-anchor {
782 .filediff-anchor {
783 visibility: visible;
783 visibility: visible;
784 }
784 }
785 }
785 }
786
786
787 .filediff-collapse-indicator {
787 .filediff-collapse-indicator {
788 border-style: solid;
788 border-style: solid;
789 float: left;
789 float: left;
790 margin: 4px 0px 0 0;
790 margin: 4px 0px 0 0;
791 cursor: pointer;
791 cursor: pointer;
792 }
792 }
793
793
794 .filediff-heading {
794 .filediff-heading {
795 background: @grey7;
795 background: @grey7;
796 cursor: pointer;
796 cursor: pointer;
797 display: block;
797 display: block;
798 padding: 5px 10px;
798 padding: 5px 10px;
799 }
799 }
800 .filediff-heading:after {
800 .filediff-heading:after {
801 content: "";
801 content: "";
802 display: table;
802 display: table;
803 clear: both;
803 clear: both;
804 }
804 }
805 .filediff-heading:hover {
805 .filediff-heading:hover {
806 background: #e1e9f4 !important;
806 background: #e1e9f4 !important;
807 }
807 }
808
808
809 .filediff-menu {
809 .filediff-menu {
810 float: right;
810 float: right;
811 text-align: right;
811 text-align: right;
812 padding: 5px 5px 5px 0px;
812 padding: 5px 5px 5px 0px;
813
813
814 &> a,
814 &> a,
815 &> span {
815 &> span {
816 padding: 1px;
816 padding: 1px;
817 }
817 }
818 }
818 }
819
819
820 .pill {
820 .pill {
821 &[op="name"] {
821 &[op="name"] {
822 background: none;
822 background: none;
823 color: @grey2;
824 opacity: 1;
823 opacity: 1;
825 color: white;
824 color: white;
826 }
825 }
827 &[op="limited"] {
826 &[op="limited"] {
828 background: @grey2;
827 background: @grey2;
829 color: white;
828 color: white;
830 }
829 }
831 &[op="binary"] {
830 &[op="binary"] {
832 background: @color7;
831 background: @color7;
833 color: white;
832 color: white;
834 }
833 }
835 &[op="modified"] {
834 &[op="modified"] {
836 background: @alert1;
835 background: @alert1;
837 color: white;
836 color: white;
838 }
837 }
839 &[op="renamed"] {
838 &[op="renamed"] {
840 background: @color4;
839 background: @color4;
841 color: white;
840 color: white;
842 }
841 }
842 &[op="copied"] {
843 background: @color4;
844 color: white;
845 }
843 &[op="mode"] {
846 &[op="mode"] {
844 background: @grey3;
847 background: @grey3;
845 color: white;
848 color: white;
846 }
849 }
847 &[op="symlink"] {
850 &[op="symlink"] {
848 background: @color8;
851 background: @color8;
849 color: white;
852 color: white;
850 }
853 }
851
854
852 &[op="added"] { /* added lines */
855 &[op="added"] { /* added lines */
853 background: @alert1;
856 background: @alert1;
854 color: white;
857 color: white;
855 }
858 }
856 &[op="deleted"] { /* deleted lines */
859 &[op="deleted"] { /* deleted lines */
857 background: @alert2;
860 background: @alert2;
858 color: white;
861 color: white;
859 }
862 }
860
863
861 &[op="created"] { /* created file */
864 &[op="created"] { /* created file */
862 background: @alert1;
865 background: @alert1;
863 color: white;
866 color: white;
864 }
867 }
865 &[op="removed"] { /* deleted file */
868 &[op="removed"] { /* deleted file */
866 background: @color5;
869 background: @color5;
867 color: white;
870 color: white;
868 }
871 }
869 }
872 }
870
873
871 .filediff-collapse-button, .filediff-expand-button {
874 .filediff-collapse-button, .filediff-expand-button {
872 cursor: pointer;
875 cursor: pointer;
873 }
876 }
874 .filediff-collapse-button {
877 .filediff-collapse-button {
875 display: inline;
878 display: inline;
876 }
879 }
877 .filediff-expand-button {
880 .filediff-expand-button {
878 display: none;
881 display: none;
879 }
882 }
880 .filediff-collapsed .filediff-collapse-button {
883 .filediff-collapsed .filediff-collapse-button {
881 display: none;
884 display: none;
882 }
885 }
883 .filediff-collapsed .filediff-expand-button {
886 .filediff-collapsed .filediff-expand-button {
884 display: inline;
887 display: inline;
885 }
888 }
886
889
887 /**** COMMENTS ****/
890 /**** COMMENTS ****/
888
891
889 .filediff-menu {
892 .filediff-menu {
890 .show-comment-button {
893 .show-comment-button {
891 display: none;
894 display: none;
892 }
895 }
893 }
896 }
894 &.hide-comments {
897 &.hide-comments {
895 .inline-comments {
898 .inline-comments {
896 display: none;
899 display: none;
897 }
900 }
898 .filediff-menu {
901 .filediff-menu {
899 .show-comment-button {
902 .show-comment-button {
900 display: inline;
903 display: inline;
901 }
904 }
902 .hide-comment-button {
905 .hide-comment-button {
903 display: none;
906 display: none;
904 }
907 }
905 }
908 }
906 }
909 }
907
910
908 .hide-line-comments {
911 .hide-line-comments {
909 .inline-comments {
912 .inline-comments {
910 display: none;
913 display: none;
911 }
914 }
912 }
915 }
913
916
914 /**** END COMMENTS ****/
917 /**** END COMMENTS ****/
915
918
916 }
919 }
917
920
918 .filediff-outdated {
921 .filediff-outdated {
919 padding: 8px 0;
922 padding: 8px 0;
920
923
921 .filediff-heading {
924 .filediff-heading {
922 opacity: .5;
925 opacity: .5;
923 }
926 }
924 }
927 }
925
928
926 table.cb {
929 table.cb {
927 width: 100%;
930 width: 100%;
928 border-collapse: collapse;
931 border-collapse: collapse;
929
932
930 .cb-text {
933 .cb-text {
931 padding: @cb-text-padding;
934 padding: @cb-text-padding;
932 }
935 }
933 .cb-hunk {
936 .cb-hunk {
934 padding: @cb-text-padding;
937 padding: @cb-text-padding;
935 }
938 }
936 .cb-expand {
939 .cb-expand {
937 display: none;
940 display: none;
938 }
941 }
939 .cb-collapse {
942 .cb-collapse {
940 display: inline;
943 display: inline;
941 }
944 }
942 &.cb-collapsed {
945 &.cb-collapsed {
943 .cb-line {
946 .cb-line {
944 display: none;
947 display: none;
945 }
948 }
946 .cb-expand {
949 .cb-expand {
947 display: inline;
950 display: inline;
948 }
951 }
949 .cb-collapse {
952 .cb-collapse {
950 display: none;
953 display: none;
951 }
954 }
952 }
955 }
953
956
954 /* intentionally general selector since .cb-line-selected must override it
957 /* intentionally general selector since .cb-line-selected must override it
955 and they both use !important since the td itself may have a random color
958 and they both use !important since the td itself may have a random color
956 generated by annotation blocks. TLDR: if you change it, make sure
959 generated by annotation blocks. TLDR: if you change it, make sure
957 annotated block selection and line selection in file view still work */
960 annotated block selection and line selection in file view still work */
958 .cb-line-fresh .cb-content {
961 .cb-line-fresh .cb-content {
959 background: white !important;
962 background: white !important;
960 }
963 }
961 .cb-warning {
964 .cb-warning {
962 background: #fff4dd;
965 background: #fff4dd;
963 }
966 }
964
967
965 &.cb-diff-sideside {
968 &.cb-diff-sideside {
966 td {
969 td {
967 &.cb-content {
970 &.cb-content {
968 width: 50%;
971 width: 50%;
969 }
972 }
970 }
973 }
971 }
974 }
972
975
973 tr {
976 tr {
974 &.cb-annotate {
977 &.cb-annotate {
975 border-top: 1px solid #eee;
978 border-top: 1px solid #eee;
976 }
979 }
977
980
978 &.cb-hunk {
981 &.cb-hunk {
979 font-family: @font-family-monospace;
982 font-family: @font-family-monospace;
980 color: rgba(0, 0, 0, 0.3);
983 color: rgba(0, 0, 0, 0.3);
981
984
982 td {
985 td {
983 &:first-child {
986 &:first-child {
984 background: #edf2f9;
987 background: #edf2f9;
985 }
988 }
986 &:last-child {
989 &:last-child {
987 background: #f4f7fb;
990 background: #f4f7fb;
988 }
991 }
989 }
992 }
990 }
993 }
991 }
994 }
992
995
993
996
994 td {
997 td {
995 vertical-align: top;
998 vertical-align: top;
996 padding: 0;
999 padding: 0;
997
1000
998 &.cb-content {
1001 &.cb-content {
999 font-size: 12.35px;
1002 font-size: 12.35px;
1000
1003
1001 &.cb-line-selected .cb-code {
1004 &.cb-line-selected .cb-code {
1002 background: @comment-highlight-color !important;
1005 background: @comment-highlight-color !important;
1003 }
1006 }
1004
1007
1005 span.cb-code {
1008 span.cb-code {
1006 line-height: @cb-line-height;
1009 line-height: @cb-line-height;
1007 padding-left: @cb-line-code-padding;
1010 padding-left: @cb-line-code-padding;
1008 padding-right: @cb-line-code-padding;
1011 padding-right: @cb-line-code-padding;
1009 display: block;
1012 display: block;
1010 white-space: pre-wrap;
1013 white-space: pre-wrap;
1011 font-family: @font-family-monospace;
1014 font-family: @font-family-monospace;
1012 word-break: break-all;
1015 word-break: break-all;
1013 .nonl {
1016 .nonl {
1014 color: @color5;
1017 color: @color5;
1015 }
1018 }
1016 }
1019 }
1017
1020
1018 &> button.cb-comment-box-opener {
1021 &> button.cb-comment-box-opener {
1019
1022
1020 padding: 2px 2px 1px 3px;
1023 padding: 2px 2px 1px 3px;
1021 margin-left: -6px;
1024 margin-left: -6px;
1022 margin-top: -1px;
1025 margin-top: -1px;
1023
1026
1024 border-radius: @border-radius;
1027 border-radius: @border-radius;
1025 position: absolute;
1028 position: absolute;
1026 display: none;
1029 display: none;
1027 }
1030 }
1028 .cb-comment {
1031 .cb-comment {
1029 margin-top: 10px;
1032 margin-top: 10px;
1030 white-space: normal;
1033 white-space: normal;
1031 }
1034 }
1032 }
1035 }
1033 &:hover {
1036 &:hover {
1034 button.cb-comment-box-opener {
1037 button.cb-comment-box-opener {
1035 display: block;
1038 display: block;
1036 }
1039 }
1037 &+ td button.cb-comment-box-opener {
1040 &+ td button.cb-comment-box-opener {
1038 display: block
1041 display: block
1039 }
1042 }
1040 }
1043 }
1041
1044
1042 &.cb-data {
1045 &.cb-data {
1043 text-align: right;
1046 text-align: right;
1044 width: 30px;
1047 width: 30px;
1045 font-family: @font-family-monospace;
1048 font-family: @font-family-monospace;
1046
1049
1047 .icon-comment {
1050 .icon-comment {
1048 cursor: pointer;
1051 cursor: pointer;
1049 }
1052 }
1050 &.cb-line-selected > div {
1053 &.cb-line-selected > div {
1051 display: block;
1054 display: block;
1052 background: @comment-highlight-color !important;
1055 background: @comment-highlight-color !important;
1053 line-height: @cb-line-height;
1056 line-height: @cb-line-height;
1054 color: rgba(0, 0, 0, 0.3);
1057 color: rgba(0, 0, 0, 0.3);
1055 }
1058 }
1056 }
1059 }
1057
1060
1058 &.cb-lineno {
1061 &.cb-lineno {
1059 padding: 0;
1062 padding: 0;
1060 width: 50px;
1063 width: 50px;
1061 color: rgba(0, 0, 0, 0.3);
1064 color: rgba(0, 0, 0, 0.3);
1062 text-align: right;
1065 text-align: right;
1063 border-right: 1px solid #eee;
1066 border-right: 1px solid #eee;
1064 font-family: @font-family-monospace;
1067 font-family: @font-family-monospace;
1065
1068
1066 a::before {
1069 a::before {
1067 content: attr(data-line-no);
1070 content: attr(data-line-no);
1068 }
1071 }
1069 &.cb-line-selected a {
1072 &.cb-line-selected a {
1070 background: @comment-highlight-color !important;
1073 background: @comment-highlight-color !important;
1071 }
1074 }
1072
1075
1073 a {
1076 a {
1074 display: block;
1077 display: block;
1075 padding-right: @cb-line-code-padding;
1078 padding-right: @cb-line-code-padding;
1076 padding-left: @cb-line-code-padding;
1079 padding-left: @cb-line-code-padding;
1077 line-height: @cb-line-height;
1080 line-height: @cb-line-height;
1078 color: rgba(0, 0, 0, 0.3);
1081 color: rgba(0, 0, 0, 0.3);
1079 }
1082 }
1080 }
1083 }
1081
1084
1082 &.cb-empty {
1085 &.cb-empty {
1083 background: @grey7;
1086 background: @grey7;
1084 }
1087 }
1085
1088
1086 ins {
1089 ins {
1087 color: black;
1090 color: black;
1088 background: #a6f3a6;
1091 background: #a6f3a6;
1089 text-decoration: none;
1092 text-decoration: none;
1090 }
1093 }
1091 del {
1094 del {
1092 color: black;
1095 color: black;
1093 background: #f8cbcb;
1096 background: #f8cbcb;
1094 text-decoration: none;
1097 text-decoration: none;
1095 }
1098 }
1096 &.cb-addition {
1099 &.cb-addition {
1097 background: #ecffec;
1100 background: #ecffec;
1098
1101
1099 &.blob-lineno {
1102 &.blob-lineno {
1100 background: #ddffdd;
1103 background: #ddffdd;
1101 }
1104 }
1102 }
1105 }
1103 &.cb-deletion {
1106 &.cb-deletion {
1104 background: #ffecec;
1107 background: #ffecec;
1105
1108
1106 &.blob-lineno {
1109 &.blob-lineno {
1107 background: #ffdddd;
1110 background: #ffdddd;
1108 }
1111 }
1109 }
1112 }
1110 &.cb-annotate-message-spacer {
1113 &.cb-annotate-message-spacer {
1111 width:8px;
1114 width:8px;
1112 padding: 1px 0px 0px 3px;
1115 padding: 1px 0px 0px 3px;
1113 }
1116 }
1114 &.cb-annotate-info {
1117 &.cb-annotate-info {
1115 width: 320px;
1118 width: 320px;
1116 min-width: 320px;
1119 min-width: 320px;
1117 max-width: 320px;
1120 max-width: 320px;
1118 padding: 5px 2px;
1121 padding: 5px 2px;
1119 font-size: 13px;
1122 font-size: 13px;
1120
1123
1121 .cb-annotate-message {
1124 .cb-annotate-message {
1122 padding: 2px 0px 0px 0px;
1125 padding: 2px 0px 0px 0px;
1123 white-space: pre-line;
1126 white-space: pre-line;
1124 overflow: hidden;
1127 overflow: hidden;
1125 }
1128 }
1126 .rc-user {
1129 .rc-user {
1127 float: none;
1130 float: none;
1128 padding: 0 6px 0 17px;
1131 padding: 0 6px 0 17px;
1129 min-width: unset;
1132 min-width: unset;
1130 min-height: unset;
1133 min-height: unset;
1131 }
1134 }
1132 }
1135 }
1133
1136
1134 &.cb-annotate-revision {
1137 &.cb-annotate-revision {
1135 cursor: pointer;
1138 cursor: pointer;
1136 text-align: right;
1139 text-align: right;
1137 padding: 1px 3px 0px 3px;
1140 padding: 1px 3px 0px 3px;
1138 }
1141 }
1139 }
1142 }
1140 }
1143 }
@@ -1,663 +1,672 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 <%def name="link_for(**kw)">
26 <%def name="link_for(**kw)">
27 <%
27 <%
28 new_args = request.GET.mixed()
28 new_args = request.GET.mixed()
29 new_args.update(kw)
29 new_args.update(kw)
30 return h.url('', **new_args)
30 return h.url('', **new_args)
31 %>
31 %>
32 </%def>
32 </%def>
33
33
34 <%def name="render_diffset(diffset, commit=None,
34 <%def name="render_diffset(diffset, commit=None,
35
35
36 # collapse all file diff entries when there are more than this amount of files in the diff
36 # collapse all file diff entries when there are more than this amount of files in the diff
37 collapse_when_files_over=20,
37 collapse_when_files_over=20,
38
38
39 # collapse lines in the diff when more than this amount of lines changed in the file diff
39 # collapse lines in the diff when more than this amount of lines changed in the file diff
40 lines_changed_limit=500,
40 lines_changed_limit=500,
41
41
42 # add a ruler at to the output
42 # add a ruler at to the output
43 ruler_at_chars=0,
43 ruler_at_chars=0,
44
44
45 # show inline comments
45 # show inline comments
46 use_comments=False,
46 use_comments=False,
47
47
48 # disable new comments
48 # disable new comments
49 disable_new_comments=False,
49 disable_new_comments=False,
50
50
51 # special file-comments that were deleted in previous versions
51 # special file-comments that were deleted in previous versions
52 # it's used for showing outdated comments for deleted files in a PR
52 # it's used for showing outdated comments for deleted files in a PR
53 deleted_files_comments=None
53 deleted_files_comments=None
54
54
55 )">
55 )">
56
56
57 %if use_comments:
57 %if use_comments:
58 <div id="cb-comments-inline-container-template" class="js-template">
58 <div id="cb-comments-inline-container-template" class="js-template">
59 ${inline_comments_container([])}
59 ${inline_comments_container([])}
60 </div>
60 </div>
61 <div class="js-template" id="cb-comment-inline-form-template">
61 <div class="js-template" id="cb-comment-inline-form-template">
62 <div class="comment-inline-form ac">
62 <div class="comment-inline-form ac">
63
63
64 %if c.rhodecode_user.username != h.DEFAULT_USER:
64 %if c.rhodecode_user.username != h.DEFAULT_USER:
65 ## render template for inline comments
65 ## render template for inline comments
66 ${commentblock.comment_form(form_type='inline')}
66 ${commentblock.comment_form(form_type='inline')}
67 %else:
67 %else:
68 ${h.form('', class_='inline-form comment-form-login', method='get')}
68 ${h.form('', class_='inline-form comment-form-login', method='get')}
69 <div class="pull-left">
69 <div class="pull-left">
70 <div class="comment-help pull-right">
70 <div class="comment-help pull-right">
71 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
71 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
72 </div>
72 </div>
73 </div>
73 </div>
74 <div class="comment-button pull-right">
74 <div class="comment-button pull-right">
75 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
75 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
76 ${_('Cancel')}
76 ${_('Cancel')}
77 </button>
77 </button>
78 </div>
78 </div>
79 <div class="clearfix"></div>
79 <div class="clearfix"></div>
80 ${h.end_form()}
80 ${h.end_form()}
81 %endif
81 %endif
82 </div>
82 </div>
83 </div>
83 </div>
84
84
85 %endif
85 %endif
86 <%
86 <%
87 collapse_all = len(diffset.files) > collapse_when_files_over
87 collapse_all = len(diffset.files) > collapse_when_files_over
88 %>
88 %>
89
89
90 %if c.diffmode == 'sideside':
90 %if c.diffmode == 'sideside':
91 <style>
91 <style>
92 .wrapper {
92 .wrapper {
93 max-width: 1600px !important;
93 max-width: 1600px !important;
94 }
94 }
95 </style>
95 </style>
96 %endif
96 %endif
97
97
98 %if ruler_at_chars:
98 %if ruler_at_chars:
99 <style>
99 <style>
100 .diff table.cb .cb-content:after {
100 .diff table.cb .cb-content:after {
101 content: "";
101 content: "";
102 border-left: 1px solid blue;
102 border-left: 1px solid blue;
103 position: absolute;
103 position: absolute;
104 top: 0;
104 top: 0;
105 height: 18px;
105 height: 18px;
106 opacity: .2;
106 opacity: .2;
107 z-index: 10;
107 z-index: 10;
108 //## +5 to account for diff action (+/-)
108 //## +5 to account for diff action (+/-)
109 left: ${ruler_at_chars + 5}ch;
109 left: ${ruler_at_chars + 5}ch;
110 </style>
110 </style>
111 %endif
111 %endif
112
112
113 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
113 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
114 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
114 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
115 %if commit:
115 %if commit:
116 <div class="pull-right">
116 <div class="pull-right">
117 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
117 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
118 ${_('Browse Files')}
118 ${_('Browse Files')}
119 </a>
119 </a>
120 </div>
120 </div>
121 %endif
121 %endif
122 <h2 class="clearinner">
122 <h2 class="clearinner">
123 %if commit:
123 %if commit:
124 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
124 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
125 ${h.age_component(commit.date)} -
125 ${h.age_component(commit.date)} -
126 %endif
126 %endif
127 %if diffset.limited_diff:
127 %if diffset.limited_diff:
128 ${_('The requested commit is too big and content was truncated.')}
128 ${_('The requested commit is too big and content was truncated.')}
129
129
130 ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
130 ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
131 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
131 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
132 %else:
132 %else:
133 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
133 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
134 '%(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}}
134 '%(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 %endif
135 %endif
136
136
137 </h2>
137 </h2>
138 </div>
138 </div>
139
139
140 %if not diffset.files:
140 %if not diffset.files:
141 <p class="empty_data">${_('No files')}</p>
141 <p class="empty_data">${_('No files')}</p>
142 %endif
142 %endif
143
143
144 <div class="filediffs">
144 <div class="filediffs">
145 ## initial value could be marked as False later on
145 ## initial value could be marked as False later on
146 <% over_lines_changed_limit = False %>
146 <% over_lines_changed_limit = False %>
147 %for i, filediff in enumerate(diffset.files):
147 %for i, filediff in enumerate(diffset.files):
148
148
149 <%
149 <%
150 lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
150 lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
151 over_lines_changed_limit = lines_changed > lines_changed_limit
151 over_lines_changed_limit = lines_changed > lines_changed_limit
152 %>
152 %>
153 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
153 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
154 <div
154 <div
155 class="filediff"
155 class="filediff"
156 data-f-path="${filediff['patch']['filename']}"
156 data-f-path="${filediff['patch']['filename']}"
157 id="a_${h.FID('', filediff['patch']['filename'])}">
157 id="a_${h.FID('', filediff['patch']['filename'])}">
158 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
158 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
159 <div class="filediff-collapse-indicator"></div>
159 <div class="filediff-collapse-indicator"></div>
160 ${diff_ops(filediff)}
160 ${diff_ops(filediff)}
161 </label>
161 </label>
162 ${diff_menu(filediff, use_comments=use_comments)}
162 ${diff_menu(filediff, use_comments=use_comments)}
163 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
163 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
164 %if not filediff.hunks:
164 %if not filediff.hunks:
165 %for op_id, op_text in filediff['patch']['stats']['ops'].items():
165 %for op_id, op_text in filediff['patch']['stats']['ops'].items():
166 <tr>
166 <tr>
167 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
167 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
168 %if op_id == DEL_FILENODE:
168 %if op_id == DEL_FILENODE:
169 ${_('File was deleted')}
169 ${_('File was deleted')}
170 %elif op_id == BIN_FILENODE:
170 %elif op_id == BIN_FILENODE:
171 ${_('Binary file hidden')}
171 ${_('Binary file hidden')}
172 %else:
172 %else:
173 ${op_text}
173 ${op_text}
174 %endif
174 %endif
175 </td>
175 </td>
176 </tr>
176 </tr>
177 %endfor
177 %endfor
178 %endif
178 %endif
179 %if filediff.patch['is_limited_diff']:
179 %if filediff.patch['is_limited_diff']:
180 <tr class="cb-warning cb-collapser">
180 <tr class="cb-warning cb-collapser">
181 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
181 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
182 ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
182 ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
183 </td>
183 </td>
184 </tr>
184 </tr>
185 %else:
185 %else:
186 %if over_lines_changed_limit:
186 %if over_lines_changed_limit:
187 <tr class="cb-warning cb-collapser">
187 <tr class="cb-warning cb-collapser">
188 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
188 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
189 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
189 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
190 <a href="#" class="cb-expand"
190 <a href="#" class="cb-expand"
191 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
191 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
192 </a>
192 </a>
193 <a href="#" class="cb-collapse"
193 <a href="#" class="cb-collapse"
194 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
194 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
195 </a>
195 </a>
196 </td>
196 </td>
197 </tr>
197 </tr>
198 %endif
198 %endif
199 %endif
199 %endif
200
200
201 %for hunk in filediff.hunks:
201 %for hunk in filediff.hunks:
202 <tr class="cb-hunk">
202 <tr class="cb-hunk">
203 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
203 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
204 ## TODO: dan: add ajax loading of more context here
204 ## TODO: dan: add ajax loading of more context here
205 ## <a href="#">
205 ## <a href="#">
206 <i class="icon-more"></i>
206 <i class="icon-more"></i>
207 ## </a>
207 ## </a>
208 </td>
208 </td>
209 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
209 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
210 @@
210 @@
211 -${hunk.source_start},${hunk.source_length}
211 -${hunk.source_start},${hunk.source_length}
212 +${hunk.target_start},${hunk.target_length}
212 +${hunk.target_start},${hunk.target_length}
213 ${hunk.section_header}
213 ${hunk.section_header}
214 </td>
214 </td>
215 </tr>
215 </tr>
216 %if c.diffmode == 'unified':
216 %if c.diffmode == 'unified':
217 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
217 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
218 %elif c.diffmode == 'sideside':
218 %elif c.diffmode == 'sideside':
219 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
219 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
220 %else:
220 %else:
221 <tr class="cb-line">
221 <tr class="cb-line">
222 <td>unknown diff mode</td>
222 <td>unknown diff mode</td>
223 </tr>
223 </tr>
224 %endif
224 %endif
225 %endfor
225 %endfor
226
226
227 ## outdated comments that do not fit into currently displayed lines
227 ## outdated comments that do not fit into currently displayed lines
228 % for lineno, comments in filediff.left_comments.items():
228 % for lineno, comments in filediff.left_comments.items():
229
229
230 %if c.diffmode == 'unified':
230 %if c.diffmode == 'unified':
231 <tr class="cb-line">
231 <tr class="cb-line">
232 <td class="cb-data cb-context"></td>
232 <td class="cb-data cb-context"></td>
233 <td class="cb-lineno cb-context"></td>
233 <td class="cb-lineno cb-context"></td>
234 <td class="cb-lineno cb-context"></td>
234 <td class="cb-lineno cb-context"></td>
235 <td class="cb-content cb-context">
235 <td class="cb-content cb-context">
236 ${inline_comments_container(comments)}
236 ${inline_comments_container(comments)}
237 </td>
237 </td>
238 </tr>
238 </tr>
239 %elif c.diffmode == 'sideside':
239 %elif c.diffmode == 'sideside':
240 <tr class="cb-line">
240 <tr class="cb-line">
241 <td class="cb-data cb-context"></td>
241 <td class="cb-data cb-context"></td>
242 <td class="cb-lineno cb-context"></td>
242 <td class="cb-lineno cb-context"></td>
243 <td class="cb-content cb-context"></td>
243 <td class="cb-content cb-context"></td>
244
244
245 <td class="cb-data cb-context"></td>
245 <td class="cb-data cb-context"></td>
246 <td class="cb-lineno cb-context"></td>
246 <td class="cb-lineno cb-context"></td>
247 <td class="cb-content cb-context">
247 <td class="cb-content cb-context">
248 ${inline_comments_container(comments)}
248 ${inline_comments_container(comments)}
249 </td>
249 </td>
250 </tr>
250 </tr>
251 %endif
251 %endif
252
252
253 % endfor
253 % endfor
254
254
255 </table>
255 </table>
256 </div>
256 </div>
257 %endfor
257 %endfor
258
258
259 ## outdated comments that are made for a file that has been deleted
259 ## outdated comments that are made for a file that has been deleted
260 % for filename, comments_dict in (deleted_files_comments or {}).items():
260 % for filename, comments_dict in (deleted_files_comments or {}).items():
261
261
262 <div class="filediffs filediff-outdated" style="display: none">
262 <div class="filediffs filediff-outdated" style="display: none">
263 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
263 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
264 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
264 <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
265 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
265 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
266 <div class="filediff-collapse-indicator"></div>
266 <div class="filediff-collapse-indicator"></div>
267 <span class="pill">
267 <span class="pill">
268 ## file was deleted
268 ## file was deleted
269 <strong>${filename}</strong>
269 <strong>${filename}</strong>
270 </span>
270 </span>
271 <span class="pill-group" style="float: left">
271 <span class="pill-group" style="float: left">
272 ## file op, doesn't need translation
272 ## file op, doesn't need translation
273 <span class="pill" op="removed">removed in this version</span>
273 <span class="pill" op="removed">removed in this version</span>
274 </span>
274 </span>
275 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a>
275 <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a>
276 <span class="pill-group" style="float: right">
276 <span class="pill-group" style="float: right">
277 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
277 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
278 </span>
278 </span>
279 </label>
279 </label>
280
280
281 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
281 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
282 <tr>
282 <tr>
283 % if c.diffmode == 'unified':
283 % if c.diffmode == 'unified':
284 <td></td>
284 <td></td>
285 %endif
285 %endif
286
286
287 <td></td>
287 <td></td>
288 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}>
288 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}>
289 ${_('File was deleted in this version, and outdated comments were made on it')}
289 ${_('File was deleted in this version, and outdated comments were made on it')}
290 </td>
290 </td>
291 </tr>
291 </tr>
292 %if c.diffmode == 'unified':
292 %if c.diffmode == 'unified':
293 <tr class="cb-line">
293 <tr class="cb-line">
294 <td class="cb-data cb-context"></td>
294 <td class="cb-data cb-context"></td>
295 <td class="cb-lineno cb-context"></td>
295 <td class="cb-lineno cb-context"></td>
296 <td class="cb-lineno cb-context"></td>
296 <td class="cb-lineno cb-context"></td>
297 <td class="cb-content cb-context">
297 <td class="cb-content cb-context">
298 ${inline_comments_container(comments_dict['comments'])}
298 ${inline_comments_container(comments_dict['comments'])}
299 </td>
299 </td>
300 </tr>
300 </tr>
301 %elif c.diffmode == 'sideside':
301 %elif c.diffmode == 'sideside':
302 <tr class="cb-line">
302 <tr class="cb-line">
303 <td class="cb-data cb-context"></td>
303 <td class="cb-data cb-context"></td>
304 <td class="cb-lineno cb-context"></td>
304 <td class="cb-lineno cb-context"></td>
305 <td class="cb-content cb-context"></td>
305 <td class="cb-content cb-context"></td>
306
306
307 <td class="cb-data cb-context"></td>
307 <td class="cb-data cb-context"></td>
308 <td class="cb-lineno cb-context"></td>
308 <td class="cb-lineno cb-context"></td>
309 <td class="cb-content cb-context">
309 <td class="cb-content cb-context">
310 ${inline_comments_container(comments_dict['comments'])}
310 ${inline_comments_container(comments_dict['comments'])}
311 </td>
311 </td>
312 </tr>
312 </tr>
313 %endif
313 %endif
314 </table>
314 </table>
315 </div>
315 </div>
316 </div>
316 </div>
317 % endfor
317 % endfor
318
318
319 </div>
319 </div>
320 </div>
320 </div>
321 </%def>
321 </%def>
322
322
323 <%def name="diff_ops(filediff)">
323 <%def name="diff_ops(filediff)">
324 <%
324 <%
325 stats = filediff['patch']['stats']
325 stats = filediff['patch']['stats']
326 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
326 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
327 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE
327 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
328 %>
328 %>
329 <span class="pill">
329 <span class="pill">
330 %if filediff.source_file_path and filediff.target_file_path:
330 %if filediff.source_file_path and filediff.target_file_path:
331 %if filediff.source_file_path != filediff.target_file_path:
331 %if filediff.source_file_path != filediff.target_file_path:
332 ## file was renamed
332 ## file was renamed, or copied
333 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
333 %if RENAMED_FILENODE in stats['ops']:
334 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
335 %elif COPIED_FILENODE in stats['ops']:
336 <strong>${filediff.target_file_path}</strong> β¬… ${filediff.source_file_path}
337 %endif
334 %else:
338 %else:
335 ## file was modified
339 ## file was modified
336 <strong>${filediff.source_file_path}</strong>
340 <strong>${filediff.source_file_path}</strong>
337 %endif
341 %endif
338 %else:
342 %else:
339 %if filediff.source_file_path:
343 %if filediff.source_file_path:
340 ## file was deleted
344 ## file was deleted
341 <strong>${filediff.source_file_path}</strong>
345 <strong>${filediff.source_file_path}</strong>
342 %else:
346 %else:
343 ## file was added
347 ## file was added
344 <strong>${filediff.target_file_path}</strong>
348 <strong>${filediff.target_file_path}</strong>
345 %endif
349 %endif
346 %endif
350 %endif
347 </span>
351 </span>
348 <span class="pill-group" style="float: left">
352 <span class="pill-group" style="float: left">
349 %if filediff.patch['is_limited_diff']:
353 %if filediff.patch['is_limited_diff']:
350 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
354 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
351 %endif
355 %endif
356
352 %if RENAMED_FILENODE in stats['ops']:
357 %if RENAMED_FILENODE in stats['ops']:
353 <span class="pill" op="renamed">renamed</span>
358 <span class="pill" op="renamed">renamed</span>
354 %endif
359 %endif
355
360
361 %if COPIED_FILENODE in stats['ops']:
362 <span class="pill" op="copied">copied</span>
363 %endif
364
356 %if NEW_FILENODE in stats['ops']:
365 %if NEW_FILENODE in stats['ops']:
357 <span class="pill" op="created">created</span>
366 <span class="pill" op="created">created</span>
358 %if filediff['target_mode'].startswith('120'):
367 %if filediff['target_mode'].startswith('120'):
359 <span class="pill" op="symlink">symlink</span>
368 <span class="pill" op="symlink">symlink</span>
360 %else:
369 %else:
361 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
370 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
362 %endif
371 %endif
363 %endif
372 %endif
364
373
365 %if DEL_FILENODE in stats['ops']:
374 %if DEL_FILENODE in stats['ops']:
366 <span class="pill" op="removed">removed</span>
375 <span class="pill" op="removed">removed</span>
367 %endif
376 %endif
368
377
369 %if CHMOD_FILENODE in stats['ops']:
378 %if CHMOD_FILENODE in stats['ops']:
370 <span class="pill" op="mode">
379 <span class="pill" op="mode">
371 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
380 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
372 </span>
381 </span>
373 %endif
382 %endif
374 </span>
383 </span>
375
384
376 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
385 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
377
386
378 <span class="pill-group" style="float: right">
387 <span class="pill-group" style="float: right">
379 %if BIN_FILENODE in stats['ops']:
388 %if BIN_FILENODE in stats['ops']:
380 <span class="pill" op="binary">binary</span>
389 <span class="pill" op="binary">binary</span>
381 %if MOD_FILENODE in stats['ops']:
390 %if MOD_FILENODE in stats['ops']:
382 <span class="pill" op="modified">modified</span>
391 <span class="pill" op="modified">modified</span>
383 %endif
392 %endif
384 %endif
393 %endif
385 %if stats['added']:
394 %if stats['added']:
386 <span class="pill" op="added">+${stats['added']}</span>
395 <span class="pill" op="added">+${stats['added']}</span>
387 %endif
396 %endif
388 %if stats['deleted']:
397 %if stats['deleted']:
389 <span class="pill" op="deleted">-${stats['deleted']}</span>
398 <span class="pill" op="deleted">-${stats['deleted']}</span>
390 %endif
399 %endif
391 </span>
400 </span>
392
401
393 </%def>
402 </%def>
394
403
395 <%def name="nice_mode(filemode)">
404 <%def name="nice_mode(filemode)">
396 ${filemode.startswith('100') and filemode[3:] or filemode}
405 ${filemode.startswith('100') and filemode[3:] or filemode}
397 </%def>
406 </%def>
398
407
399 <%def name="diff_menu(filediff, use_comments=False)">
408 <%def name="diff_menu(filediff, use_comments=False)">
400 <div class="filediff-menu">
409 <div class="filediff-menu">
401 %if filediff.diffset.source_ref:
410 %if filediff.diffset.source_ref:
402 %if filediff.patch['operation'] in ['D', 'M']:
411 %if filediff.patch['operation'] in ['D', 'M']:
403 <a
412 <a
404 class="tooltip"
413 class="tooltip"
405 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
414 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
406 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
415 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
407 >
416 >
408 ${_('Show file before')}
417 ${_('Show file before')}
409 </a> |
418 </a> |
410 %else:
419 %else:
411 <span
420 <span
412 class="tooltip"
421 class="tooltip"
413 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
422 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
414 >
423 >
415 ${_('Show file before')}
424 ${_('Show file before')}
416 </span> |
425 </span> |
417 %endif
426 %endif
418 %if filediff.patch['operation'] in ['A', 'M']:
427 %if filediff.patch['operation'] in ['A', 'M']:
419 <a
428 <a
420 class="tooltip"
429 class="tooltip"
421 href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
430 href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
422 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
431 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
423 >
432 >
424 ${_('Show file after')}
433 ${_('Show file after')}
425 </a> |
434 </a> |
426 %else:
435 %else:
427 <span
436 <span
428 class="tooltip"
437 class="tooltip"
429 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
438 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
430 >
439 >
431 ${_('Show file after')}
440 ${_('Show file after')}
432 </span> |
441 </span> |
433 %endif
442 %endif
434 <a
443 <a
435 class="tooltip"
444 class="tooltip"
436 title="${h.tooltip(_('Raw diff'))}"
445 title="${h.tooltip(_('Raw diff'))}"
437 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
446 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
438 >
447 >
439 ${_('Raw diff')}
448 ${_('Raw diff')}
440 </a> |
449 </a> |
441 <a
450 <a
442 class="tooltip"
451 class="tooltip"
443 title="${h.tooltip(_('Download diff'))}"
452 title="${h.tooltip(_('Download diff'))}"
444 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
453 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
445 >
454 >
446 ${_('Download diff')}
455 ${_('Download diff')}
447 </a>
456 </a>
448 % if use_comments:
457 % if use_comments:
449 |
458 |
450 % endif
459 % endif
451
460
452 ## 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)
461 ## 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)
453 %if hasattr(c, 'ignorews_url'):
462 %if hasattr(c, 'ignorews_url'):
454 ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
463 ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
455 %endif
464 %endif
456 %if hasattr(c, 'context_url'):
465 %if hasattr(c, 'context_url'):
457 ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
466 ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
458 %endif
467 %endif
459
468
460 %if use_comments:
469 %if use_comments:
461 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
470 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
462 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
471 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
463 </a>
472 </a>
464 %endif
473 %endif
465 %endif
474 %endif
466 </div>
475 </div>
467 </%def>
476 </%def>
468
477
469
478
470 <%def name="inline_comments_container(comments)">
479 <%def name="inline_comments_container(comments)">
471 <div class="inline-comments">
480 <div class="inline-comments">
472 %for comment in comments:
481 %for comment in comments:
473 ${commentblock.comment_block(comment, inline=True)}
482 ${commentblock.comment_block(comment, inline=True)}
474 %endfor
483 %endfor
475
484
476 % if comments and comments[-1].outdated:
485 % if comments and comments[-1].outdated:
477 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
486 <span class="btn btn-secondary cb-comment-add-button comment-outdated}"
478 style="display: none;}">
487 style="display: none;}">
479 ${_('Add another comment')}
488 ${_('Add another comment')}
480 </span>
489 </span>
481 % else:
490 % else:
482 <span onclick="return Rhodecode.comments.createComment(this)"
491 <span onclick="return Rhodecode.comments.createComment(this)"
483 class="btn btn-secondary cb-comment-add-button">
492 class="btn btn-secondary cb-comment-add-button">
484 ${_('Add another comment')}
493 ${_('Add another comment')}
485 </span>
494 </span>
486 % endif
495 % endif
487
496
488 </div>
497 </div>
489 </%def>
498 </%def>
490
499
491
500
492 <%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
501 <%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
493 %for i, line in enumerate(hunk.sideside):
502 %for i, line in enumerate(hunk.sideside):
494 <%
503 <%
495 old_line_anchor, new_line_anchor = None, None
504 old_line_anchor, new_line_anchor = None, None
496 if line.original.lineno:
505 if line.original.lineno:
497 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
506 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
498 if line.modified.lineno:
507 if line.modified.lineno:
499 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
508 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
500 %>
509 %>
501
510
502 <tr class="cb-line">
511 <tr class="cb-line">
503 <td class="cb-data ${action_class(line.original.action)}"
512 <td class="cb-data ${action_class(line.original.action)}"
504 data-line-number="${line.original.lineno}"
513 data-line-number="${line.original.lineno}"
505 >
514 >
506 <div>
515 <div>
507 %if line.original.comments:
516 %if line.original.comments:
508 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
517 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
509 %endif
518 %endif
510 </div>
519 </div>
511 </td>
520 </td>
512 <td class="cb-lineno ${action_class(line.original.action)}"
521 <td class="cb-lineno ${action_class(line.original.action)}"
513 data-line-number="${line.original.lineno}"
522 data-line-number="${line.original.lineno}"
514 %if old_line_anchor:
523 %if old_line_anchor:
515 id="${old_line_anchor}"
524 id="${old_line_anchor}"
516 %endif
525 %endif
517 >
526 >
518 %if line.original.lineno:
527 %if line.original.lineno:
519 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
528 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
520 %endif
529 %endif
521 </td>
530 </td>
522 <td class="cb-content ${action_class(line.original.action)}"
531 <td class="cb-content ${action_class(line.original.action)}"
523 data-line-number="o${line.original.lineno}"
532 data-line-number="o${line.original.lineno}"
524 >
533 >
525 %if use_comments and line.original.lineno:
534 %if use_comments and line.original.lineno:
526 ${render_add_comment_button()}
535 ${render_add_comment_button()}
527 %endif
536 %endif
528 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
537 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
529 %if use_comments and line.original.lineno and line.original.comments:
538 %if use_comments and line.original.lineno and line.original.comments:
530 ${inline_comments_container(line.original.comments)}
539 ${inline_comments_container(line.original.comments)}
531 %endif
540 %endif
532 </td>
541 </td>
533 <td class="cb-data ${action_class(line.modified.action)}"
542 <td class="cb-data ${action_class(line.modified.action)}"
534 data-line-number="${line.modified.lineno}"
543 data-line-number="${line.modified.lineno}"
535 >
544 >
536 <div>
545 <div>
537 %if line.modified.comments:
546 %if line.modified.comments:
538 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
547 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
539 %endif
548 %endif
540 </div>
549 </div>
541 </td>
550 </td>
542 <td class="cb-lineno ${action_class(line.modified.action)}"
551 <td class="cb-lineno ${action_class(line.modified.action)}"
543 data-line-number="${line.modified.lineno}"
552 data-line-number="${line.modified.lineno}"
544 %if new_line_anchor:
553 %if new_line_anchor:
545 id="${new_line_anchor}"
554 id="${new_line_anchor}"
546 %endif
555 %endif
547 >
556 >
548 %if line.modified.lineno:
557 %if line.modified.lineno:
549 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
558 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
550 %endif
559 %endif
551 </td>
560 </td>
552 <td class="cb-content ${action_class(line.modified.action)}"
561 <td class="cb-content ${action_class(line.modified.action)}"
553 data-line-number="n${line.modified.lineno}"
562 data-line-number="n${line.modified.lineno}"
554 >
563 >
555 %if use_comments and line.modified.lineno:
564 %if use_comments and line.modified.lineno:
556 ${render_add_comment_button()}
565 ${render_add_comment_button()}
557 %endif
566 %endif
558 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
567 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
559 %if use_comments and line.modified.lineno and line.modified.comments:
568 %if use_comments and line.modified.lineno and line.modified.comments:
560 ${inline_comments_container(line.modified.comments)}
569 ${inline_comments_container(line.modified.comments)}
561 %endif
570 %endif
562 </td>
571 </td>
563 </tr>
572 </tr>
564 %endfor
573 %endfor
565 </%def>
574 </%def>
566
575
567
576
568 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
577 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
569 %for old_line_no, new_line_no, action, content, comments in hunk.unified:
578 %for old_line_no, new_line_no, action, content, comments in hunk.unified:
570 <%
579 <%
571 old_line_anchor, new_line_anchor = None, None
580 old_line_anchor, new_line_anchor = None, None
572 if old_line_no:
581 if old_line_no:
573 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
582 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
574 if new_line_no:
583 if new_line_no:
575 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
584 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
576 %>
585 %>
577 <tr class="cb-line">
586 <tr class="cb-line">
578 <td class="cb-data ${action_class(action)}">
587 <td class="cb-data ${action_class(action)}">
579 <div>
588 <div>
580 %if comments:
589 %if comments:
581 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
590 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
582 %endif
591 %endif
583 </div>
592 </div>
584 </td>
593 </td>
585 <td class="cb-lineno ${action_class(action)}"
594 <td class="cb-lineno ${action_class(action)}"
586 data-line-number="${old_line_no}"
595 data-line-number="${old_line_no}"
587 %if old_line_anchor:
596 %if old_line_anchor:
588 id="${old_line_anchor}"
597 id="${old_line_anchor}"
589 %endif
598 %endif
590 >
599 >
591 %if old_line_anchor:
600 %if old_line_anchor:
592 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
601 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
593 %endif
602 %endif
594 </td>
603 </td>
595 <td class="cb-lineno ${action_class(action)}"
604 <td class="cb-lineno ${action_class(action)}"
596 data-line-number="${new_line_no}"
605 data-line-number="${new_line_no}"
597 %if new_line_anchor:
606 %if new_line_anchor:
598 id="${new_line_anchor}"
607 id="${new_line_anchor}"
599 %endif
608 %endif
600 >
609 >
601 %if new_line_anchor:
610 %if new_line_anchor:
602 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
611 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
603 %endif
612 %endif
604 </td>
613 </td>
605 <td class="cb-content ${action_class(action)}"
614 <td class="cb-content ${action_class(action)}"
606 data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
615 data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
607 >
616 >
608 %if use_comments:
617 %if use_comments:
609 ${render_add_comment_button()}
618 ${render_add_comment_button()}
610 %endif
619 %endif
611 <span class="cb-code">${action} ${content or '' | n}</span>
620 <span class="cb-code">${action} ${content or '' | n}</span>
612 %if use_comments and comments:
621 %if use_comments and comments:
613 ${inline_comments_container(comments)}
622 ${inline_comments_container(comments)}
614 %endif
623 %endif
615 </td>
624 </td>
616 </tr>
625 </tr>
617 %endfor
626 %endfor
618 </%def>
627 </%def>
619
628
620 <%def name="render_add_comment_button()">
629 <%def name="render_add_comment_button()">
621 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
630 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
622 <span><i class="icon-comment"></i></span>
631 <span><i class="icon-comment"></i></span>
623 </button>
632 </button>
624 </%def>
633 </%def>
625
634
626 <%def name="render_diffset_menu()">
635 <%def name="render_diffset_menu()">
627
636
628 <div class="diffset-menu clearinner">
637 <div class="diffset-menu clearinner">
629 <div class="pull-right">
638 <div class="pull-right">
630 <div class="btn-group">
639 <div class="btn-group">
631
640
632 <a
641 <a
633 class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip"
642 class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip"
634 title="${_('View side by side')}"
643 title="${_('View side by side')}"
635 href="${h.url_replace(diffmode='sideside')}">
644 href="${h.url_replace(diffmode='sideside')}">
636 <span>${_('Side by Side')}</span>
645 <span>${_('Side by Side')}</span>
637 </a>
646 </a>
638 <a
647 <a
639 class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip"
648 class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip"
640 title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}">
649 title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}">
641 <span>${_('Unified')}</span>
650 <span>${_('Unified')}</span>
642 </a>
651 </a>
643 </div>
652 </div>
644 </div>
653 </div>
645
654
646 <div class="pull-left">
655 <div class="pull-left">
647 <div class="btn-group">
656 <div class="btn-group">
648 <a
657 <a
649 class="btn"
658 class="btn"
650 href="#"
659 href="#"
651 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
660 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
652 <a
661 <a
653 class="btn"
662 class="btn"
654 href="#"
663 href="#"
655 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
664 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
656 <a
665 <a
657 class="btn"
666 class="btn"
658 href="#"
667 href="#"
659 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
668 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
660 </div>
669 </div>
661 </div>
670 </div>
662 </div>
671 </div>
663 </%def>
672 </%def>
General Comments 0
You need to be logged in to leave comments. Login now