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