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