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