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