##// END OF EJS Templates
comments: made few UI changes/improvements for how we show comments status, ribbons and general comment data.
marcink -
r4411:569617be default
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,1322 +1,1326 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-weight: @text-semibold-weight;
82 font-weight: @text-semibold-weight;
83 font-family: @text-semibold;
83 font-family: @text-semibold;
84 }
84 }
85
85
86 .compare-buttons {
86 .compare-buttons {
87 float: left;
87 float: left;
88 margin: 0;
88 margin: 0;
89 padding: 0 0 @padding;
89 padding: 0 0 @padding;
90
90
91 .btn {
91 .btn {
92 margin: 0 @padding 0 0;
92 margin: 0 @padding 0 0;
93 }
93 }
94 }
94 }
95 }
95 }
96
96
97 }
97 }
98
98
99 .parents {
99 .parents {
100 float: left;
100 float: left;
101 width: 100px;
101 width: 100px;
102 font-weight: 400;
102 font-weight: 400;
103 vertical-align: middle;
103 vertical-align: middle;
104 padding: 0px 2px 0px 2px;
104 padding: 0px 2px 0px 2px;
105 background-color: @grey6;
105 background-color: @grey6;
106
106
107 #parent_link {
107 #parent_link {
108 margin: 00px 2px;
108 margin: 00px 2px;
109
109
110 &.double {
110 &.double {
111 margin: 0px 2px;
111 margin: 0px 2px;
112 }
112 }
113
113
114 &.disabled{
114 &.disabled{
115 margin-right: @padding;
115 margin-right: @padding;
116 }
116 }
117 }
117 }
118 }
118 }
119
119
120 .children {
120 .children {
121 float: right;
121 float: right;
122 width: 100px;
122 width: 100px;
123 font-weight: 400;
123 font-weight: 400;
124 vertical-align: middle;
124 vertical-align: middle;
125 text-align: right;
125 text-align: right;
126 padding: 0px 2px 0px 2px;
126 padding: 0px 2px 0px 2px;
127 background-color: @grey6;
127 background-color: @grey6;
128
128
129 #child_link {
129 #child_link {
130 margin: 0px 2px;
130 margin: 0px 2px;
131
131
132 &.double {
132 &.double {
133 margin: 0px 2px;
133 margin: 0px 2px;
134 }
134 }
135
135
136 &.disabled{
136 &.disabled{
137 margin-right: @padding;
137 margin-right: @padding;
138 }
138 }
139 }
139 }
140 }
140 }
141
141
142 .changeset_header {
142 .changeset_header {
143 height: 16px;
143 height: 16px;
144
144
145 & > div{
145 & > div{
146 margin-right: @padding;
146 margin-right: @padding;
147 }
147 }
148 }
148 }
149
149
150 .changeset_file {
150 .changeset_file {
151 text-align: left;
151 text-align: left;
152 float: left;
152 float: left;
153 padding: 0;
153 padding: 0;
154
154
155 a{
155 a{
156 display: inline-block;
156 display: inline-block;
157 margin-right: 0.5em;
157 margin-right: 0.5em;
158 }
158 }
159
159
160 #selected_mode{
160 #selected_mode{
161 margin-left: 0;
161 margin-left: 0;
162 }
162 }
163 }
163 }
164
164
165 .diff-menu-wrapper {
165 .diff-menu-wrapper {
166 float: left;
166 float: left;
167 }
167 }
168
168
169 .diff-menu {
169 .diff-menu {
170 position: absolute;
170 position: absolute;
171 background: none repeat scroll 0 0 #FFFFFF;
171 background: none repeat scroll 0 0 #FFFFFF;
172 border-color: #003367 @grey3 @grey3;
172 border-color: #003367 @grey3 @grey3;
173 border-right: 1px solid @grey3;
173 border-right: 1px solid @grey3;
174 border-style: solid solid solid;
174 border-style: solid solid solid;
175 border-width: @border-thickness;
175 border-width: @border-thickness;
176 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
176 box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
177 margin-top: 5px;
177 margin-top: 5px;
178 margin-left: 1px;
178 margin-left: 1px;
179 }
179 }
180
180
181 .diff-actions, .editor-actions {
181 .diff-actions, .editor-actions {
182 float: left;
182 float: left;
183
183
184 input{
184 input{
185 margin: 0 0.5em 0 0;
185 margin: 0 0.5em 0 0;
186 }
186 }
187 }
187 }
188
188
189 // END CODE-HEADER STYLES
189 // END CODE-HEADER STYLES
190
190
191 // BEGIN CODE-BODY STYLES
191 // BEGIN CODE-BODY STYLES
192
192
193 .code-body {
193 .code-body {
194 padding: 0;
194 padding: 0;
195 background-color: #ffffff;
195 background-color: #ffffff;
196 position: relative;
196 position: relative;
197 max-width: none;
197 max-width: none;
198 box-sizing: border-box;
198 box-sizing: border-box;
199 // TODO: johbo: Parent has overflow: auto, this forces the child here
199 // TODO: johbo: Parent has overflow: auto, this forces the child here
200 // to have the intended size and to scroll. Should be simplified.
200 // to have the intended size and to scroll. Should be simplified.
201 width: 100%;
201 width: 100%;
202 overflow-x: auto;
202 overflow-x: auto;
203 }
203 }
204
204
205 pre.raw {
205 pre.raw {
206 background: white;
206 background: white;
207 color: @grey1;
207 color: @grey1;
208 }
208 }
209 // END CODE-BODY STYLES
209 // END CODE-BODY STYLES
210
210
211 }
211 }
212
212
213
213
214 table.code-difftable {
214 table.code-difftable {
215 border-collapse: collapse;
215 border-collapse: collapse;
216 width: 99%;
216 width: 99%;
217 border-radius: 0px !important;
217 border-radius: 0px !important;
218
218
219 td {
219 td {
220 padding: 0 !important;
220 padding: 0 !important;
221 background: none !important;
221 background: none !important;
222 border: 0 !important;
222 border: 0 !important;
223 }
223 }
224
224
225 .context {
225 .context {
226 background: none repeat scroll 0 0 #DDE7EF;
226 background: none repeat scroll 0 0 #DDE7EF;
227 }
227 }
228
228
229 .add {
229 .add {
230 background: none repeat scroll 0 0 #DDFFDD;
230 background: none repeat scroll 0 0 #DDFFDD;
231
231
232 ins {
232 ins {
233 background: none repeat scroll 0 0 #AAFFAA;
233 background: none repeat scroll 0 0 #AAFFAA;
234 text-decoration: none;
234 text-decoration: none;
235 }
235 }
236 }
236 }
237
237
238 .del {
238 .del {
239 background: none repeat scroll 0 0 #FFDDDD;
239 background: none repeat scroll 0 0 #FFDDDD;
240
240
241 del {
241 del {
242 background: none repeat scroll 0 0 #FFAAAA;
242 background: none repeat scroll 0 0 #FFAAAA;
243 text-decoration: none;
243 text-decoration: none;
244 }
244 }
245 }
245 }
246
246
247 /** LINE NUMBERS **/
247 /** LINE NUMBERS **/
248 .lineno {
248 .lineno {
249 padding-left: 2px !important;
249 padding-left: 2px !important;
250 padding-right: 2px;
250 padding-right: 2px;
251 text-align: right;
251 text-align: right;
252 width: 32px;
252 width: 32px;
253 -moz-user-select: none;
253 -moz-user-select: none;
254 -webkit-user-select: none;
254 -webkit-user-select: none;
255 border-right: @border-thickness solid @grey5 !important;
255 border-right: @border-thickness solid @grey5 !important;
256 border-left: 0px solid #CCC !important;
256 border-left: 0px solid #CCC !important;
257 border-top: 0px solid #CCC !important;
257 border-top: 0px solid #CCC !important;
258 border-bottom: none !important;
258 border-bottom: none !important;
259
259
260 a {
260 a {
261 &:extend(pre);
261 &:extend(pre);
262 text-align: right;
262 text-align: right;
263 padding-right: 2px;
263 padding-right: 2px;
264 cursor: pointer;
264 cursor: pointer;
265 display: block;
265 display: block;
266 width: 32px;
266 width: 32px;
267 }
267 }
268 }
268 }
269
269
270 .context {
270 .context {
271 cursor: auto;
271 cursor: auto;
272 &:extend(pre);
272 &:extend(pre);
273 }
273 }
274
274
275 .lineno-inline {
275 .lineno-inline {
276 background: none repeat scroll 0 0 #FFF !important;
276 background: none repeat scroll 0 0 #FFF !important;
277 padding-left: 2px;
277 padding-left: 2px;
278 padding-right: 2px;
278 padding-right: 2px;
279 text-align: right;
279 text-align: right;
280 width: 30px;
280 width: 30px;
281 -moz-user-select: none;
281 -moz-user-select: none;
282 -webkit-user-select: none;
282 -webkit-user-select: none;
283 }
283 }
284
284
285 /** CODE **/
285 /** CODE **/
286 .code {
286 .code {
287 display: block;
287 display: block;
288 width: 100%;
288 width: 100%;
289
289
290 td {
290 td {
291 margin: 0;
291 margin: 0;
292 padding: 0;
292 padding: 0;
293 }
293 }
294
294
295 pre {
295 pre {
296 margin: 0;
296 margin: 0;
297 padding: 0;
297 padding: 0;
298 margin-left: .5em;
298 margin-left: .5em;
299 }
299 }
300 }
300 }
301 }
301 }
302
302
303
303
304 // Comments
304 // Comments
305 .comment-selected-hl {
305 .comment-selected-hl {
306 border-left: 6px solid @comment-highlight-color !important;
306 border-left: 6px solid @comment-highlight-color !important;
307 padding-left: 3px !important;
307 padding-left: 3px !important;
308 margin-left: -7px !important;
308 margin-left: -7px !important;
309 }
309 }
310
310
311 div.comment:target,
311 div.comment:target,
312 div.comment-outdated:target {
312 div.comment-outdated:target {
313 .comment-selected-hl;
313 .comment-selected-hl;
314 }
314 }
315
315
316 //TODO: anderson: can't get an absolute number out of anything, so had to put the
316 //TODO: anderson: can't get an absolute number out of anything, so had to put the
317 //current values that might change. But to make it clear I put as a calculation
317 //current values that might change. But to make it clear I put as a calculation
318 @comment-max-width: 1065px;
318 @comment-max-width: 1065px;
319 @pr-extra-margin: 34px;
319 @pr-extra-margin: 34px;
320 @pr-border-spacing: 4px;
320 @pr-border-spacing: 4px;
321 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
321 @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing;
322
322
323 // Pull Request
323 // Pull Request
324 .cs_files .code-difftable {
324 .cs_files .code-difftable {
325 border: @border-thickness solid @grey5; //borders only on PRs
325 border: @border-thickness solid @grey5; //borders only on PRs
326
326
327 .comment-inline-form,
327 .comment-inline-form,
328 div.comment {
328 div.comment {
329 width: @pr-comment-width;
329 width: @pr-comment-width;
330 }
330 }
331 }
331 }
332
332
333 // Changeset
333 // Changeset
334 .code-difftable {
334 .code-difftable {
335 .comment-inline-form,
335 .comment-inline-form,
336 div.comment {
336 div.comment {
337 width: @comment-max-width;
337 width: @comment-max-width;
338 }
338 }
339 }
339 }
340
340
341 //Style page
341 //Style page
342 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
342 @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding;
343 #style-page .code-difftable{
343 #style-page .code-difftable{
344 .comment-inline-form,
344 .comment-inline-form,
345 div.comment {
345 div.comment {
346 width: @comment-max-width - @style-extra-margin;
346 width: @comment-max-width - @style-extra-margin;
347 }
347 }
348 }
348 }
349
349
350 #context-bar > h2 {
350 #context-bar > h2 {
351 font-size: 20px;
351 font-size: 20px;
352 }
352 }
353
353
354 #context-bar > h2> a {
354 #context-bar > h2> a {
355 font-size: 20px;
355 font-size: 20px;
356 }
356 }
357 // end of defaults
357 // end of defaults
358
358
359 .file_diff_buttons {
359 .file_diff_buttons {
360 padding: 0 0 @padding;
360 padding: 0 0 @padding;
361
361
362 .drop-menu {
362 .drop-menu {
363 float: left;
363 float: left;
364 margin: 0 @padding 0 0;
364 margin: 0 @padding 0 0;
365 }
365 }
366 .btn {
366 .btn {
367 margin: 0 @padding 0 0;
367 margin: 0 @padding 0 0;
368 }
368 }
369 }
369 }
370
370
371 .code-body.textarea.editor {
371 .code-body.textarea.editor {
372 max-width: none;
372 max-width: none;
373 padding: 15px;
373 padding: 15px;
374 }
374 }
375
375
376 td.injected_diff{
376 td.injected_diff{
377 max-width: 1178px;
377 max-width: 1178px;
378 overflow-x: auto;
378 overflow-x: auto;
379 overflow-y: hidden;
379 overflow-y: hidden;
380
380
381 div.diff-container,
381 div.diff-container,
382 div.diffblock{
382 div.diffblock{
383 max-width: 100%;
383 max-width: 100%;
384 }
384 }
385
385
386 div.code-body {
386 div.code-body {
387 max-width: 1124px;
387 max-width: 1124px;
388 overflow-x: auto;
388 overflow-x: auto;
389 overflow-y: hidden;
389 overflow-y: hidden;
390 padding: 0;
390 padding: 0;
391 }
391 }
392 div.diffblock {
392 div.diffblock {
393 border: none;
393 border: none;
394 }
394 }
395
395
396 &.inline-form {
396 &.inline-form {
397 width: 99%
397 width: 99%
398 }
398 }
399 }
399 }
400
400
401
401
402 table.code-difftable {
402 table.code-difftable {
403 width: 100%;
403 width: 100%;
404 }
404 }
405
405
406 /** PYGMENTS COLORING **/
406 /** PYGMENTS COLORING **/
407 div.codeblock {
407 div.codeblock {
408
408
409 // TODO: johbo: Added interim to get rid of the margin around
409 // TODO: johbo: Added interim to get rid of the margin around
410 // Select2 widgets. This needs further cleanup.
410 // Select2 widgets. This needs further cleanup.
411 overflow: auto;
411 overflow: auto;
412 padding: 0px;
412 padding: 0px;
413 border: @border-thickness solid @grey6;
413 border: @border-thickness solid @grey6;
414 .border-radius(@border-radius);
414 .border-radius(@border-radius);
415
415
416 #remove_gist {
416 #remove_gist {
417 float: right;
417 float: right;
418 }
418 }
419
419
420 .gist_url {
420 .gist_url {
421 padding: 0px 0px 35px 0px;
421 padding: 0px 0px 35px 0px;
422 }
422 }
423
423
424 .gist-desc {
424 .gist-desc {
425 clear: both;
425 clear: both;
426 margin: 0 0 10px 0;
426 margin: 0 0 10px 0;
427 code {
427 code {
428 white-space: pre-line;
428 white-space: pre-line;
429 line-height: inherit
429 line-height: inherit
430 }
430 }
431 }
431 }
432
432
433 .author {
433 .author {
434 clear: both;
434 clear: both;
435 vertical-align: middle;
435 vertical-align: middle;
436 font-weight: @text-bold-weight;
436 font-weight: @text-bold-weight;
437 font-family: @text-bold;
437 font-family: @text-bold;
438 }
438 }
439
439
440 .btn-mini {
440 .btn-mini {
441 float: left;
441 float: left;
442 margin: 0 5px 0 0;
442 margin: 0 5px 0 0;
443 }
443 }
444
444
445 .code-header {
445 .code-header {
446 padding: @padding;
446 padding: @padding;
447 border-bottom: @border-thickness solid @grey5;
447 border-bottom: @border-thickness solid @grey5;
448
448
449 .rc-user {
449 .rc-user {
450 min-width: 0;
450 min-width: 0;
451 margin-right: .5em;
451 margin-right: .5em;
452 }
452 }
453
453
454 .stats {
454 .stats {
455 clear: both;
455 clear: both;
456 margin: 0 0 @padding 0;
456 margin: 0 0 @padding 0;
457 padding: 0;
457 padding: 0;
458 .left {
458 .left {
459 float: left;
459 float: left;
460 clear: left;
460 clear: left;
461 max-width: 75%;
461 max-width: 75%;
462 margin: 0 0 @padding 0;
462 margin: 0 0 @padding 0;
463
463
464 &.item {
464 &.item {
465 margin-right: @padding;
465 margin-right: @padding;
466 &.last { border-right: none; }
466 &.last { border-right: none; }
467 }
467 }
468 }
468 }
469 .buttons { float: right; }
469 .buttons { float: right; }
470 .author {
470 .author {
471 height: 25px; margin-left: 15px; font-weight: bold;
471 height: 25px; margin-left: 15px; font-weight: bold;
472 }
472 }
473 }
473 }
474
474
475 .commit {
475 .commit {
476 margin: 5px 0 0 26px;
476 margin: 5px 0 0 26px;
477 font-weight: normal;
477 font-weight: normal;
478 white-space: pre-wrap;
478 white-space: pre-wrap;
479 }
479 }
480 }
480 }
481
481
482 .message {
482 .message {
483 position: relative;
483 position: relative;
484 margin: @padding;
484 margin: @padding;
485
485
486 .codeblock-label {
486 .codeblock-label {
487 margin: 0 0 1em 0;
487 margin: 0 0 1em 0;
488 }
488 }
489 }
489 }
490
490
491 .code-body {
491 .code-body {
492 padding: 0.8em 1em;
492 padding: 0.8em 1em;
493 background-color: #ffffff;
493 background-color: #ffffff;
494 min-width: 100%;
494 min-width: 100%;
495 box-sizing: border-box;
495 box-sizing: border-box;
496 // TODO: johbo: Parent has overflow: auto, this forces the child here
496 // TODO: johbo: Parent has overflow: auto, this forces the child here
497 // to have the intended size and to scroll. Should be simplified.
497 // to have the intended size and to scroll. Should be simplified.
498 width: 100%;
498 width: 100%;
499 overflow-x: auto;
499 overflow-x: auto;
500
500
501 img.rendered-binary {
501 img.rendered-binary {
502 height: auto;
502 height: auto;
503 width: auto;
503 width: auto;
504 }
504 }
505
505
506 .markdown-block {
506 .markdown-block {
507 padding: 1em 0;
507 padding: 1em 0;
508 }
508 }
509 }
509 }
510
510
511 .codeblock-header {
511 .codeblock-header {
512 background: @grey7;
512 background: @grey7;
513 height: 36px;
513 height: 36px;
514 }
514 }
515
515
516 .path {
516 .path {
517 border-bottom: 1px solid @grey6;
517 border-bottom: 1px solid @grey6;
518 padding: .65em 1em;
518 padding: .65em 1em;
519 height: 18px;
519 height: 18px;
520 }
520 }
521 }
521 }
522
522
523 .code-highlighttable,
523 .code-highlighttable,
524 div.codeblock {
524 div.codeblock {
525
525
526 &.readme {
526 &.readme {
527 background-color: white;
527 background-color: white;
528 }
528 }
529
529
530 .markdown-block table {
530 .markdown-block table {
531 border-collapse: collapse;
531 border-collapse: collapse;
532
532
533 th,
533 th,
534 td {
534 td {
535 padding: .5em;
535 padding: .5em;
536 border: @border-thickness solid @border-default-color;
536 border: @border-thickness solid @border-default-color;
537 }
537 }
538 }
538 }
539
539
540 table {
540 table {
541 border: 0px;
541 border: 0px;
542 margin: 0;
542 margin: 0;
543 letter-spacing: normal;
543 letter-spacing: normal;
544
544
545
545
546 td {
546 td {
547 border: 0px;
547 border: 0px;
548 vertical-align: top;
548 vertical-align: top;
549 }
549 }
550 }
550 }
551 }
551 }
552
552
553 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
553 div.codeblock .code-header .search-path { padding: 0 0 0 10px; }
554 div.search-code-body {
554 div.search-code-body {
555 background-color: #ffffff; padding: 5px 0 5px 10px;
555 background-color: #ffffff; padding: 5px 0 5px 10px;
556 pre {
556 pre {
557 .match { background-color: #faffa6;}
557 .match { background-color: #faffa6;}
558 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
558 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
559 }
559 }
560 .code-highlighttable {
560 .code-highlighttable {
561 border-collapse: collapse;
561 border-collapse: collapse;
562
562
563 tr:hover {
563 tr:hover {
564 background: #fafafa;
564 background: #fafafa;
565 }
565 }
566 td.code {
566 td.code {
567 padding-left: 10px;
567 padding-left: 10px;
568 }
568 }
569 td.line {
569 td.line {
570 border-right: 1px solid #ccc !important;
570 border-right: 1px solid #ccc !important;
571 padding-right: 10px;
571 padding-right: 10px;
572 text-align: right;
572 text-align: right;
573 font-family: @text-monospace;
573 font-family: @text-monospace;
574 span {
574 span {
575 white-space: pre-wrap;
575 white-space: pre-wrap;
576 color: #666666;
576 color: #666666;
577 }
577 }
578 }
578 }
579 }
579 }
580 }
580 }
581
581
582 div.annotatediv { margin-left: 2px; margin-right: 4px; }
582 div.annotatediv { margin-left: 2px; margin-right: 4px; }
583 .code-highlight {
583 .code-highlight {
584 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
584 margin: 0; padding: 0; border-left: @border-thickness solid @grey5;
585 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
585 pre, .linenodiv pre { padding: 0 5px; margin: 0; }
586 pre div:target {background-color: @comment-highlight-color !important;}
586 pre div:target {background-color: @comment-highlight-color !important;}
587 }
587 }
588
588
589 .linenos a { text-decoration: none; }
589 .linenos a { text-decoration: none; }
590
590
591 .CodeMirror-selected { background: @rchighlightblue; }
591 .CodeMirror-selected { background: @rchighlightblue; }
592 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
592 .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; }
593 .CodeMirror ::selection { background: @rchighlightblue; }
593 .CodeMirror ::selection { background: @rchighlightblue; }
594 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
594 .CodeMirror ::-moz-selection { background: @rchighlightblue; }
595
595
596 .code { display: block; border:0px !important; }
596 .code { display: block; border:0px !important; }
597
597
598 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
598 .code-highlight, /* TODO: dan: merge codehilite into code-highlight */
599 .codehilite {
599 .codehilite {
600 /*ElasticMatch is custom RhodeCode TAG*/
600 /*ElasticMatch is custom RhodeCode TAG*/
601
601
602 .c-ElasticMatch {
602 .c-ElasticMatch {
603 background-color: #faffa6;
603 background-color: #faffa6;
604 padding: 0.2em;
604 padding: 0.2em;
605 }
605 }
606 }
606 }
607
607
608 /* This can be generated with `pygmentize -S default -f html` */
608 /* This can be generated with `pygmentize -S default -f html` */
609 .code-highlight,
609 .code-highlight,
610 .codehilite {
610 .codehilite {
611 /*ElasticMatch is custom RhodeCode TAG*/
611 /*ElasticMatch is custom RhodeCode TAG*/
612 .c-ElasticMatch { background-color: #faffa6; padding: 0.2em;}
612 .c-ElasticMatch { background-color: #faffa6; padding: 0.2em;}
613 .hll { background-color: #ffffcc }
613 .hll { background-color: #ffffcc }
614 .c { color: #408080; font-style: italic } /* Comment */
614 .c { color: #408080; font-style: italic } /* Comment */
615 .err, .codehilite .err { border: none } /* Error */
615 .err, .codehilite .err { border: none } /* Error */
616 .k { color: #008000; font-weight: bold } /* Keyword */
616 .k { color: #008000; font-weight: bold } /* Keyword */
617 .o { color: #666666 } /* Operator */
617 .o { color: #666666 } /* Operator */
618 .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
618 .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
619 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
619 .cm { color: #408080; font-style: italic } /* Comment.Multiline */
620 .cp { color: #BC7A00 } /* Comment.Preproc */
620 .cp { color: #BC7A00 } /* Comment.Preproc */
621 .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
621 .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
622 .c1 { color: #408080; font-style: italic } /* Comment.Single */
622 .c1 { color: #408080; font-style: italic } /* Comment.Single */
623 .cs { color: #408080; font-style: italic } /* Comment.Special */
623 .cs { color: #408080; font-style: italic } /* Comment.Special */
624 .gd { color: #A00000 } /* Generic.Deleted */
624 .gd { color: #A00000 } /* Generic.Deleted */
625 .ge { font-style: italic } /* Generic.Emph */
625 .ge { font-style: italic } /* Generic.Emph */
626 .gr { color: #FF0000 } /* Generic.Error */
626 .gr { color: #FF0000 } /* Generic.Error */
627 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
627 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
628 .gi { color: #00A000 } /* Generic.Inserted */
628 .gi { color: #00A000 } /* Generic.Inserted */
629 .go { color: #888888 } /* Generic.Output */
629 .go { color: #888888 } /* Generic.Output */
630 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
630 .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
631 .gs { font-weight: bold } /* Generic.Strong */
631 .gs { font-weight: bold } /* Generic.Strong */
632 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
632 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
633 .gt { color: #0044DD } /* Generic.Traceback */
633 .gt { color: #0044DD } /* Generic.Traceback */
634 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
634 .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
635 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
635 .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
636 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
636 .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
637 .kp { color: #008000 } /* Keyword.Pseudo */
637 .kp { color: #008000 } /* Keyword.Pseudo */
638 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
638 .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
639 .kt { color: #B00040 } /* Keyword.Type */
639 .kt { color: #B00040 } /* Keyword.Type */
640 .m { color: #666666 } /* Literal.Number */
640 .m { color: #666666 } /* Literal.Number */
641 .s { color: #BA2121 } /* Literal.String */
641 .s { color: #BA2121 } /* Literal.String */
642 .na { color: #7D9029 } /* Name.Attribute */
642 .na { color: #7D9029 } /* Name.Attribute */
643 .nb { color: #008000 } /* Name.Builtin */
643 .nb { color: #008000 } /* Name.Builtin */
644 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
644 .nc { color: #0000FF; font-weight: bold } /* Name.Class */
645 .no { color: #880000 } /* Name.Constant */
645 .no { color: #880000 } /* Name.Constant */
646 .nd { color: #AA22FF } /* Name.Decorator */
646 .nd { color: #AA22FF } /* Name.Decorator */
647 .ni { color: #999999; font-weight: bold } /* Name.Entity */
647 .ni { color: #999999; font-weight: bold } /* Name.Entity */
648 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
648 .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
649 .nf { color: #0000FF } /* Name.Function */
649 .nf { color: #0000FF } /* Name.Function */
650 .nl { color: #A0A000 } /* Name.Label */
650 .nl { color: #A0A000 } /* Name.Label */
651 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
651 .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
652 .nt { color: #008000; font-weight: bold } /* Name.Tag */
652 .nt { color: #008000; font-weight: bold } /* Name.Tag */
653 .nv { color: #19177C } /* Name.Variable */
653 .nv { color: #19177C } /* Name.Variable */
654 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
654 .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
655 .w { color: #bbbbbb } /* Text.Whitespace */
655 .w { color: #bbbbbb } /* Text.Whitespace */
656 .mb { color: #666666 } /* Literal.Number.Bin */
656 .mb { color: #666666 } /* Literal.Number.Bin */
657 .mf { color: #666666 } /* Literal.Number.Float */
657 .mf { color: #666666 } /* Literal.Number.Float */
658 .mh { color: #666666 } /* Literal.Number.Hex */
658 .mh { color: #666666 } /* Literal.Number.Hex */
659 .mi { color: #666666 } /* Literal.Number.Integer */
659 .mi { color: #666666 } /* Literal.Number.Integer */
660 .mo { color: #666666 } /* Literal.Number.Oct */
660 .mo { color: #666666 } /* Literal.Number.Oct */
661 .sa { color: #BA2121 } /* Literal.String.Affix */
661 .sa { color: #BA2121 } /* Literal.String.Affix */
662 .sb { color: #BA2121 } /* Literal.String.Backtick */
662 .sb { color: #BA2121 } /* Literal.String.Backtick */
663 .sc { color: #BA2121 } /* Literal.String.Char */
663 .sc { color: #BA2121 } /* Literal.String.Char */
664 .dl { color: #BA2121 } /* Literal.String.Delimiter */
664 .dl { color: #BA2121 } /* Literal.String.Delimiter */
665 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
665 .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
666 .s2 { color: #BA2121 } /* Literal.String.Double */
666 .s2 { color: #BA2121 } /* Literal.String.Double */
667 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
667 .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
668 .sh { color: #BA2121 } /* Literal.String.Heredoc */
668 .sh { color: #BA2121 } /* Literal.String.Heredoc */
669 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
669 .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
670 .sx { color: #008000 } /* Literal.String.Other */
670 .sx { color: #008000 } /* Literal.String.Other */
671 .sr { color: #BB6688 } /* Literal.String.Regex */
671 .sr { color: #BB6688 } /* Literal.String.Regex */
672 .s1 { color: #BA2121 } /* Literal.String.Single */
672 .s1 { color: #BA2121 } /* Literal.String.Single */
673 .ss { color: #19177C } /* Literal.String.Symbol */
673 .ss { color: #19177C } /* Literal.String.Symbol */
674 .bp { color: #008000 } /* Name.Builtin.Pseudo */
674 .bp { color: #008000 } /* Name.Builtin.Pseudo */
675 .fm { color: #0000FF } /* Name.Function.Magic */
675 .fm { color: #0000FF } /* Name.Function.Magic */
676 .vc { color: #19177C } /* Name.Variable.Class */
676 .vc { color: #19177C } /* Name.Variable.Class */
677 .vg { color: #19177C } /* Name.Variable.Global */
677 .vg { color: #19177C } /* Name.Variable.Global */
678 .vi { color: #19177C } /* Name.Variable.Instance */
678 .vi { color: #19177C } /* Name.Variable.Instance */
679 .vm { color: #19177C } /* Name.Variable.Magic */
679 .vm { color: #19177C } /* Name.Variable.Magic */
680 .il { color: #666666 } /* Literal.Number.Integer.Long */
680 .il { color: #666666 } /* Literal.Number.Integer.Long */
681
681
682 }
682 }
683
683
684 /* customized pre blocks for markdown/rst */
684 /* customized pre blocks for markdown/rst */
685 pre.literal-block, .codehilite pre{
685 pre.literal-block, .codehilite pre{
686 padding: @padding;
686 padding: @padding;
687 border: 1px solid @grey6;
687 border: 1px solid @grey6;
688 .border-radius(@border-radius);
688 .border-radius(@border-radius);
689 background-color: @grey7;
689 background-color: @grey7;
690 }
690 }
691
691
692
692
693 /* START NEW CODE BLOCK CSS */
693 /* START NEW CODE BLOCK CSS */
694
694
695 @cb-line-height: 18px;
695 @cb-line-height: 18px;
696 @cb-line-code-padding: 10px;
696 @cb-line-code-padding: 10px;
697 @cb-text-padding: 5px;
697 @cb-text-padding: 5px;
698
698
699 @pill-padding: 2px 7px;
699 @pill-padding: 2px 7px;
700 @pill-padding-small: 2px 2px 1px 2px;
700 @pill-padding-small: 2px 2px 1px 2px;
701
701
702 input.filediff-collapse-state {
702 input.filediff-collapse-state {
703 display: none;
703 display: none;
704
704
705 &:checked + .filediff { /* file diff is collapsed */
705 &:checked + .filediff { /* file diff is collapsed */
706 .cb {
706 .cb {
707 display: none
707 display: none
708 }
708 }
709 .filediff-collapse-indicator {
709 .filediff-collapse-indicator {
710 float: left;
710 float: left;
711 cursor: pointer;
711 cursor: pointer;
712 margin: 1px -5px;
712 margin: 1px -5px;
713 }
713 }
714 .filediff-collapse-indicator:before {
714 .filediff-collapse-indicator:before {
715 content: '\f105';
715 content: '\f105';
716 }
716 }
717
717
718 .filediff-menu {
718 .filediff-menu {
719 display: none;
719 display: none;
720 }
720 }
721
721
722 }
722 }
723
723
724 &+ .filediff { /* file diff is expanded */
724 &+ .filediff { /* file diff is expanded */
725
725
726 .filediff-collapse-indicator {
726 .filediff-collapse-indicator {
727 float: left;
727 float: left;
728 cursor: pointer;
728 cursor: pointer;
729 margin: 1px -5px;
729 margin: 1px -5px;
730 }
730 }
731 .filediff-collapse-indicator:before {
731 .filediff-collapse-indicator:before {
732 content: '\f107';
732 content: '\f107';
733 }
733 }
734
734
735 .filediff-menu {
735 .filediff-menu {
736 display: block;
736 display: block;
737 }
737 }
738
738
739 margin: 10px 0;
739 margin: 10px 0;
740 &:nth-child(2) {
740 &:nth-child(2) {
741 margin: 0;
741 margin: 0;
742 }
742 }
743 }
743 }
744 }
744 }
745
745
746 .filediffs .anchor {
746 .filediffs .anchor {
747 display: block;
747 display: block;
748 height: 40px;
748 height: 40px;
749 margin-top: -40px;
749 margin-top: -40px;
750 visibility: hidden;
750 visibility: hidden;
751 }
751 }
752
752
753 .filediffs .anchor:nth-of-type(1) {
753 .filediffs .anchor:nth-of-type(1) {
754 display: block;
754 display: block;
755 height: 80px;
755 height: 80px;
756 margin-top: -80px;
756 margin-top: -80px;
757 visibility: hidden;
757 visibility: hidden;
758 }
758 }
759
759
760 .cs_files {
760 .cs_files {
761 clear: both;
761 clear: both;
762 }
762 }
763
763
764 #diff-file-sticky{
764 #diff-file-sticky{
765 will-change: min-height;
765 will-change: min-height;
766 height: 80px;
766 height: 80px;
767 }
767 }
768
768
769 .sidebar__inner{
769 .sidebar__inner{
770 transform: translate(0, 0); /* For browsers don't support translate3d. */
770 transform: translate(0, 0); /* For browsers don't support translate3d. */
771 transform: translate3d(0, 0, 0);
771 transform: translate3d(0, 0, 0);
772 will-change: position, transform;
772 will-change: position, transform;
773 height: 65px;
773 height: 65px;
774 background-color: #fff;
774 background-color: #fff;
775 padding: 5px 0px;
775 padding: 5px 0px;
776 }
776 }
777
777
778 .sidebar__bar {
778 .sidebar__bar {
779 padding: 5px 0px 0px 0px
779 padding: 5px 0px 0px 0px
780 }
780 }
781
781
782 .fpath-placeholder {
782 .fpath-placeholder {
783 clear: both;
783 clear: both;
784 visibility: hidden
784 visibility: hidden
785 }
785 }
786
786
787 .is-affixed {
787 .is-affixed {
788
788
789 .sidebar__inner {
789 .sidebar__inner {
790 z-index: 30;
790 z-index: 30;
791 }
791 }
792
792
793 .sidebar_inner_shadow {
793 .sidebar_inner_shadow {
794 position: fixed;
794 position: fixed;
795 top: 75px;
795 top: 75px;
796 right: -100%;
796 right: -100%;
797 left: -100%;
797 left: -100%;
798 z-index: 30;
798 z-index: 30;
799 display: block;
799 display: block;
800 height: 5px;
800 height: 5px;
801 content: "";
801 content: "";
802 background: linear-gradient(rgba(0, 0, 0, 0.075), rgba(0, 0, 0, 0.001)) repeat-x 0 0;
802 background: linear-gradient(rgba(0, 0, 0, 0.075), rgba(0, 0, 0, 0.001)) repeat-x 0 0;
803 border-top: 1px solid rgba(0, 0, 0, 0.15);
803 border-top: 1px solid rgba(0, 0, 0, 0.15);
804 }
804 }
805
805
806 .fpath-placeholder {
806 .fpath-placeholder {
807 visibility: visible !important;
807 visibility: visible !important;
808 }
808 }
809 }
809 }
810
810
811 .diffset-menu {
811 .diffset-menu {
812
812
813 }
813 }
814
814
815 #todo-box {
815 #todo-box {
816 clear:both;
816 clear:both;
817 display: none;
817 display: none;
818 text-align: right
818 text-align: right
819 }
819 }
820
820
821 .diffset {
821 .diffset {
822 margin: 0px auto;
822 margin: 0px auto;
823 .diffset-heading {
823 .diffset-heading {
824 border: 1px solid @grey5;
824 border: 1px solid @grey5;
825 margin-bottom: -1px;
825 margin-bottom: -1px;
826 // margin-top: 20px;
826 // margin-top: 20px;
827 h2 {
827 h2 {
828 margin: 0;
828 margin: 0;
829 line-height: 38px;
829 line-height: 38px;
830 padding-left: 10px;
830 padding-left: 10px;
831 }
831 }
832 .btn {
832 .btn {
833 margin: 0;
833 margin: 0;
834 }
834 }
835 background: @grey6;
835 background: @grey6;
836 display: block;
836 display: block;
837 padding: 5px;
837 padding: 5px;
838 }
838 }
839 .diffset-heading-warning {
839 .diffset-heading-warning {
840 background: @alert3-inner;
840 background: @alert3-inner;
841 border: 1px solid @alert3;
841 border: 1px solid @alert3;
842 }
842 }
843 &.diffset-comments-disabled {
843 &.diffset-comments-disabled {
844 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
844 .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button {
845 display: none !important;
845 display: none !important;
846 }
846 }
847 }
847 }
848 }
848 }
849
849
850 .filelist {
850 .filelist {
851 .pill {
851 .pill {
852 display: block;
852 display: block;
853 float: left;
853 float: left;
854 padding: @pill-padding-small;
854 padding: @pill-padding-small;
855 }
855 }
856 }
856 }
857
857
858 .pill {
858 .pill {
859 display: block;
859 display: block;
860 float: left;
860 float: left;
861 padding: @pill-padding;
861 padding: @pill-padding;
862 }
862 }
863
863
864 .pill-group {
864 .pill-group {
865 .pill {
865 .pill {
866 opacity: .8;
866 opacity: .8;
867 margin-right: 3px;
867 margin-right: 3px;
868 font-size: 12px;
868 font-size: 12px;
869 font-weight: normal;
869 font-weight: normal;
870 min-width: 30px;
870 min-width: 30px;
871 text-align: center;
871 text-align: center;
872
872
873 &:first-child {
873 &:first-child {
874 border-radius: @border-radius 0 0 @border-radius;
874 border-radius: @border-radius 0 0 @border-radius;
875 }
875 }
876 &:last-child {
876 &:last-child {
877 border-radius: 0 @border-radius @border-radius 0;
877 border-radius: 0 @border-radius @border-radius 0;
878 }
878 }
879 &:only-child {
879 &:only-child {
880 border-radius: @border-radius;
880 border-radius: @border-radius;
881 margin-right: 0;
881 margin-right: 0;
882 }
882 }
883 }
883 }
884 }
884 }
885
885
886 /* Main comments*/
886 /* Main comments*/
887 #comments {
887 #comments {
888 .comment-selected {
888 .comment-selected {
889 border-left: 6px solid @comment-highlight-color;
889 border-left: 6px solid @comment-highlight-color;
890 padding-left: 3px;
890 padding-left: 3px;
891 margin-left: -9px;
891 margin-left: -9px;
892 }
892 }
893 }
893 }
894
894
895 .filediff {
895 .filediff {
896 border: 1px solid @grey5;
896 border: 1px solid @grey5;
897
897
898 /* START OVERRIDES */
898 /* START OVERRIDES */
899 .code-highlight {
899 .code-highlight {
900 border: none; // TODO: remove this border from the global
900 border: none; // TODO: remove this border from the global
901 // .code-highlight, it doesn't belong there
901 // .code-highlight, it doesn't belong there
902 }
902 }
903 label {
903 label {
904 margin: 0; // TODO: remove this margin definition from global label
904 margin: 0; // TODO: remove this margin definition from global label
905 // it doesn't belong there - if margin on labels
905 // it doesn't belong there - if margin on labels
906 // are needed for a form they should be defined
906 // are needed for a form they should be defined
907 // in the form's class
907 // in the form's class
908 }
908 }
909 /* END OVERRIDES */
909 /* END OVERRIDES */
910
910
911 * {
911 * {
912 box-sizing: border-box;
912 box-sizing: border-box;
913 }
913 }
914
914
915 .on-hover-icon {
915 .on-hover-icon {
916 visibility: hidden;
916 visibility: hidden;
917 }
917 }
918
918
919 .filediff-anchor {
919 .filediff-anchor {
920 visibility: hidden;
920 visibility: hidden;
921 }
921 }
922 &:hover {
922 &:hover {
923 .filediff-anchor {
923 .filediff-anchor {
924 visibility: visible;
924 visibility: visible;
925 }
925 }
926 .on-hover-icon {
926 .on-hover-icon {
927 visibility: visible;
927 visibility: visible;
928 }
928 }
929 }
929 }
930
930
931 .filediff-heading {
931 .filediff-heading {
932 cursor: pointer;
932 cursor: pointer;
933 display: block;
933 display: block;
934 padding: 10px 10px;
934 padding: 10px 10px;
935 }
935 }
936 .filediff-heading:after {
936 .filediff-heading:after {
937 content: "";
937 content: "";
938 display: table;
938 display: table;
939 clear: both;
939 clear: both;
940 }
940 }
941 .filediff-heading:hover {
941 .filediff-heading:hover {
942 background: #e1e9f4 !important;
942 background: #e1e9f4 !important;
943 }
943 }
944
944
945 .filediff-menu {
945 .filediff-menu {
946 text-align: right;
946 text-align: right;
947 padding: 5px 5px 5px 0px;
947 padding: 5px 5px 5px 0px;
948 background: @grey7;
948 background: @grey7;
949
949
950 &> a,
950 &> a,
951 &> span {
951 &> span {
952 padding: 1px;
952 padding: 1px;
953 }
953 }
954 }
954 }
955
955
956 .filediff-collapse-button, .filediff-expand-button {
956 .filediff-collapse-button, .filediff-expand-button {
957 cursor: pointer;
957 cursor: pointer;
958 }
958 }
959 .filediff-collapse-button {
959 .filediff-collapse-button {
960 display: inline;
960 display: inline;
961 }
961 }
962 .filediff-expand-button {
962 .filediff-expand-button {
963 display: none;
963 display: none;
964 }
964 }
965 .filediff-collapsed .filediff-collapse-button {
965 .filediff-collapsed .filediff-collapse-button {
966 display: none;
966 display: none;
967 }
967 }
968 .filediff-collapsed .filediff-expand-button {
968 .filediff-collapsed .filediff-expand-button {
969 display: inline;
969 display: inline;
970 }
970 }
971
971
972 /**** COMMENTS ****/
972 /**** COMMENTS ****/
973
973
974 .filediff-menu {
974 .filediff-menu {
975 .show-comment-button {
975 .show-comment-button {
976 display: none;
976 display: none;
977 }
977 }
978 }
978 }
979 &.hide-comments {
979 &.hide-comments {
980 .inline-comments {
980 .inline-comments {
981 display: none;
981 display: none;
982 }
982 }
983 .filediff-menu {
983 .filediff-menu {
984 .show-comment-button {
984 .show-comment-button {
985 display: inline;
985 display: inline;
986 }
986 }
987 .hide-comment-button {
987 .hide-comment-button {
988 display: none;
988 display: none;
989 }
989 }
990 }
990 }
991 }
991 }
992
992
993 .hide-line-comments {
993 .hide-line-comments {
994 .inline-comments {
994 .inline-comments {
995 display: none;
995 display: none;
996 }
996 }
997 }
997 }
998
998
999 /**** END COMMENTS ****/
999 /**** END COMMENTS ****/
1000
1000
1001 }
1001 }
1002
1002
1003
1003
1004 .op-added {
1004 .op-added {
1005 color: @alert1;
1005 color: @alert1;
1006 }
1006 }
1007
1007
1008 .op-deleted {
1008 .op-deleted {
1009 color: @alert2;
1009 color: @alert2;
1010 }
1010 }
1011
1011
1012 .filediff, .filelist {
1012 .filediff, .filelist {
1013
1013
1014 .pill {
1014 .pill {
1015 &[op="name"] {
1015 &[op="name"] {
1016 background: none;
1016 background: none;
1017 opacity: 1;
1017 opacity: 1;
1018 color: white;
1018 color: white;
1019 }
1019 }
1020 &[op="limited"] {
1020 &[op="limited"] {
1021 background: @grey2;
1021 background: @grey2;
1022 color: white;
1022 color: white;
1023 }
1023 }
1024 &[op="binary"] {
1024 &[op="binary"] {
1025 background: @color7;
1025 background: @color7;
1026 color: white;
1026 color: white;
1027 }
1027 }
1028 &[op="modified"] {
1028 &[op="modified"] {
1029 background: @alert1;
1029 background: @alert1;
1030 color: white;
1030 color: white;
1031 }
1031 }
1032 &[op="renamed"] {
1032 &[op="renamed"] {
1033 background: @color4;
1033 background: @color4;
1034 color: white;
1034 color: white;
1035 }
1035 }
1036 &[op="copied"] {
1036 &[op="copied"] {
1037 background: @color4;
1037 background: @color4;
1038 color: white;
1038 color: white;
1039 }
1039 }
1040 &[op="mode"] {
1040 &[op="mode"] {
1041 background: @grey3;
1041 background: @grey3;
1042 color: white;
1042 color: white;
1043 }
1043 }
1044 &[op="symlink"] {
1044 &[op="symlink"] {
1045 background: @color8;
1045 background: @color8;
1046 color: white;
1046 color: white;
1047 }
1047 }
1048
1048
1049 &[op="added"] { /* added lines */
1049 &[op="added"] { /* added lines */
1050 background: @alert1;
1050 background: @alert1;
1051 color: white;
1051 color: white;
1052 }
1052 }
1053 &[op="deleted"] { /* deleted lines */
1053 &[op="deleted"] { /* deleted lines */
1054 background: @alert2;
1054 background: @alert2;
1055 color: white;
1055 color: white;
1056 }
1056 }
1057
1057
1058 &[op="created"] { /* created file */
1058 &[op="created"] { /* created file */
1059 background: @alert1;
1059 background: @alert1;
1060 color: white;
1060 color: white;
1061 }
1061 }
1062 &[op="removed"] { /* deleted file */
1062 &[op="removed"] { /* deleted file */
1063 background: @color5;
1063 background: @color5;
1064 color: white;
1064 color: white;
1065 }
1065 }
1066 &[op="comments"] { /* comments on file */
1067 background: @grey4;
1068 color: white;
1069 }
1066 }
1070 }
1067 }
1071 }
1068
1072
1069
1073
1070 .filediff-outdated {
1074 .filediff-outdated {
1071 padding: 8px 0;
1075 padding: 8px 0;
1072
1076
1073 .filediff-heading {
1077 .filediff-heading {
1074 opacity: .5;
1078 opacity: .5;
1075 }
1079 }
1076 }
1080 }
1077
1081
1078 table.cb {
1082 table.cb {
1079 width: 100%;
1083 width: 100%;
1080 border-collapse: collapse;
1084 border-collapse: collapse;
1081
1085
1082 .cb-text {
1086 .cb-text {
1083 padding: @cb-text-padding;
1087 padding: @cb-text-padding;
1084 }
1088 }
1085 .cb-hunk {
1089 .cb-hunk {
1086 padding: @cb-text-padding;
1090 padding: @cb-text-padding;
1087 }
1091 }
1088 .cb-expand {
1092 .cb-expand {
1089 display: none;
1093 display: none;
1090 }
1094 }
1091 .cb-collapse {
1095 .cb-collapse {
1092 display: inline;
1096 display: inline;
1093 }
1097 }
1094 &.cb-collapsed {
1098 &.cb-collapsed {
1095 .cb-line {
1099 .cb-line {
1096 display: none;
1100 display: none;
1097 }
1101 }
1098 .cb-expand {
1102 .cb-expand {
1099 display: inline;
1103 display: inline;
1100 }
1104 }
1101 .cb-collapse {
1105 .cb-collapse {
1102 display: none;
1106 display: none;
1103 }
1107 }
1104 .cb-hunk {
1108 .cb-hunk {
1105 display: none;
1109 display: none;
1106 }
1110 }
1107 }
1111 }
1108
1112
1109 /* intentionally general selector since .cb-line-selected must override it
1113 /* intentionally general selector since .cb-line-selected must override it
1110 and they both use !important since the td itself may have a random color
1114 and they both use !important since the td itself may have a random color
1111 generated by annotation blocks. TLDR: if you change it, make sure
1115 generated by annotation blocks. TLDR: if you change it, make sure
1112 annotated block selection and line selection in file view still work */
1116 annotated block selection and line selection in file view still work */
1113 .cb-line-fresh .cb-content {
1117 .cb-line-fresh .cb-content {
1114 background: white !important;
1118 background: white !important;
1115 }
1119 }
1116 .cb-warning {
1120 .cb-warning {
1117 background: #fff4dd;
1121 background: #fff4dd;
1118 }
1122 }
1119
1123
1120 &.cb-diff-sideside {
1124 &.cb-diff-sideside {
1121 td {
1125 td {
1122 &.cb-content {
1126 &.cb-content {
1123 width: 50%;
1127 width: 50%;
1124 }
1128 }
1125 }
1129 }
1126 }
1130 }
1127
1131
1128 tr {
1132 tr {
1129 &.cb-annotate {
1133 &.cb-annotate {
1130 border-top: 1px solid #eee;
1134 border-top: 1px solid #eee;
1131 }
1135 }
1132
1136
1133 &.cb-comment-info {
1137 &.cb-comment-info {
1134 border-top: 1px solid #eee;
1138 border-top: 1px solid #eee;
1135 color: rgba(0, 0, 0, 0.3);
1139 color: rgba(0, 0, 0, 0.3);
1136 background: #edf2f9;
1140 background: #edf2f9;
1137
1141
1138 td {
1142 td {
1139
1143
1140 }
1144 }
1141 }
1145 }
1142
1146
1143 &.cb-hunk {
1147 &.cb-hunk {
1144 font-family: @text-monospace;
1148 font-family: @text-monospace;
1145 color: rgba(0, 0, 0, 0.3);
1149 color: rgba(0, 0, 0, 0.3);
1146
1150
1147 td {
1151 td {
1148 &:first-child {
1152 &:first-child {
1149 background: #edf2f9;
1153 background: #edf2f9;
1150 }
1154 }
1151 &:last-child {
1155 &:last-child {
1152 background: #f4f7fb;
1156 background: #f4f7fb;
1153 }
1157 }
1154 }
1158 }
1155 }
1159 }
1156 }
1160 }
1157
1161
1158
1162
1159 td {
1163 td {
1160 vertical-align: top;
1164 vertical-align: top;
1161 padding: 0;
1165 padding: 0;
1162
1166
1163 &.cb-content {
1167 &.cb-content {
1164 font-size: 12.35px;
1168 font-size: 12.35px;
1165
1169
1166 &.cb-line-selected .cb-code {
1170 &.cb-line-selected .cb-code {
1167 background: @comment-highlight-color !important;
1171 background: @comment-highlight-color !important;
1168 }
1172 }
1169
1173
1170 span.cb-code {
1174 span.cb-code {
1171 line-height: @cb-line-height;
1175 line-height: @cb-line-height;
1172 padding-left: @cb-line-code-padding;
1176 padding-left: @cb-line-code-padding;
1173 padding-right: @cb-line-code-padding;
1177 padding-right: @cb-line-code-padding;
1174 display: block;
1178 display: block;
1175 white-space: pre-wrap;
1179 white-space: pre-wrap;
1176 font-family: @text-monospace;
1180 font-family: @text-monospace;
1177 word-break: break-all;
1181 word-break: break-all;
1178 .nonl {
1182 .nonl {
1179 color: @color5;
1183 color: @color5;
1180 }
1184 }
1181 .cb-action {
1185 .cb-action {
1182 &:before {
1186 &:before {
1183 content: " ";
1187 content: " ";
1184 }
1188 }
1185 &.cb-deletion:before {
1189 &.cb-deletion:before {
1186 content: "- ";
1190 content: "- ";
1187 }
1191 }
1188 &.cb-addition:before {
1192 &.cb-addition:before {
1189 content: "+ ";
1193 content: "+ ";
1190 }
1194 }
1191 }
1195 }
1192 }
1196 }
1193
1197
1194 &> button.cb-comment-box-opener {
1198 &> button.cb-comment-box-opener {
1195
1199
1196 padding: 2px 2px 1px 3px;
1200 padding: 2px 2px 1px 3px;
1197 margin-left: -6px;
1201 margin-left: -6px;
1198 margin-top: -1px;
1202 margin-top: -1px;
1199
1203
1200 border-radius: @border-radius;
1204 border-radius: @border-radius;
1201 position: absolute;
1205 position: absolute;
1202 display: none;
1206 display: none;
1203 }
1207 }
1204 .cb-comment {
1208 .cb-comment {
1205 margin-top: 10px;
1209 margin-top: 10px;
1206 white-space: normal;
1210 white-space: normal;
1207 }
1211 }
1208 }
1212 }
1209 &:hover {
1213 &:hover {
1210 button.cb-comment-box-opener {
1214 button.cb-comment-box-opener {
1211 display: block;
1215 display: block;
1212 }
1216 }
1213 &+ td button.cb-comment-box-opener {
1217 &+ td button.cb-comment-box-opener {
1214 display: block
1218 display: block
1215 }
1219 }
1216 }
1220 }
1217
1221
1218 &.cb-data {
1222 &.cb-data {
1219 text-align: right;
1223 text-align: right;
1220 width: 30px;
1224 width: 30px;
1221 font-family: @text-monospace;
1225 font-family: @text-monospace;
1222
1226
1223 .icon-comment {
1227 .icon-comment {
1224 cursor: pointer;
1228 cursor: pointer;
1225 }
1229 }
1226 &.cb-line-selected {
1230 &.cb-line-selected {
1227 background: @comment-highlight-color !important;
1231 background: @comment-highlight-color !important;
1228 }
1232 }
1229 &.cb-line-selected > div {
1233 &.cb-line-selected > div {
1230 display: block;
1234 display: block;
1231 background: @comment-highlight-color !important;
1235 background: @comment-highlight-color !important;
1232 line-height: @cb-line-height;
1236 line-height: @cb-line-height;
1233 color: rgba(0, 0, 0, 0.3);
1237 color: rgba(0, 0, 0, 0.3);
1234 }
1238 }
1235 }
1239 }
1236
1240
1237 &.cb-lineno {
1241 &.cb-lineno {
1238 padding: 0;
1242 padding: 0;
1239 width: 50px;
1243 width: 50px;
1240 color: rgba(0, 0, 0, 0.3);
1244 color: rgba(0, 0, 0, 0.3);
1241 text-align: right;
1245 text-align: right;
1242 border-right: 1px solid #eee;
1246 border-right: 1px solid #eee;
1243 font-family: @text-monospace;
1247 font-family: @text-monospace;
1244 -webkit-user-select: none;
1248 -webkit-user-select: none;
1245 -moz-user-select: none;
1249 -moz-user-select: none;
1246 user-select: none;
1250 user-select: none;
1247
1251
1248 a::before {
1252 a::before {
1249 content: attr(data-line-no);
1253 content: attr(data-line-no);
1250 }
1254 }
1251 &.cb-line-selected {
1255 &.cb-line-selected {
1252 background: @comment-highlight-color !important;
1256 background: @comment-highlight-color !important;
1253 }
1257 }
1254
1258
1255 a {
1259 a {
1256 display: block;
1260 display: block;
1257 padding-right: @cb-line-code-padding;
1261 padding-right: @cb-line-code-padding;
1258 padding-left: @cb-line-code-padding;
1262 padding-left: @cb-line-code-padding;
1259 line-height: @cb-line-height;
1263 line-height: @cb-line-height;
1260 color: rgba(0, 0, 0, 0.3);
1264 color: rgba(0, 0, 0, 0.3);
1261 }
1265 }
1262 }
1266 }
1263
1267
1264 &.cb-empty {
1268 &.cb-empty {
1265 background: @grey7;
1269 background: @grey7;
1266 }
1270 }
1267
1271
1268 ins {
1272 ins {
1269 color: black;
1273 color: black;
1270 background: #a6f3a6;
1274 background: #a6f3a6;
1271 text-decoration: none;
1275 text-decoration: none;
1272 }
1276 }
1273 del {
1277 del {
1274 color: black;
1278 color: black;
1275 background: #f8cbcb;
1279 background: #f8cbcb;
1276 text-decoration: none;
1280 text-decoration: none;
1277 }
1281 }
1278 &.cb-addition {
1282 &.cb-addition {
1279 background: #ecffec;
1283 background: #ecffec;
1280
1284
1281 &.blob-lineno {
1285 &.blob-lineno {
1282 background: #ddffdd;
1286 background: #ddffdd;
1283 }
1287 }
1284 }
1288 }
1285 &.cb-deletion {
1289 &.cb-deletion {
1286 background: #ffecec;
1290 background: #ffecec;
1287
1291
1288 &.blob-lineno {
1292 &.blob-lineno {
1289 background: #ffdddd;
1293 background: #ffdddd;
1290 }
1294 }
1291 }
1295 }
1292 &.cb-annotate-message-spacer {
1296 &.cb-annotate-message-spacer {
1293 width:8px;
1297 width:8px;
1294 padding: 1px 0px 0px 3px;
1298 padding: 1px 0px 0px 3px;
1295 }
1299 }
1296 &.cb-annotate-info {
1300 &.cb-annotate-info {
1297 width: 320px;
1301 width: 320px;
1298 min-width: 320px;
1302 min-width: 320px;
1299 max-width: 320px;
1303 max-width: 320px;
1300 padding: 5px 2px;
1304 padding: 5px 2px;
1301 font-size: 13px;
1305 font-size: 13px;
1302
1306
1303 .cb-annotate-message {
1307 .cb-annotate-message {
1304 padding: 2px 0px 0px 0px;
1308 padding: 2px 0px 0px 0px;
1305 white-space: pre-line;
1309 white-space: pre-line;
1306 overflow: hidden;
1310 overflow: hidden;
1307 }
1311 }
1308 .rc-user {
1312 .rc-user {
1309 float: none;
1313 float: none;
1310 padding: 0 6px 0 17px;
1314 padding: 0 6px 0 17px;
1311 min-width: unset;
1315 min-width: unset;
1312 min-height: unset;
1316 min-height: unset;
1313 }
1317 }
1314 }
1318 }
1315
1319
1316 &.cb-annotate-revision {
1320 &.cb-annotate-revision {
1317 cursor: pointer;
1321 cursor: pointer;
1318 text-align: right;
1322 text-align: right;
1319 padding: 1px 3px 0px 3px;
1323 padding: 1px 3px 0px 3px;
1320 }
1324 }
1321 }
1325 }
1322 }
1326 }
@@ -1,634 +1,635 b''
1 // comments.less
1 // comments.less
2 // For use in RhodeCode applications;
2 // For use in RhodeCode applications;
3 // see style guide documentation for guidelines.
3 // see style guide documentation for guidelines.
4
4
5
5
6 // Comments
6 // Comments
7 @comment-outdated-opacity: 0.6;
7 @comment-outdated-opacity: 0.6;
8
8
9 .comments {
9 .comments {
10 width: 100%;
10 width: 100%;
11 }
11 }
12
12
13 .comments-heading {
13 .comments-heading {
14 margin-bottom: -1px;
14 margin-bottom: -1px;
15 background: @grey6;
15 background: @grey6;
16 display: block;
16 display: block;
17 padding: 10px 0px;
17 padding: 10px 0px;
18 font-size: 18px
18 font-size: 18px
19 }
19 }
20
20
21 #comment-tr-show {
21 #comment-tr-show {
22 padding: 5px 0;
22 padding: 5px 0;
23 }
23 }
24
24
25 tr.inline-comments div {
25 tr.inline-comments div {
26 max-width: 100%;
26 max-width: 100%;
27
27
28 p {
28 p {
29 white-space: normal;
29 white-space: normal;
30 }
30 }
31
31
32 code, pre, .code, dd {
32 code, pre, .code, dd {
33 overflow-x: auto;
33 overflow-x: auto;
34 width: 1062px;
34 width: 1062px;
35 }
35 }
36
36
37 dd {
37 dd {
38 width: auto;
38 width: auto;
39 }
39 }
40 }
40 }
41
41
42 #injected_page_comments {
42 #injected_page_comments {
43 .comment-previous-link,
43 .comment-previous-link,
44 .comment-next-link,
44 .comment-next-link,
45 .comment-links-divider {
45 .comment-links-divider {
46 display: none;
46 display: none;
47 }
47 }
48 }
48 }
49
49
50 .add-comment {
50 .add-comment {
51 margin-bottom: 10px;
51 margin-bottom: 10px;
52 }
52 }
53 .hide-comment-button .add-comment {
53 .hide-comment-button .add-comment {
54 display: none;
54 display: none;
55 }
55 }
56
56
57 .comment-bubble {
57 .comment-bubble {
58 color: @grey4;
58 color: @grey4;
59 margin-top: 4px;
59 margin-top: 4px;
60 margin-right: 30px;
60 margin-right: 30px;
61 visibility: hidden;
61 visibility: hidden;
62 }
62 }
63
63
64 .comment-label {
64 .comment-label {
65 float: left;
65 float: left;
66
66
67 padding: 0.4em 0.4em;
67 padding: 0.4em 0.4em;
68 margin: 3px 5px 0px -10px;
68 margin: 2px 4px 0px 0px;
69 display: inline-block;
69 display: inline-block;
70 min-height: 0;
70 min-height: 0;
71
71
72 text-align: center;
72 text-align: center;
73 font-size: 10px;
73 font-size: 10px;
74 line-height: .8em;
74 line-height: .8em;
75
75
76 font-family: @text-italic;
76 font-family: @text-italic;
77 font-style: italic;
77 font-style: italic;
78 background: #fff none;
78 background: #fff none;
79 color: @grey4;
79 color: @grey3;
80 border: 1px solid @grey4;
80 border: 1px solid @grey4;
81 white-space: nowrap;
81 white-space: nowrap;
82
82
83 text-transform: uppercase;
83 text-transform: uppercase;
84 min-width: 40px;
84 min-width: 50px;
85 border-radius: 4px;
85
86
86 &.todo {
87 &.todo {
87 color: @color5;
88 color: @color5;
88 font-style: italic;
89 font-style: italic;
89 font-weight: @text-bold-italic-weight;
90 font-weight: @text-bold-italic-weight;
90 font-family: @text-bold-italic;
91 font-family: @text-bold-italic;
91 }
92 }
92
93
93 .resolve {
94 .resolve {
94 cursor: pointer;
95 cursor: pointer;
95 text-decoration: underline;
96 text-decoration: underline;
96 }
97 }
97
98
98 .resolved {
99 .resolved {
99 text-decoration: line-through;
100 text-decoration: line-through;
100 color: @color1;
101 color: @color1;
101 }
102 }
102 .resolved a {
103 .resolved a {
103 text-decoration: line-through;
104 text-decoration: line-through;
104 color: @color1;
105 color: @color1;
105 }
106 }
106 .resolve-text {
107 .resolve-text {
107 color: @color1;
108 color: @color1;
108 margin: 2px 8px;
109 margin: 2px 8px;
109 font-family: @text-italic;
110 font-family: @text-italic;
110 font-style: italic;
111 font-style: italic;
111 }
112 }
112 }
113 }
113
114
114 .has-spacer-after {
115 .has-spacer-after {
115 &:after {
116 &:after {
116 content: ' | ';
117 content: ' | ';
117 color: @grey5;
118 color: @grey5;
118 }
119 }
119 }
120 }
120
121
121 .has-spacer-before {
122 .has-spacer-before {
122 &:before {
123 &:before {
123 content: ' | ';
124 content: ' | ';
124 color: @grey5;
125 color: @grey5;
125 }
126 }
126 }
127 }
127
128
128 .comment {
129 .comment {
129
130
130 &.comment-general {
131 &.comment-general {
131 border: 1px solid @grey5;
132 border: 1px solid @grey5;
132 padding: 5px 5px 5px 5px;
133 padding: 5px 5px 5px 5px;
133 }
134 }
134
135
135 margin: @padding 0;
136 margin: @padding 0;
136 padding: 4px 0 0 0;
137 padding: 4px 0 0 0;
137 line-height: 1em;
138 line-height: 1em;
138
139
139 .rc-user {
140 .rc-user {
140 min-width: 0;
141 min-width: 0;
141 margin: 0px .5em 0 0;
142 margin: 0px .5em 0 0;
142
143
143 .user {
144 .user {
144 display: inline;
145 display: inline;
145 }
146 }
146 }
147 }
147
148
148 .meta {
149 .meta {
149 position: relative;
150 position: relative;
150 width: 100%;
151 width: 100%;
151 border-bottom: 1px solid @grey5;
152 border-bottom: 1px solid @grey5;
152 margin: -5px 0px;
153 margin: -5px 0px;
153 line-height: 24px;
154 line-height: 24px;
154
155
155 &:hover .permalink {
156 &:hover .permalink {
156 visibility: visible;
157 visibility: visible;
157 color: @rcblue;
158 color: @rcblue;
158 }
159 }
159 }
160 }
160
161
161 .author,
162 .author,
162 .date {
163 .date {
163 display: inline;
164 display: inline;
164
165
165 &:after {
166 &:after {
166 content: ' | ';
167 content: ' | ';
167 color: @grey5;
168 color: @grey5;
168 }
169 }
169 }
170 }
170
171
171 .author-general img {
172 .author-general img {
172 top: 3px;
173 top: 3px;
173 }
174 }
174 .author-inline img {
175 .author-inline img {
175 top: 3px;
176 top: 3px;
176 }
177 }
177
178
178 .status-change,
179 .status-change,
179 .permalink,
180 .permalink,
180 .changeset-status-lbl {
181 .changeset-status-lbl {
181 display: inline;
182 display: inline;
182 }
183 }
183
184
184 .permalink {
185 .permalink {
185 visibility: hidden;
186 visibility: hidden;
186 }
187 }
187
188
188 .comment-links-divider {
189 .comment-links-divider {
189 display: inline;
190 display: inline;
190 }
191 }
191
192
192 .comment-links-block {
193 .comment-links-block {
193 float:right;
194 float:right;
194 text-align: right;
195 text-align: right;
195 min-width: 85px;
196 min-width: 85px;
196
197
197 [class^="icon-"]:before,
198 [class^="icon-"]:before,
198 [class*=" icon-"]:before {
199 [class*=" icon-"]:before {
199 margin-left: 0;
200 margin-left: 0;
200 margin-right: 0;
201 margin-right: 0;
201 }
202 }
202 }
203 }
203
204
204 .comment-previous-link {
205 .comment-previous-link {
205 display: inline-block;
206 display: inline-block;
206
207
207 .arrow_comment_link{
208 .arrow_comment_link{
208 cursor: pointer;
209 cursor: pointer;
209 i {
210 i {
210 font-size:10px;
211 font-size:10px;
211 }
212 }
212 }
213 }
213 .arrow_comment_link.disabled {
214 .arrow_comment_link.disabled {
214 cursor: default;
215 cursor: default;
215 color: @grey5;
216 color: @grey5;
216 }
217 }
217 }
218 }
218
219
219 .comment-next-link {
220 .comment-next-link {
220 display: inline-block;
221 display: inline-block;
221
222
222 .arrow_comment_link{
223 .arrow_comment_link{
223 cursor: pointer;
224 cursor: pointer;
224 i {
225 i {
225 font-size:10px;
226 font-size:10px;
226 }
227 }
227 }
228 }
228 .arrow_comment_link.disabled {
229 .arrow_comment_link.disabled {
229 cursor: default;
230 cursor: default;
230 color: @grey5;
231 color: @grey5;
231 }
232 }
232 }
233 }
233
234
234 .delete-comment {
235 .delete-comment {
235 display: inline-block;
236 display: inline-block;
236 color: @rcblue;
237 color: @rcblue;
237
238
238 &:hover {
239 &:hover {
239 cursor: pointer;
240 cursor: pointer;
240 }
241 }
241 }
242 }
242
243
243 .text {
244 .text {
244 clear: both;
245 clear: both;
245 .border-radius(@border-radius);
246 .border-radius(@border-radius);
246 .box-sizing(border-box);
247 .box-sizing(border-box);
247
248
248 .markdown-block p,
249 .markdown-block p,
249 .rst-block p {
250 .rst-block p {
250 margin: .5em 0 !important;
251 margin: .5em 0 !important;
251 // TODO: lisa: This is needed because of other rst !important rules :[
252 // TODO: lisa: This is needed because of other rst !important rules :[
252 }
253 }
253 }
254 }
254
255
255 .pr-version {
256 .pr-version {
256 display: inline-block;
257 display: inline-block;
257 }
258 }
258 .pr-version-inline {
259 .pr-version-inline {
259 display: inline-block;
260 display: inline-block;
260 }
261 }
261 .pr-version-num {
262 .pr-version-num {
262 font-size: 10px;
263 font-size: 10px;
263 }
264 }
264 }
265 }
265
266
266 @comment-padding: 5px;
267 @comment-padding: 5px;
267
268
268 .general-comments {
269 .general-comments {
269 .comment-outdated {
270 .comment-outdated {
270 opacity: @comment-outdated-opacity;
271 opacity: @comment-outdated-opacity;
271 }
272 }
272 }
273 }
273
274
274 .inline-comments {
275 .inline-comments {
275 border-radius: @border-radius;
276 border-radius: @border-radius;
276 .comment {
277 .comment {
277 margin: 0;
278 margin: 0;
278 border-radius: @border-radius;
279 border-radius: @border-radius;
279 }
280 }
280 .comment-outdated {
281 .comment-outdated {
281 opacity: @comment-outdated-opacity;
282 opacity: @comment-outdated-opacity;
282 }
283 }
283
284
284 .comment-inline {
285 .comment-inline {
285 background: white;
286 background: white;
286 padding: @comment-padding @comment-padding;
287 padding: @comment-padding @comment-padding;
287 border: @comment-padding solid @grey6;
288 border: @comment-padding solid @grey6;
288
289
289 .text {
290 .text {
290 border: none;
291 border: none;
291 }
292 }
292 .meta {
293 .meta {
293 border-bottom: 1px solid @grey6;
294 border-bottom: 1px solid @grey6;
294 margin: -5px 0px;
295 margin: -5px 0px;
295 line-height: 24px;
296 line-height: 24px;
296 }
297 }
297 }
298 }
298 .comment-selected {
299 .comment-selected {
299 border-left: 6px solid @comment-highlight-color;
300 border-left: 6px solid @comment-highlight-color;
300 }
301 }
301 .comment-inline-form {
302 .comment-inline-form {
302 padding: @comment-padding;
303 padding: @comment-padding;
303 display: none;
304 display: none;
304 }
305 }
305 .cb-comment-add-button {
306 .cb-comment-add-button {
306 margin: @comment-padding;
307 margin: @comment-padding;
307 }
308 }
308 /* hide add comment button when form is open */
309 /* hide add comment button when form is open */
309 .comment-inline-form-open ~ .cb-comment-add-button {
310 .comment-inline-form-open ~ .cb-comment-add-button {
310 display: none;
311 display: none;
311 }
312 }
312 .comment-inline-form-open {
313 .comment-inline-form-open {
313 display: block;
314 display: block;
314 }
315 }
315 /* hide add comment button when form but no comments */
316 /* hide add comment button when form but no comments */
316 .comment-inline-form:first-child + .cb-comment-add-button {
317 .comment-inline-form:first-child + .cb-comment-add-button {
317 display: none;
318 display: none;
318 }
319 }
319 /* hide add comment button when no comments or form */
320 /* hide add comment button when no comments or form */
320 .cb-comment-add-button:first-child {
321 .cb-comment-add-button:first-child {
321 display: none;
322 display: none;
322 }
323 }
323 /* hide add comment button when only comment is being deleted */
324 /* hide add comment button when only comment is being deleted */
324 .comment-deleting:first-child + .cb-comment-add-button {
325 .comment-deleting:first-child + .cb-comment-add-button {
325 display: none;
326 display: none;
326 }
327 }
327 }
328 }
328
329
329
330
330 .show-outdated-comments {
331 .show-outdated-comments {
331 display: inline;
332 display: inline;
332 color: @rcblue;
333 color: @rcblue;
333 }
334 }
334
335
335 // Comment Form
336 // Comment Form
336 div.comment-form {
337 div.comment-form {
337 margin-top: 20px;
338 margin-top: 20px;
338 }
339 }
339
340
340 .comment-form strong {
341 .comment-form strong {
341 display: block;
342 display: block;
342 margin-bottom: 15px;
343 margin-bottom: 15px;
343 }
344 }
344
345
345 .comment-form textarea {
346 .comment-form textarea {
346 width: 100%;
347 width: 100%;
347 height: 100px;
348 height: 100px;
348 font-family: @text-monospace;
349 font-family: @text-monospace;
349 }
350 }
350
351
351 form.comment-form {
352 form.comment-form {
352 margin-top: 10px;
353 margin-top: 10px;
353 margin-left: 10px;
354 margin-left: 10px;
354 }
355 }
355
356
356 .comment-inline-form .comment-block-ta,
357 .comment-inline-form .comment-block-ta,
357 .comment-form .comment-block-ta,
358 .comment-form .comment-block-ta,
358 .comment-form .preview-box {
359 .comment-form .preview-box {
359 .border-radius(@border-radius);
360 .border-radius(@border-radius);
360 .box-sizing(border-box);
361 .box-sizing(border-box);
361 background-color: white;
362 background-color: white;
362 }
363 }
363
364
364 .comment-form-submit {
365 .comment-form-submit {
365 margin-top: 5px;
366 margin-top: 5px;
366 margin-left: 525px;
367 margin-left: 525px;
367 }
368 }
368
369
369 .file-comments {
370 .file-comments {
370 display: none;
371 display: none;
371 }
372 }
372
373
373 .comment-form .preview-box.unloaded,
374 .comment-form .preview-box.unloaded,
374 .comment-inline-form .preview-box.unloaded {
375 .comment-inline-form .preview-box.unloaded {
375 height: 50px;
376 height: 50px;
376 text-align: center;
377 text-align: center;
377 padding: 20px;
378 padding: 20px;
378 background-color: white;
379 background-color: white;
379 }
380 }
380
381
381 .comment-footer {
382 .comment-footer {
382 position: relative;
383 position: relative;
383 width: 100%;
384 width: 100%;
384 min-height: 42px;
385 min-height: 42px;
385
386
386 .status_box,
387 .status_box,
387 .cancel-button {
388 .cancel-button {
388 float: left;
389 float: left;
389 display: inline-block;
390 display: inline-block;
390 }
391 }
391
392
392 .status_box {
393 .status_box {
393 margin-left: 10px;
394 margin-left: 10px;
394 }
395 }
395
396
396 .action-buttons {
397 .action-buttons {
397 float: left;
398 float: left;
398 display: inline-block;
399 display: inline-block;
399 }
400 }
400
401
401 .action-buttons-extra {
402 .action-buttons-extra {
402 display: inline-block;
403 display: inline-block;
403 }
404 }
404 }
405 }
405
406
406 .comment-form {
407 .comment-form {
407
408
408 .comment {
409 .comment {
409 margin-left: 10px;
410 margin-left: 10px;
410 }
411 }
411
412
412 .comment-help {
413 .comment-help {
413 color: @grey4;
414 color: @grey4;
414 padding: 5px 0 5px 0;
415 padding: 5px 0 5px 0;
415 }
416 }
416
417
417 .comment-title {
418 .comment-title {
418 padding: 5px 0 5px 0;
419 padding: 5px 0 5px 0;
419 }
420 }
420
421
421 .comment-button {
422 .comment-button {
422 display: inline-block;
423 display: inline-block;
423 }
424 }
424
425
425 .comment-button-input {
426 .comment-button-input {
426 margin-right: 0;
427 margin-right: 0;
427 }
428 }
428
429
429 .comment-footer {
430 .comment-footer {
430 margin-bottom: 50px;
431 margin-bottom: 50px;
431 margin-top: 10px;
432 margin-top: 10px;
432 }
433 }
433 }
434 }
434
435
435
436
436 .comment-form-login {
437 .comment-form-login {
437 .comment-help {
438 .comment-help {
438 padding: 0.7em; //same as the button
439 padding: 0.7em; //same as the button
439 }
440 }
440
441
441 div.clearfix {
442 div.clearfix {
442 clear: both;
443 clear: both;
443 width: 100%;
444 width: 100%;
444 display: block;
445 display: block;
445 }
446 }
446 }
447 }
447
448
448 .comment-version-select {
449 .comment-version-select {
449 margin: 0px;
450 margin: 0px;
450 border-radius: inherit;
451 border-radius: inherit;
451 border-color: @grey6;
452 border-color: @grey6;
452 height: 20px;
453 height: 20px;
453 }
454 }
454
455
455 .comment-type {
456 .comment-type {
456 margin: 0px;
457 margin: 0px;
457 border-radius: inherit;
458 border-radius: inherit;
458 border-color: @grey6;
459 border-color: @grey6;
459 }
460 }
460
461
461 .preview-box {
462 .preview-box {
462 min-height: 105px;
463 min-height: 105px;
463 margin-bottom: 15px;
464 margin-bottom: 15px;
464 background-color: white;
465 background-color: white;
465 .border-radius(@border-radius);
466 .border-radius(@border-radius);
466 .box-sizing(border-box);
467 .box-sizing(border-box);
467 }
468 }
468
469
469 .add-another-button {
470 .add-another-button {
470 margin-left: 10px;
471 margin-left: 10px;
471 margin-top: 10px;
472 margin-top: 10px;
472 margin-bottom: 10px;
473 margin-bottom: 10px;
473 }
474 }
474
475
475 .comment .buttons {
476 .comment .buttons {
476 float: right;
477 float: right;
477 margin: -1px 0px 0px 0px;
478 margin: -1px 0px 0px 0px;
478 }
479 }
479
480
480 // Inline Comment Form
481 // Inline Comment Form
481 .injected_diff .comment-inline-form,
482 .injected_diff .comment-inline-form,
482 .comment-inline-form {
483 .comment-inline-form {
483 background-color: white;
484 background-color: white;
484 margin-top: 10px;
485 margin-top: 10px;
485 margin-bottom: 20px;
486 margin-bottom: 20px;
486 }
487 }
487
488
488 .inline-form {
489 .inline-form {
489 padding: 10px 7px;
490 padding: 10px 7px;
490 }
491 }
491
492
492 .inline-form div {
493 .inline-form div {
493 max-width: 100%;
494 max-width: 100%;
494 }
495 }
495
496
496 .overlay {
497 .overlay {
497 display: none;
498 display: none;
498 position: absolute;
499 position: absolute;
499 width: 100%;
500 width: 100%;
500 text-align: center;
501 text-align: center;
501 vertical-align: middle;
502 vertical-align: middle;
502 font-size: 16px;
503 font-size: 16px;
503 background: none repeat scroll 0 0 white;
504 background: none repeat scroll 0 0 white;
504
505
505 &.submitting {
506 &.submitting {
506 display: block;
507 display: block;
507 opacity: 0.5;
508 opacity: 0.5;
508 z-index: 100;
509 z-index: 100;
509 }
510 }
510 }
511 }
511 .comment-inline-form .overlay.submitting .overlay-text {
512 .comment-inline-form .overlay.submitting .overlay-text {
512 margin-top: 5%;
513 margin-top: 5%;
513 }
514 }
514
515
515 .comment-inline-form .clearfix,
516 .comment-inline-form .clearfix,
516 .comment-form .clearfix {
517 .comment-form .clearfix {
517 .border-radius(@border-radius);
518 .border-radius(@border-radius);
518 margin: 0px;
519 margin: 0px;
519 }
520 }
520
521
521 .comment-inline-form .comment-footer {
522 .comment-inline-form .comment-footer {
522 margin: 10px 0px 0px 0px;
523 margin: 10px 0px 0px 0px;
523 }
524 }
524
525
525 .hide-inline-form-button {
526 .hide-inline-form-button {
526 margin-left: 5px;
527 margin-left: 5px;
527 }
528 }
528 .comment-button .hide-inline-form {
529 .comment-button .hide-inline-form {
529 background: white;
530 background: white;
530 }
531 }
531
532
532 .comment-area {
533 .comment-area {
533 padding: 6px 8px;
534 padding: 6px 8px;
534 border: 1px solid @grey5;
535 border: 1px solid @grey5;
535 .border-radius(@border-radius);
536 .border-radius(@border-radius);
536
537
537 .resolve-action {
538 .resolve-action {
538 padding: 1px 0px 0px 6px;
539 padding: 1px 0px 0px 6px;
539 }
540 }
540
541
541 }
542 }
542
543
543 comment-area-text {
544 comment-area-text {
544 color: @grey3;
545 color: @grey3;
545 }
546 }
546
547
547 .comment-area-header {
548 .comment-area-header {
548 height: 35px;
549 height: 35px;
549 }
550 }
550
551
551 .comment-area-header .nav-links {
552 .comment-area-header .nav-links {
552 display: flex;
553 display: flex;
553 flex-flow: row wrap;
554 flex-flow: row wrap;
554 -webkit-flex-flow: row wrap;
555 -webkit-flex-flow: row wrap;
555 width: 100%;
556 width: 100%;
556 }
557 }
557
558
558 .comment-area-footer {
559 .comment-area-footer {
559 min-height: 30px;
560 min-height: 30px;
560 }
561 }
561
562
562 .comment-footer .toolbar {
563 .comment-footer .toolbar {
563
564
564 }
565 }
565
566
566 .comment-attachment-uploader {
567 .comment-attachment-uploader {
567 border: 1px dashed white;
568 border: 1px dashed white;
568 border-radius: @border-radius;
569 border-radius: @border-radius;
569 margin-top: -10px;
570 margin-top: -10px;
570 line-height: 30px;
571 line-height: 30px;
571 &.dz-drag-hover {
572 &.dz-drag-hover {
572 border-color: @grey3;
573 border-color: @grey3;
573 }
574 }
574
575
575 .dz-error-message {
576 .dz-error-message {
576 padding-top: 0;
577 padding-top: 0;
577 }
578 }
578 }
579 }
579
580
580 .comment-attachment-text {
581 .comment-attachment-text {
581 clear: both;
582 clear: both;
582 font-size: 11px;
583 font-size: 11px;
583 color: #8F8F8F;
584 color: #8F8F8F;
584 width: 100%;
585 width: 100%;
585 .pick-attachment {
586 .pick-attachment {
586 color: #8F8F8F;
587 color: #8F8F8F;
587 }
588 }
588 .pick-attachment:hover {
589 .pick-attachment:hover {
589 color: @rcblue;
590 color: @rcblue;
590 }
591 }
591 }
592 }
592
593
593 .nav-links {
594 .nav-links {
594 padding: 0;
595 padding: 0;
595 margin: 0;
596 margin: 0;
596 list-style: none;
597 list-style: none;
597 height: auto;
598 height: auto;
598 border-bottom: 1px solid @grey5;
599 border-bottom: 1px solid @grey5;
599 }
600 }
600 .nav-links li {
601 .nav-links li {
601 display: inline-block;
602 display: inline-block;
602 list-style-type: none;
603 list-style-type: none;
603 }
604 }
604
605
605 .nav-links li a.disabled {
606 .nav-links li a.disabled {
606 cursor: not-allowed;
607 cursor: not-allowed;
607 }
608 }
608
609
609 .nav-links li.active a {
610 .nav-links li.active a {
610 border-bottom: 2px solid @rcblue;
611 border-bottom: 2px solid @rcblue;
611 color: #000;
612 color: #000;
612 font-weight: 600;
613 font-weight: 600;
613 }
614 }
614 .nav-links li a {
615 .nav-links li a {
615 display: inline-block;
616 display: inline-block;
616 padding: 0px 10px 5px 10px;
617 padding: 0px 10px 5px 10px;
617 margin-bottom: -1px;
618 margin-bottom: -1px;
618 font-size: 14px;
619 font-size: 14px;
619 line-height: 28px;
620 line-height: 28px;
620 color: #8f8f8f;
621 color: #8f8f8f;
621 border-bottom: 2px solid transparent;
622 border-bottom: 2px solid transparent;
622 }
623 }
623
624
624 .toolbar-text {
625 .toolbar-text {
625 float: right;
626 float: right;
626 font-size: 11px;
627 font-size: 11px;
627 color: @grey4;
628 color: @grey4;
628 text-align: right;
629 text-align: right;
629
630
630 a {
631 a {
631 color: @grey4;
632 color: @grey4;
632 }
633 }
633 }
634 }
634
635
@@ -1,481 +1,491 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 ## usage:
2 ## usage:
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
3 ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
4 ## ${comment.comment_block(comment)}
4 ## ${comment.comment_block(comment)}
5 ##
5 ##
6
6
7 <%!
7 <%!
8 from rhodecode.lib import html_filters
8 from rhodecode.lib import html_filters
9 %>
9 %>
10
10
11 <%namespace name="base" file="/base/base.mako"/>
11 <%namespace name="base" file="/base/base.mako"/>
12 <%def name="comment_block(comment, inline=False, active_pattern_entries=None)">
12 <%def name="comment_block(comment, inline=False, active_pattern_entries=None)">
13 <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %>
13 <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %>
14 <% latest_ver = len(getattr(c, 'versions', [])) %>
14 <% latest_ver = len(getattr(c, 'versions', [])) %>
15 % if inline:
15 % if inline:
16 <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %>
16 <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %>
17 % else:
17 % else:
18 <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %>
18 <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %>
19 % endif
19 % endif
20
20
21 <div class="comment
21 <div class="comment
22 ${'comment-inline' if inline else 'comment-general'}
22 ${'comment-inline' if inline else 'comment-general'}
23 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
23 ${'comment-outdated' if outdated_at_ver else 'comment-current'}"
24 id="comment-${comment.comment_id}"
24 id="comment-${comment.comment_id}"
25 line="${comment.line_no}"
25 line="${comment.line_no}"
26 data-comment-id="${comment.comment_id}"
26 data-comment-id="${comment.comment_id}"
27 data-comment-type="${comment.comment_type}"
27 data-comment-type="${comment.comment_type}"
28 data-comment-renderer="${comment.renderer}"
28 data-comment-renderer="${comment.renderer}"
29 data-comment-text="${comment.text | html_filters.base64,n}"
29 data-comment-text="${comment.text | html_filters.base64,n}"
30 data-comment-line-no="${comment.line_no}"
30 data-comment-line-no="${comment.line_no}"
31 data-comment-inline=${h.json.dumps(inline)}
31 data-comment-inline=${h.json.dumps(inline)}
32 style="${'display: none;' if outdated_at_ver else ''}">
32 style="${'display: none;' if outdated_at_ver else ''}">
33
33
34 <div class="meta">
34 <div class="meta">
35 <div class="comment-type-label">
35 <div class="comment-type-label">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}" title="line: ${comment.line_no}">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}">
37
38 ## TODO COMMENT
37 % if comment.comment_type == 'todo':
39 % if comment.comment_type == 'todo':
38 % if comment.resolved:
40 % if comment.resolved:
39 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
41 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
42 <i class="icon-flag-filled"></i>
40 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
43 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
41 </div>
44 </div>
42 % else:
45 % else:
43 <div class="resolved tooltip" style="display: none">
46 <div class="resolved tooltip" style="display: none">
44 <span>${comment.comment_type}</span>
47 <span>${comment.comment_type}</span>
45 </div>
48 </div>
46 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}">
49 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to create resolution comment.')}">
50 <i class="icon-flag-filled"></i>
47 ${comment.comment_type}
51 ${comment.comment_type}
48 </div>
52 </div>
49 % endif
53 % endif
54 ## NOTE COMMENT
50 % else:
55 % else:
56 ## RESOLVED NOTE
51 % if comment.resolved_comment:
57 % if comment.resolved_comment:
52 fix
58 <div class="tooltip" title="${_('This comment resolves TODO #{}').format(comment.resolved_comment.comment_id)}">
53 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
59 fix
54 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
60 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
55 </a>
61 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
62 </a>
63 </div>
64 ## STATUS CHANGE NOTE
65 % elif not comment.is_inline and comment.status_change:
66 <%
67 if comment.pull_request:
68 status_change_title = 'Status of review for pull request !{}'.format(comment.pull_request.pull_request_id)
69 else:
70 status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id))
71 %>
72
73 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
74 <div class="changeset-status-lbl tooltip" title="${status_change_title}">
75 ${comment.status_change[0].status_lbl}
76 </div>
56 % else:
77 % else:
57 ${comment.comment_type or 'note'}
78 <div>
79 <i class="icon-comment"></i>
80 ${(comment.comment_type or 'note')}
81 </div>
58 % endif
82 % endif
59 % endif
83 % endif
84
60 </div>
85 </div>
61 </div>
86 </div>
62
87
88 % if 0 and comment.status_change:
89 <div class="pull-left">
90 <span class="tag authortag tooltip" title="${_('Status from pull request.')}">
91 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
92 ${'!{}'.format(comment.pull_request.pull_request_id)}
93 </a>
94 </span>
95 </div>
96 % endif
97
63 <div class="author ${'author-inline' if inline else 'author-general'}">
98 <div class="author ${'author-inline' if inline else 'author-general'}">
64 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
99 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
100 </div>
65
101
66 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
67 <span class="tag authortag tooltip" title="${_('Pull request author')}">
68 ${_('author')}
69 </span>
70 % endif
71
72 </div>
73 <div class="date">
102 <div class="date">
74 ${h.age_component(comment.modified_at, time_is_local=True)}
103 ${h.age_component(comment.modified_at, time_is_local=True)}
75 </div>
104 </div>
105
106 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
107 <span class="tag authortag tooltip" title="${_('Pull request author')}">
108 ${_('author')}
109 </span>
110 % endif
111
76 <%
112 <%
77 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
113 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
78 %>
114 %>
79
115
80 % if comment.history:
116 % if comment.history:
81 <div class="date">
117 <div class="date">
82
118
83 <input id="${comment_version_selector}" name="${comment_version_selector}"
119 <input id="${comment_version_selector}" name="${comment_version_selector}"
84 type="hidden"
120 type="hidden"
85 data-last-version="${comment.history[-1].version}">
121 data-last-version="${comment.history[-1].version}">
86
122
87 <script type="text/javascript">
123 <script type="text/javascript">
88
124
89 var preLoadVersionData = [
125 var preLoadVersionData = [
90 % for comment_history in comment.history:
126 % for comment_history in comment.history:
91 {
127 {
92 id: ${comment_history.comment_history_id},
128 id: ${comment_history.comment_history_id},
93 text: 'v${comment_history.version}',
129 text: 'v${comment_history.version}',
94 action: function () {
130 action: function () {
95 Rhodecode.comments.showVersion(
131 Rhodecode.comments.showVersion(
96 "${comment.comment_id}",
132 "${comment.comment_id}",
97 "${comment_history.comment_history_id}"
133 "${comment_history.comment_history_id}"
98 )
134 )
99 },
135 },
100 comment_version: "${comment_history.version}",
136 comment_version: "${comment_history.version}",
101 comment_author_username: "${comment_history.author.username}",
137 comment_author_username: "${comment_history.author.username}",
102 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
138 comment_author_gravatar: "${h.gravatar_url(comment_history.author.email, 16)}",
103 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
139 comment_created_on: '${h.age_component(comment_history.created_on, time_is_local=True)}',
104 },
140 },
105 % endfor
141 % endfor
106 ]
142 ]
107 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
143 initVersionSelector("#${comment_version_selector}", {results: preLoadVersionData});
108
144
109 </script>
145 </script>
110
146
111 </div>
147 </div>
112 % else:
148 % else:
113 <div class="date" style="display: none">
149 <div class="date" style="display: none">
114 <input id="${comment_version_selector}" name="${comment_version_selector}"
150 <input id="${comment_version_selector}" name="${comment_version_selector}"
115 type="hidden"
151 type="hidden"
116 data-last-version="0">
152 data-last-version="0">
117 </div>
153 </div>
118 %endif
154 %endif
119 % if inline:
120 <span></span>
121 % else:
122 <div class="status-change">
123 % if comment.pull_request:
124 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
125 % if comment.status_change:
126 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}:
127 % else:
128 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}
129 % endif
130 </a>
131 % else:
132 % if comment.status_change:
133 ${_('Status change on commit')}:
134 % endif
135 % endif
136 </div>
137 % endif
138
139 % if comment.status_change:
140 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
141 <div title="${_('Commit status')}" class="changeset-status-lbl">
142 ${comment.status_change[0].status_lbl}
143 </div>
144 % endif
145
155
146 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
156 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
147
157
148 <div class="comment-links-block">
158 <div class="comment-links-block">
149
159
150 % if inline:
160 % if inline:
151 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
161 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
152 % if outdated_at_ver:
162 % if outdated_at_ver:
153 <code class="pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
163 <code class="tooltip pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
154 outdated ${'v{}'.format(pr_index_ver)} |
164 outdated ${'v{}'.format(pr_index_ver)} |
155 </code>
165 </code>
156 % elif pr_index_ver:
166 % elif pr_index_ver:
157 <code class="pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
167 <code class="tooltip pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
158 ${'v{}'.format(pr_index_ver)} |
168 ${'v{}'.format(pr_index_ver)} |
159 </code>
169 </code>
160 % endif
170 % endif
161 </a>
171 </a>
162 % else:
172 % else:
163 % if comment.pull_request_version_id and pr_index_ver:
173 % if pr_index_ver:
164
174
165 % if comment.outdated:
175 % if comment.outdated:
166 <a class="pr-version"
176 <a class="pr-version"
167 href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"
177 href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"
168 >
178 >
169 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
179 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
170 </a> |
180 </a> |
171 % else:
181 % else:
172 <a class="pr-version"
182 <a class="tooltip pr-version"
173 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
183 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
174 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
184 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
175 >
185 >
176 <code class="pr-version-num">
186 <code class="pr-version-num">
177 ${'v{}'.format(pr_index_ver)}
187 ${'v{}'.format(pr_index_ver)}
178 </code>
188 </code>
179 </a> |
189 </a> |
180 % endif
190 % endif
181
191
182 % endif
192 % endif
183 % endif
193 % endif
184
194
185 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
195 ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed
186 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
196 ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated
187 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
197 %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())):
188 ## permissions to delete
198 ## permissions to delete
189 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
199 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
190 <a onclick="return Rhodecode.comments.editComment(this);"
200 <a onclick="return Rhodecode.comments.editComment(this);"
191 class="edit-comment">${_('Edit')}</a>
201 class="edit-comment">${_('Edit')}</a>
192 | <a onclick="return Rhodecode.comments.deleteComment(this);"
202 | <a onclick="return Rhodecode.comments.deleteComment(this);"
193 class="delete-comment">${_('Delete')}</a>
203 class="delete-comment">${_('Delete')}</a>
194 %else:
204 %else:
195 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
205 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
196 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
206 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
197 %endif
207 %endif
198 %else:
208 %else:
199 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
209 <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Edit')}</a>
200 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
210 | <a class="tooltip edit-comment link-disabled" disabled="disabled" title="${_('Action unavailable')}">${_('Delete')}</a>
201 %endif
211 %endif
202
212
203 % if outdated_at_ver:
213 % if outdated_at_ver:
204 | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
214 | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous outdated comment')}"> <i class="icon-angle-left"></i> </a>
205 | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
215 | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="tooltip next-comment" title="${_('Jump to the next outdated comment')}"> <i class="icon-angle-right"></i></a>
206 % else:
216 % else:
207 | <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
217 | <a onclick="return Rhodecode.comments.prevComment(this);" class="tooltip prev-comment" title="${_('Jump to the previous comment')}"> <i class="icon-angle-left"></i></a>
208 | <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
218 | <a onclick="return Rhodecode.comments.nextComment(this);" class="tooltip next-comment" title="${_('Jump to the next comment')}"> <i class="icon-angle-right"></i></a>
209 % endif
219 % endif
210
220
211 </div>
221 </div>
212 </div>
222 </div>
213 <div class="text">
223 <div class="text">
214 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
224 ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
215 </div>
225 </div>
216
226
217 </div>
227 </div>
218 </%def>
228 </%def>
219
229
220 ## generate main comments
230 ## generate main comments
221 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
231 <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
222 <%
232 <%
223 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
233 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
224 %>
234 %>
225
235
226 <div class="general-comments" id="comments">
236 <div class="general-comments" id="comments">
227 %for comment in comments:
237 %for comment in comments:
228 <div id="comment-tr-${comment.comment_id}">
238 <div id="comment-tr-${comment.comment_id}">
229 ## only render comments that are not from pull request, or from
239 ## only render comments that are not from pull request, or from
230 ## pull request and a status change
240 ## pull request and a status change
231 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
241 %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request:
232 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
242 ${comment_block(comment, active_pattern_entries=active_pattern_entries)}
233 %endif
243 %endif
234 </div>
244 </div>
235 %endfor
245 %endfor
236 ## to anchor ajax comments
246 ## to anchor ajax comments
237 <div id="injected_page_comments"></div>
247 <div id="injected_page_comments"></div>
238 </div>
248 </div>
239 </%def>
249 </%def>
240
250
241
251
242 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
252 <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)">
243
253
244 <div class="comments">
254 <div class="comments">
245 <%
255 <%
246 if is_pull_request:
256 if is_pull_request:
247 placeholder = _('Leave a comment on this Pull Request.')
257 placeholder = _('Leave a comment on this Pull Request.')
248 elif is_compare:
258 elif is_compare:
249 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
259 placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras))
250 else:
260 else:
251 placeholder = _('Leave a comment on this Commit.')
261 placeholder = _('Leave a comment on this Commit.')
252 %>
262 %>
253
263
254 % if c.rhodecode_user.username != h.DEFAULT_USER:
264 % if c.rhodecode_user.username != h.DEFAULT_USER:
255 <div class="js-template" id="cb-comment-general-form-template">
265 <div class="js-template" id="cb-comment-general-form-template">
256 ## template generated for injection
266 ## template generated for injection
257 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
267 ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)}
258 </div>
268 </div>
259
269
260 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
270 <div id="cb-comment-general-form-placeholder" class="comment-form ac">
261 ## inject form here
271 ## inject form here
262 </div>
272 </div>
263 <script type="text/javascript">
273 <script type="text/javascript">
264 var lineNo = 'general';
274 var lineNo = 'general';
265 var resolvesCommentId = null;
275 var resolvesCommentId = null;
266 var generalCommentForm = Rhodecode.comments.createGeneralComment(
276 var generalCommentForm = Rhodecode.comments.createGeneralComment(
267 lineNo, "${placeholder}", resolvesCommentId);
277 lineNo, "${placeholder}", resolvesCommentId);
268
278
269 // set custom success callback on rangeCommit
279 // set custom success callback on rangeCommit
270 % if is_compare:
280 % if is_compare:
271 generalCommentForm.setHandleFormSubmit(function(o) {
281 generalCommentForm.setHandleFormSubmit(function(o) {
272 var self = generalCommentForm;
282 var self = generalCommentForm;
273
283
274 var text = self.cm.getValue();
284 var text = self.cm.getValue();
275 var status = self.getCommentStatus();
285 var status = self.getCommentStatus();
276 var commentType = self.getCommentType();
286 var commentType = self.getCommentType();
277
287
278 if (text === "" && !status) {
288 if (text === "" && !status) {
279 return;
289 return;
280 }
290 }
281
291
282 // we can pick which commits we want to make the comment by
292 // we can pick which commits we want to make the comment by
283 // selecting them via click on preview pane, this will alter the hidden inputs
293 // selecting them via click on preview pane, this will alter the hidden inputs
284 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
294 var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0;
285
295
286 var commitIds = [];
296 var commitIds = [];
287 $('#changeset_compare_view_content .compare_select').each(function(el) {
297 $('#changeset_compare_view_content .compare_select').each(function(el) {
288 var commitId = this.id.replace('row-', '');
298 var commitId = this.id.replace('row-', '');
289 if ($(this).hasClass('hl') || !cherryPicked) {
299 if ($(this).hasClass('hl') || !cherryPicked) {
290 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
300 $("input[data-commit-id='{0}']".format(commitId)).val(commitId);
291 commitIds.push(commitId);
301 commitIds.push(commitId);
292 } else {
302 } else {
293 $("input[data-commit-id='{0}']".format(commitId)).val('')
303 $("input[data-commit-id='{0}']".format(commitId)).val('')
294 }
304 }
295 });
305 });
296
306
297 self.setActionButtonsDisabled(true);
307 self.setActionButtonsDisabled(true);
298 self.cm.setOption("readOnly", true);
308 self.cm.setOption("readOnly", true);
299 var postData = {
309 var postData = {
300 'text': text,
310 'text': text,
301 'changeset_status': status,
311 'changeset_status': status,
302 'comment_type': commentType,
312 'comment_type': commentType,
303 'commit_ids': commitIds,
313 'commit_ids': commitIds,
304 'csrf_token': CSRF_TOKEN
314 'csrf_token': CSRF_TOKEN
305 };
315 };
306
316
307 var submitSuccessCallback = function(o) {
317 var submitSuccessCallback = function(o) {
308 location.reload(true);
318 location.reload(true);
309 };
319 };
310 var submitFailCallback = function(){
320 var submitFailCallback = function(){
311 self.resetCommentFormState(text)
321 self.resetCommentFormState(text)
312 };
322 };
313 self.submitAjaxPOST(
323 self.submitAjaxPOST(
314 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
324 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
315 });
325 });
316 % endif
326 % endif
317
327
318 </script>
328 </script>
319 % else:
329 % else:
320 ## form state when not logged in
330 ## form state when not logged in
321 <div class="comment-form ac">
331 <div class="comment-form ac">
322
332
323 <div class="comment-area">
333 <div class="comment-area">
324 <div class="comment-area-header">
334 <div class="comment-area-header">
325 <ul class="nav-links clearfix">
335 <ul class="nav-links clearfix">
326 <li class="active">
336 <li class="active">
327 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
337 <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a>
328 </li>
338 </li>
329 <li class="">
339 <li class="">
330 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
340 <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a>
331 </li>
341 </li>
332 </ul>
342 </ul>
333 </div>
343 </div>
334
344
335 <div class="comment-area-write" style="display: block;">
345 <div class="comment-area-write" style="display: block;">
336 <div id="edit-container">
346 <div id="edit-container">
337 <div style="padding: 40px 0">
347 <div style="padding: 40px 0">
338 ${_('You need to be logged in to leave comments.')}
348 ${_('You need to be logged in to leave comments.')}
339 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
349 <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
340 </div>
350 </div>
341 </div>
351 </div>
342 <div id="preview-container" class="clearfix" style="display: none;">
352 <div id="preview-container" class="clearfix" style="display: none;">
343 <div id="preview-box" class="preview-box"></div>
353 <div id="preview-box" class="preview-box"></div>
344 </div>
354 </div>
345 </div>
355 </div>
346
356
347 <div class="comment-area-footer">
357 <div class="comment-area-footer">
348 <div class="toolbar">
358 <div class="toolbar">
349 <div class="toolbar-text">
359 <div class="toolbar-text">
350 </div>
360 </div>
351 </div>
361 </div>
352 </div>
362 </div>
353 </div>
363 </div>
354
364
355 <div class="comment-footer">
365 <div class="comment-footer">
356 </div>
366 </div>
357
367
358 </div>
368 </div>
359 % endif
369 % endif
360
370
361 <script type="text/javascript">
371 <script type="text/javascript">
362 bindToggleButtons();
372 bindToggleButtons();
363 </script>
373 </script>
364 </div>
374 </div>
365 </%def>
375 </%def>
366
376
367
377
368 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
378 <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)">
369
379
370 ## comment injected based on assumption that user is logged in
380 ## comment injected based on assumption that user is logged in
371 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
381 <form ${('id="{}"'.format(form_id) if form_id else '') |n} action="#" method="GET">
372
382
373 <div class="comment-area">
383 <div class="comment-area">
374 <div class="comment-area-header">
384 <div class="comment-area-header">
375 <div class="pull-left">
385 <div class="pull-left">
376 <ul class="nav-links clearfix">
386 <ul class="nav-links clearfix">
377 <li class="active">
387 <li class="active">
378 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
388 <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a>
379 </li>
389 </li>
380 <li class="">
390 <li class="">
381 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
391 <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a>
382 </li>
392 </li>
383 </ul>
393 </ul>
384 </div>
394 </div>
385 <div class="pull-right">
395 <div class="pull-right">
386 <span class="comment-area-text">${_('Mark as')}:</span>
396 <span class="comment-area-text">${_('Mark as')}:</span>
387 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
397 <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type">
388 % for val in c.visual.comment_types:
398 % for val in c.visual.comment_types:
389 <option value="${val}">${val.upper()}</option>
399 <option value="${val}">${val.upper()}</option>
390 % endfor
400 % endfor
391 </select>
401 </select>
392 </div>
402 </div>
393 </div>
403 </div>
394
404
395 <div class="comment-area-write" style="display: block;">
405 <div class="comment-area-write" style="display: block;">
396 <div id="edit-container_${lineno_id}">
406 <div id="edit-container_${lineno_id}">
397 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
407 <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea>
398 </div>
408 </div>
399 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
409 <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;">
400 <div id="preview-box_${lineno_id}" class="preview-box"></div>
410 <div id="preview-box_${lineno_id}" class="preview-box"></div>
401 </div>
411 </div>
402 </div>
412 </div>
403
413
404 <div class="comment-area-footer comment-attachment-uploader">
414 <div class="comment-area-footer comment-attachment-uploader">
405 <div class="toolbar">
415 <div class="toolbar">
406
416
407 <div class="comment-attachment-text">
417 <div class="comment-attachment-text">
408 <div class="dropzone-text">
418 <div class="dropzone-text">
409 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
419 ${_("Drag'n Drop files here or")} <span class="link pick-attachment">${_('Choose your files')}</span>.<br>
410 </div>
420 </div>
411 <div class="dropzone-upload" style="display:none">
421 <div class="dropzone-upload" style="display:none">
412 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
422 <i class="icon-spin animate-spin"></i> ${_('uploading...')}
413 </div>
423 </div>
414 </div>
424 </div>
415
425
416 ## comments dropzone template, empty on purpose
426 ## comments dropzone template, empty on purpose
417 <div style="display: none" class="comment-attachment-uploader-template">
427 <div style="display: none" class="comment-attachment-uploader-template">
418 <div class="dz-file-preview" style="margin: 0">
428 <div class="dz-file-preview" style="margin: 0">
419 <div class="dz-error-message"></div>
429 <div class="dz-error-message"></div>
420 </div>
430 </div>
421 </div>
431 </div>
422
432
423 </div>
433 </div>
424 </div>
434 </div>
425 </div>
435 </div>
426
436
427 <div class="comment-footer">
437 <div class="comment-footer">
428
438
429 ## inject extra inputs into the form
439 ## inject extra inputs into the form
430 % if form_extras and isinstance(form_extras, (list, tuple)):
440 % if form_extras and isinstance(form_extras, (list, tuple)):
431 <div id="comment_form_extras">
441 <div id="comment_form_extras">
432 % for form_ex_el in form_extras:
442 % for form_ex_el in form_extras:
433 ${form_ex_el|n}
443 ${form_ex_el|n}
434 % endfor
444 % endfor
435 </div>
445 </div>
436 % endif
446 % endif
437
447
438 <div class="action-buttons">
448 <div class="action-buttons">
439 % if form_type != 'inline':
449 % if form_type != 'inline':
440 <div class="action-buttons-extra"></div>
450 <div class="action-buttons-extra"></div>
441 % endif
451 % endif
442
452
443 <input class="btn btn-success comment-button-input" id="save_${lineno_id}" name="save" type="submit" value="${_('Comment')}">
453 <input class="btn btn-success comment-button-input" id="save_${lineno_id}" name="save" type="submit" value="${_('Comment')}">
444
454
445 ## inline for has a file, and line-number together with cancel hide button.
455 ## inline for has a file, and line-number together with cancel hide button.
446 % if form_type == 'inline':
456 % if form_type == 'inline':
447 <input type="hidden" name="f_path" value="{0}">
457 <input type="hidden" name="f_path" value="{0}">
448 <input type="hidden" name="line" value="${lineno_id}">
458 <input type="hidden" name="line" value="${lineno_id}">
449 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
459 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
450 ${_('Cancel')}
460 ${_('Cancel')}
451 </button>
461 </button>
452 % endif
462 % endif
453 </div>
463 </div>
454
464
455 % if review_statuses:
465 % if review_statuses:
456 <div class="status_box">
466 <div class="status_box">
457 <select id="change_status_${lineno_id}" name="changeset_status">
467 <select id="change_status_${lineno_id}" name="changeset_status">
458 <option></option> ## Placeholder
468 <option></option> ## Placeholder
459 % for status, lbl in review_statuses:
469 % for status, lbl in review_statuses:
460 <option value="${status}" data-status="${status}">${lbl}</option>
470 <option value="${status}" data-status="${status}">${lbl}</option>
461 %if is_pull_request and change_status and status in ('approved', 'rejected'):
471 %if is_pull_request and change_status and status in ('approved', 'rejected'):
462 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
472 <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option>
463 %endif
473 %endif
464 % endfor
474 % endfor
465 </select>
475 </select>
466 </div>
476 </div>
467 % endif
477 % endif
468
478
469 <div class="toolbar-text">
479 <div class="toolbar-text">
470 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
480 <% renderer_url = '<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper()) %>
471 ${_('Comments parsed using {} syntax.').format(renderer_url)|n} <br/>
481 ${_('Comments parsed using {} syntax.').format(renderer_url)|n} <br/>
472 <span class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span>
482 <span class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span>
473 ${_('and')}
483 ${_('and')}
474 <span class="tooltip" title="${_('Start typing with / for certain actions to be triggered via text box.')}">`/` autocomplete</span>
484 <span class="tooltip" title="${_('Start typing with / for certain actions to be triggered via text box.')}">`/` autocomplete</span>
475 ${_('actions supported.')}
485 ${_('actions supported.')}
476 </div>
486 </div>
477 </div>
487 </div>
478
488
479 </form>
489 </form>
480
490
481 </%def> No newline at end of file
491 </%def>
@@ -1,1215 +1,1218 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(commit, filename, line, type)"><%
3 <%def name="diff_line_anchor(commit, filename, line, type)"><%
4 return '%s_%s_%i' % (h.md5_safe(commit+filename), type, line)
4 return '%s_%s_%i' % (h.md5_safe(commit+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 # additional menu for PRs
52 # additional menu for PRs
53 pull_request_menu=None,
53 pull_request_menu=None,
54
54
55 # show/hide todo next to comments
55 # show/hide todo next to comments
56 show_todos=True,
56 show_todos=True,
57
57
58 )">
58 )">
59
59
60 <%
60 <%
61 diffset_container_id = h.md5(diffset.target_ref)
61 diffset_container_id = h.md5(diffset.target_ref)
62 collapse_all = len(diffset.files) > collapse_when_files_over
62 collapse_all = len(diffset.files) > collapse_when_files_over
63 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
63 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
64 %>
64 %>
65
65
66 %if use_comments:
66 %if use_comments:
67
67
68 ## Template for injecting comments
68 ## Template for injecting comments
69 <div id="cb-comments-inline-container-template" class="js-template">
69 <div id="cb-comments-inline-container-template" class="js-template">
70 ${inline_comments_container([])}
70 ${inline_comments_container([])}
71 </div>
71 </div>
72
72
73 <div class="js-template" id="cb-comment-inline-form-template">
73 <div class="js-template" id="cb-comment-inline-form-template">
74 <div class="comment-inline-form ac">
74 <div class="comment-inline-form ac">
75
75
76 %if c.rhodecode_user.username != h.DEFAULT_USER:
76 %if c.rhodecode_user.username != h.DEFAULT_USER:
77 ## render template for inline comments
77 ## render template for inline comments
78 ${commentblock.comment_form(form_type='inline')}
78 ${commentblock.comment_form(form_type='inline')}
79 %else:
79 %else:
80 ${h.form('', class_='inline-form comment-form-login', method='get')}
80 ${h.form('', class_='inline-form comment-form-login', method='get')}
81 <div class="pull-left">
81 <div class="pull-left">
82 <div class="comment-help pull-right">
82 <div class="comment-help pull-right">
83 ${_('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>
83 ${_('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>
84 </div>
84 </div>
85 </div>
85 </div>
86 <div class="comment-button pull-right">
86 <div class="comment-button pull-right">
87 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
87 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
88 ${_('Cancel')}
88 ${_('Cancel')}
89 </button>
89 </button>
90 </div>
90 </div>
91 <div class="clearfix"></div>
91 <div class="clearfix"></div>
92 ${h.end_form()}
92 ${h.end_form()}
93 %endif
93 %endif
94 </div>
94 </div>
95 </div>
95 </div>
96
96
97 %endif
97 %endif
98
98
99 %if c.user_session_attrs["diffmode"] == 'sideside':
99 %if c.user_session_attrs["diffmode"] == 'sideside':
100 <style>
100 <style>
101 .wrapper {
101 .wrapper {
102 max-width: 1600px !important;
102 max-width: 1600px !important;
103 }
103 }
104 </style>
104 </style>
105 %endif
105 %endif
106
106
107 %if ruler_at_chars:
107 %if ruler_at_chars:
108 <style>
108 <style>
109 .diff table.cb .cb-content:after {
109 .diff table.cb .cb-content:after {
110 content: "";
110 content: "";
111 border-left: 1px solid blue;
111 border-left: 1px solid blue;
112 position: absolute;
112 position: absolute;
113 top: 0;
113 top: 0;
114 height: 18px;
114 height: 18px;
115 opacity: .2;
115 opacity: .2;
116 z-index: 10;
116 z-index: 10;
117 //## +5 to account for diff action (+/-)
117 //## +5 to account for diff action (+/-)
118 left: ${ruler_at_chars + 5}ch;
118 left: ${ruler_at_chars + 5}ch;
119 </style>
119 </style>
120 %endif
120 %endif
121
121
122 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
122 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
123
123
124 <div style="height: 20px; line-height: 20px">
124 <div style="height: 20px; line-height: 20px">
125 ## expand/collapse action
125 ## expand/collapse action
126 <div class="pull-left">
126 <div class="pull-left">
127 <a class="${'collapsed' if collapse_all else ''}" href="#expand-files" onclick="toggleExpand(this, '${diffset_container_id}'); return false">
127 <a class="${'collapsed' if collapse_all else ''}" href="#expand-files" onclick="toggleExpand(this, '${diffset_container_id}'); return false">
128 % if collapse_all:
128 % if collapse_all:
129 <i class="icon-plus-squared-alt icon-no-margin"></i>${_('Expand all files')}
129 <i class="icon-plus-squared-alt icon-no-margin"></i>${_('Expand all files')}
130 % else:
130 % else:
131 <i class="icon-minus-squared-alt icon-no-margin"></i>${_('Collapse all files')}
131 <i class="icon-minus-squared-alt icon-no-margin"></i>${_('Collapse all files')}
132 % endif
132 % endif
133 </a>
133 </a>
134
134
135 </div>
135 </div>
136
136
137 ## todos
137 ## todos
138 % if show_todos and getattr(c, 'at_version', None):
138 % if show_todos and getattr(c, 'at_version', None):
139 <div class="pull-right">
139 <div class="pull-right">
140 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
140 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
141 ${_('not available in this view')}
141 ${_('not available in this view')}
142 </div>
142 </div>
143 % elif show_todos:
143 % elif show_todos:
144 <div class="pull-right">
144 <div class="pull-right">
145 <div class="comments-number" style="padding-left: 10px">
145 <div class="comments-number" style="padding-left: 10px">
146 % if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
146 % if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
147 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
147 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
148 % if c.unresolved_comments:
148 % if c.unresolved_comments:
149 <a href="#show-todos" onclick="$('#todo-box').toggle(); return false">
149 <a href="#show-todos" onclick="$('#todo-box').toggle(); return false">
150 ${_('{} unresolved').format(len(c.unresolved_comments))}
150 ${_('{} unresolved').format(len(c.unresolved_comments))}
151 </a>
151 </a>
152 % else:
152 % else:
153 ${_('0 unresolved')}
153 ${_('0 unresolved')}
154 % endif
154 % endif
155
155
156 ${_('{} Resolved').format(len(c.resolved_comments))}
156 ${_('{} Resolved').format(len(c.resolved_comments))}
157 % endif
157 % endif
158 </div>
158 </div>
159 </div>
159 </div>
160 % endif
160 % endif
161
161
162 ## comments
162 ## comments
163 <div class="pull-right">
163 <div class="pull-right">
164 <div class="comments-number" style="padding-left: 10px">
164 <div class="comments-number" style="padding-left: 10px">
165 % if hasattr(c, 'comments') and hasattr(c, 'inline_cnt'):
165 % if hasattr(c, 'comments') and hasattr(c, 'inline_cnt'):
166 <i class="icon-comment" style="color: #949494">COMMENTS:</i>
166 <i class="icon-comment" style="color: #949494">COMMENTS:</i>
167 % if c.comments:
167 % if c.comments:
168 <a href="#comments">${_ungettext("{} General", "{} General", len(c.comments)).format(len(c.comments))}</a>,
168 <a href="#comments">${_ungettext("{} General", "{} General", len(c.comments)).format(len(c.comments))}</a>,
169 % else:
169 % else:
170 ${_('0 General')}
170 ${_('0 General')}
171 % endif
171 % endif
172
172
173 % if c.inline_cnt:
173 % if c.inline_cnt:
174 <a href="#" onclick="return Rhodecode.comments.nextComment();"
174 <a href="#" onclick="return Rhodecode.comments.nextComment();"
175 id="inline-comments-counter">${_ungettext("{} Inline", "{} Inline", c.inline_cnt).format(c.inline_cnt)}
175 id="inline-comments-counter">${_ungettext("{} Inline", "{} Inline", c.inline_cnt).format(c.inline_cnt)}
176 </a>
176 </a>
177 % else:
177 % else:
178 ${_('0 Inline')}
178 ${_('0 Inline')}
179 % endif
179 % endif
180 % endif
180 % endif
181
181
182 % if pull_request_menu:
182 % if pull_request_menu:
183 <%
183 <%
184 outdated_comm_count_ver = pull_request_menu['outdated_comm_count_ver']
184 outdated_comm_count_ver = pull_request_menu['outdated_comm_count_ver']
185 %>
185 %>
186
186
187 % if outdated_comm_count_ver:
187 % if outdated_comm_count_ver:
188 <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">
188 <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">
189 (${_("{} Outdated").format(outdated_comm_count_ver)})
189 (${_("{} Outdated").format(outdated_comm_count_ver)})
190 </a>
190 </a>
191 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated')}</a>
191 <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated')}</a>
192 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated')}</a>
192 <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated')}</a>
193 % else:
193 % else:
194 (${_("{} Outdated").format(outdated_comm_count_ver)})
194 (${_("{} Outdated").format(outdated_comm_count_ver)})
195 % endif
195 % endif
196
196
197 % endif
197 % endif
198
198
199 </div>
199 </div>
200 </div>
200 </div>
201
201
202 </div>
202 </div>
203
203
204 % if diffset.limited_diff:
204 % if diffset.limited_diff:
205 <div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
205 <div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
206 <h2 class="clearinner">
206 <h2 class="clearinner">
207 ${_('The requested changes are too big and content was truncated.')}
207 ${_('The requested changes are too big and content was truncated.')}
208 <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>
208 <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>
209 </h2>
209 </h2>
210 </div>
210 </div>
211 ## commit range header for each individual diff
211 ## commit range header for each individual diff
212 % elif commit and hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1:
212 % elif commit and hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1:
213 <div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
213 <div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
214 <div class="clearinner">
214 <div class="clearinner">
215 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=diffset.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a>
215 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=diffset.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a>
216 </div>
216 </div>
217 </div>
217 </div>
218 % endif
218 % endif
219
219
220 <div id="todo-box">
220 <div id="todo-box">
221 % if hasattr(c, 'unresolved_comments') and c.unresolved_comments:
221 % if hasattr(c, 'unresolved_comments') and c.unresolved_comments:
222 % for co in c.unresolved_comments:
222 % for co in c.unresolved_comments:
223 <a class="permalink" href="#comment-${co.comment_id}"
223 <a class="permalink" href="#comment-${co.comment_id}"
224 onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))">
224 onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))">
225 <i class="icon-flag-filled-red"></i>
225 <i class="icon-flag-filled-red"></i>
226 ${co.comment_id}</a>${('' if loop.last else ',')}
226 ${co.comment_id}</a>${('' if loop.last else ',')}
227 % endfor
227 % endfor
228 % endif
228 % endif
229 </div>
229 </div>
230 %if diffset.has_hidden_changes:
230 %if diffset.has_hidden_changes:
231 <p class="empty_data">${_('Some changes may be hidden')}</p>
231 <p class="empty_data">${_('Some changes may be hidden')}</p>
232 %elif not diffset.files:
232 %elif not diffset.files:
233 <p class="empty_data">${_('No files')}</p>
233 <p class="empty_data">${_('No files')}</p>
234 %endif
234 %endif
235
235
236 <div class="filediffs">
236 <div class="filediffs">
237
237
238 ## initial value could be marked as False later on
238 ## initial value could be marked as False later on
239 <% over_lines_changed_limit = False %>
239 <% over_lines_changed_limit = False %>
240 %for i, filediff in enumerate(diffset.files):
240 %for i, filediff in enumerate(diffset.files):
241
241
242 <%
242 <%
243 lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
243 lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
244 over_lines_changed_limit = lines_changed > lines_changed_limit
244 over_lines_changed_limit = lines_changed > lines_changed_limit
245 %>
245 %>
246 ## anchor with support of sticky header
246 ## anchor with support of sticky header
247 <div class="anchor" id="a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></div>
247 <div class="anchor" id="a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></div>
248
248
249 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filediff)}" type="checkbox" onchange="updateSticky();">
249 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filediff)}" type="checkbox" onchange="updateSticky();">
250 <div
250 <div
251 class="filediff"
251 class="filediff"
252 data-f-path="${filediff.patch['filename']}"
252 data-f-path="${filediff.patch['filename']}"
253 data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}"
253 data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}"
254 >
254 >
255 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
255 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
256 <%
256 <%
257 file_comments = (get_inline_comments(inline_comments, filediff.patch['filename']) or {}).values()
257 file_comments = (get_inline_comments(inline_comments, filediff.patch['filename']) or {}).values()
258 total_file_comments = [_c for _c in h.itertools.chain.from_iterable(file_comments) if not _c.outdated]
258 total_file_comments = [_c for _c in h.itertools.chain.from_iterable(file_comments) if not _c.outdated]
259 %>
259 %>
260 <div class="filediff-collapse-indicator icon-"></div>
260 <div class="filediff-collapse-indicator icon-"></div>
261 <span class="pill-group pull-right" >
261 <span class="pill-group pull-right" >
262 <span class="pill"><i class="icon-comment"></i> ${len(total_file_comments)}</span>
262 <span class="pill" op="comments">
263
264 <i class="icon-comment"></i> ${len(total_file_comments)}
265 </span>
263 </span>
266 </span>
264 ${diff_ops(filediff)}
267 ${diff_ops(filediff)}
265
268
266 </label>
269 </label>
267
270
268 ${diff_menu(filediff, use_comments=use_comments)}
271 ${diff_menu(filediff, use_comments=use_comments)}
269 <table data-f-path="${filediff.patch['filename']}" data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}" class="code-visible-block cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
272 <table data-f-path="${filediff.patch['filename']}" data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}" class="code-visible-block cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
270
273
271 ## new/deleted/empty content case
274 ## new/deleted/empty content case
272 % if not filediff.hunks:
275 % if not filediff.hunks:
273 ## Comment container, on "fakes" hunk that contains all data to render comments
276 ## Comment container, on "fakes" hunk that contains all data to render comments
274 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
277 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
275 % endif
278 % endif
276
279
277 %if filediff.limited_diff:
280 %if filediff.limited_diff:
278 <tr class="cb-warning cb-collapser">
281 <tr class="cb-warning cb-collapser">
279 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
282 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
280 ${_('The requested commit or file 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>
283 ${_('The requested commit or file 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>
281 </td>
284 </td>
282 </tr>
285 </tr>
283 %else:
286 %else:
284 %if over_lines_changed_limit:
287 %if over_lines_changed_limit:
285 <tr class="cb-warning cb-collapser">
288 <tr class="cb-warning cb-collapser">
286 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
289 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
287 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
290 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
288 <a href="#" class="cb-expand"
291 <a href="#" class="cb-expand"
289 onclick="$(this).closest('table').removeClass('cb-collapsed'); updateSticky(); return false;">${_('Show them')}
292 onclick="$(this).closest('table').removeClass('cb-collapsed'); updateSticky(); return false;">${_('Show them')}
290 </a>
293 </a>
291 <a href="#" class="cb-collapse"
294 <a href="#" class="cb-collapse"
292 onclick="$(this).closest('table').addClass('cb-collapsed'); updateSticky(); return false;">${_('Hide them')}
295 onclick="$(this).closest('table').addClass('cb-collapsed'); updateSticky(); return false;">${_('Hide them')}
293 </a>
296 </a>
294 </td>
297 </td>
295 </tr>
298 </tr>
296 %endif
299 %endif
297 %endif
300 %endif
298
301
299 % for hunk in filediff.hunks:
302 % for hunk in filediff.hunks:
300 <tr class="cb-hunk">
303 <tr class="cb-hunk">
301 <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}>
304 <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}>
302 ## TODO: dan: add ajax loading of more context here
305 ## TODO: dan: add ajax loading of more context here
303 ## <a href="#">
306 ## <a href="#">
304 <i class="icon-more"></i>
307 <i class="icon-more"></i>
305 ## </a>
308 ## </a>
306 </td>
309 </td>
307 <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}>
310 <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}>
308 @@
311 @@
309 -${hunk.source_start},${hunk.source_length}
312 -${hunk.source_start},${hunk.source_length}
310 +${hunk.target_start},${hunk.target_length}
313 +${hunk.target_start},${hunk.target_length}
311 ${hunk.section_header}
314 ${hunk.section_header}
312 </td>
315 </td>
313 </tr>
316 </tr>
314 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
317 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
315 % endfor
318 % endfor
316
319
317 <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %>
320 <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %>
318
321
319 ## outdated comments that do not fit into currently displayed lines
322 ## outdated comments that do not fit into currently displayed lines
320 % for lineno, comments in unmatched_comments.items():
323 % for lineno, comments in unmatched_comments.items():
321
324
322 %if c.user_session_attrs["diffmode"] == 'unified':
325 %if c.user_session_attrs["diffmode"] == 'unified':
323 % if loop.index == 0:
326 % if loop.index == 0:
324 <tr class="cb-hunk">
327 <tr class="cb-hunk">
325 <td colspan="3"></td>
328 <td colspan="3"></td>
326 <td>
329 <td>
327 <div>
330 <div>
328 ${_('Unmatched/outdated inline comments below')}
331 ${_('Unmatched/outdated inline comments below')}
329 </div>
332 </div>
330 </td>
333 </td>
331 </tr>
334 </tr>
332 % endif
335 % endif
333 <tr class="cb-line">
336 <tr class="cb-line">
334 <td class="cb-data cb-context"></td>
337 <td class="cb-data cb-context"></td>
335 <td class="cb-lineno cb-context"></td>
338 <td class="cb-lineno cb-context"></td>
336 <td class="cb-lineno cb-context"></td>
339 <td class="cb-lineno cb-context"></td>
337 <td class="cb-content cb-context">
340 <td class="cb-content cb-context">
338 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
341 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
339 </td>
342 </td>
340 </tr>
343 </tr>
341 %elif c.user_session_attrs["diffmode"] == 'sideside':
344 %elif c.user_session_attrs["diffmode"] == 'sideside':
342 % if loop.index == 0:
345 % if loop.index == 0:
343 <tr class="cb-comment-info">
346 <tr class="cb-comment-info">
344 <td colspan="2"></td>
347 <td colspan="2"></td>
345 <td class="cb-line">
348 <td class="cb-line">
346 <div>
349 <div>
347 ${_('Unmatched/outdated inline comments below')}
350 ${_('Unmatched/outdated inline comments below')}
348 </div>
351 </div>
349 </td>
352 </td>
350 <td colspan="2"></td>
353 <td colspan="2"></td>
351 <td class="cb-line">
354 <td class="cb-line">
352 <div>
355 <div>
353 ${_('Unmatched/outdated comments below')}
356 ${_('Unmatched/outdated comments below')}
354 </div>
357 </div>
355 </td>
358 </td>
356 </tr>
359 </tr>
357 % endif
360 % endif
358 <tr class="cb-line">
361 <tr class="cb-line">
359 <td class="cb-data cb-context"></td>
362 <td class="cb-data cb-context"></td>
360 <td class="cb-lineno cb-context"></td>
363 <td class="cb-lineno cb-context"></td>
361 <td class="cb-content cb-context">
364 <td class="cb-content cb-context">
362 % if lineno.startswith('o'):
365 % if lineno.startswith('o'):
363 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
366 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
364 % endif
367 % endif
365 </td>
368 </td>
366
369
367 <td class="cb-data cb-context"></td>
370 <td class="cb-data cb-context"></td>
368 <td class="cb-lineno cb-context"></td>
371 <td class="cb-lineno cb-context"></td>
369 <td class="cb-content cb-context">
372 <td class="cb-content cb-context">
370 % if lineno.startswith('n'):
373 % if lineno.startswith('n'):
371 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
374 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
372 % endif
375 % endif
373 </td>
376 </td>
374 </tr>
377 </tr>
375 %endif
378 %endif
376
379
377 % endfor
380 % endfor
378
381
379 </table>
382 </table>
380 </div>
383 </div>
381 %endfor
384 %endfor
382
385
383 ## outdated comments that are made for a file that has been deleted
386 ## outdated comments that are made for a file that has been deleted
384 % for filename, comments_dict in (deleted_files_comments or {}).items():
387 % for filename, comments_dict in (deleted_files_comments or {}).items():
385
388
386 <%
389 <%
387 display_state = 'display: none'
390 display_state = 'display: none'
388 open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False]
391 open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False]
389 if open_comments_in_file:
392 if open_comments_in_file:
390 display_state = ''
393 display_state = ''
391 fid = str(id(filename))
394 fid = str(id(filename))
392 %>
395 %>
393 <div class="filediffs filediff-outdated" style="${display_state}">
396 <div class="filediffs filediff-outdated" style="${display_state}">
394 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filename)}" type="checkbox" onchange="updateSticky();">
397 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filename)}" type="checkbox" onchange="updateSticky();">
395 <div class="filediff" data-f-path="${filename}" id="a_${h.FID(fid, filename)}">
398 <div class="filediff" data-f-path="${filename}" id="a_${h.FID(fid, filename)}">
396 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
399 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
397 <div class="filediff-collapse-indicator icon-"></div>
400 <div class="filediff-collapse-indicator icon-"></div>
398
401
399 <span class="pill">
402 <span class="pill">
400 ## file was deleted
403 ## file was deleted
401 ${filename}
404 ${filename}
402 </span>
405 </span>
403 <span class="pill-group pull-left" >
406 <span class="pill-group pull-left" >
404 ## file op, doesn't need translation
407 ## file op, doesn't need translation
405 <span class="pill" op="removed">unresolved comments</span>
408 <span class="pill" op="removed">unresolved comments</span>
406 </span>
409 </span>
407 <a class="pill filediff-anchor" href="#a_${h.FID(fid, filename)}"></a>
410 <a class="pill filediff-anchor" href="#a_${h.FID(fid, filename)}"></a>
408 <span class="pill-group pull-right">
411 <span class="pill-group pull-right">
409 <span class="pill" op="deleted">
412 <span class="pill" op="deleted">
410 % if comments_dict['stats'] >0:
413 % if comments_dict['stats'] >0:
411 -${comments_dict['stats']}
414 -${comments_dict['stats']}
412 % else:
415 % else:
413 ${comments_dict['stats']}
416 ${comments_dict['stats']}
414 % endif
417 % endif
415 </span>
418 </span>
416 </span>
419 </span>
417 </label>
420 </label>
418
421
419 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
422 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
420 <tr>
423 <tr>
421 % if c.user_session_attrs["diffmode"] == 'unified':
424 % if c.user_session_attrs["diffmode"] == 'unified':
422 <td></td>
425 <td></td>
423 %endif
426 %endif
424
427
425 <td></td>
428 <td></td>
426 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}>
429 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}>
427 <strong>${_('This file was removed from diff during updates to this pull-request.')}</strong><br/>
430 <strong>${_('This file was removed from diff during updates to this pull-request.')}</strong><br/>
428 ${_('There are still outdated/unresolved comments attached to it.')}
431 ${_('There are still outdated/unresolved comments attached to it.')}
429 </td>
432 </td>
430 </tr>
433 </tr>
431 %if c.user_session_attrs["diffmode"] == 'unified':
434 %if c.user_session_attrs["diffmode"] == 'unified':
432 <tr class="cb-line">
435 <tr class="cb-line">
433 <td class="cb-data cb-context"></td>
436 <td class="cb-data cb-context"></td>
434 <td class="cb-lineno cb-context"></td>
437 <td class="cb-lineno cb-context"></td>
435 <td class="cb-lineno cb-context"></td>
438 <td class="cb-lineno cb-context"></td>
436 <td class="cb-content cb-context">
439 <td class="cb-content cb-context">
437 ${inline_comments_container(comments_dict['comments'], active_pattern_entries=active_pattern_entries)}
440 ${inline_comments_container(comments_dict['comments'], active_pattern_entries=active_pattern_entries)}
438 </td>
441 </td>
439 </tr>
442 </tr>
440 %elif c.user_session_attrs["diffmode"] == 'sideside':
443 %elif c.user_session_attrs["diffmode"] == 'sideside':
441 <tr class="cb-line">
444 <tr class="cb-line">
442 <td class="cb-data cb-context"></td>
445 <td class="cb-data cb-context"></td>
443 <td class="cb-lineno cb-context"></td>
446 <td class="cb-lineno cb-context"></td>
444 <td class="cb-content cb-context"></td>
447 <td class="cb-content cb-context"></td>
445
448
446 <td class="cb-data cb-context"></td>
449 <td class="cb-data cb-context"></td>
447 <td class="cb-lineno cb-context"></td>
450 <td class="cb-lineno cb-context"></td>
448 <td class="cb-content cb-context">
451 <td class="cb-content cb-context">
449 ${inline_comments_container(comments_dict['comments'], active_pattern_entries=active_pattern_entries)}
452 ${inline_comments_container(comments_dict['comments'], active_pattern_entries=active_pattern_entries)}
450 </td>
453 </td>
451 </tr>
454 </tr>
452 %endif
455 %endif
453 </table>
456 </table>
454 </div>
457 </div>
455 </div>
458 </div>
456 % endfor
459 % endfor
457
460
458 </div>
461 </div>
459 </div>
462 </div>
460 </%def>
463 </%def>
461
464
462 <%def name="diff_ops(filediff)">
465 <%def name="diff_ops(filediff)">
463 <%
466 <%
464 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
467 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
465 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
468 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
466 %>
469 %>
467 <span class="pill">
470 <span class="pill">
468 <i class="icon-file-text"></i>
471 <i class="icon-file-text"></i>
469 %if filediff.source_file_path and filediff.target_file_path:
472 %if filediff.source_file_path and filediff.target_file_path:
470 %if filediff.source_file_path != filediff.target_file_path:
473 %if filediff.source_file_path != filediff.target_file_path:
471 ## file was renamed, or copied
474 ## file was renamed, or copied
472 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
475 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
473 ${filediff.target_file_path}<del>${filediff.source_file_path}</del>
476 ${filediff.target_file_path}<del>${filediff.source_file_path}</del>
474 <% final_path = filediff.target_file_path %>
477 <% final_path = filediff.target_file_path %>
475 %elif COPIED_FILENODE in filediff.patch['stats']['ops']:
478 %elif COPIED_FILENODE in filediff.patch['stats']['ops']:
476 ${filediff.target_file_path}${filediff.source_file_path}
479 ${filediff.target_file_path}${filediff.source_file_path}
477 <% final_path = filediff.target_file_path %>
480 <% final_path = filediff.target_file_path %>
478 %endif
481 %endif
479 %else:
482 %else:
480 ## file was modified
483 ## file was modified
481 ${filediff.source_file_path}
484 ${filediff.source_file_path}
482 <% final_path = filediff.source_file_path %>
485 <% final_path = filediff.source_file_path %>
483 %endif
486 %endif
484 %else:
487 %else:
485 %if filediff.source_file_path:
488 %if filediff.source_file_path:
486 ## file was deleted
489 ## file was deleted
487 ${filediff.source_file_path}
490 ${filediff.source_file_path}
488 <% final_path = filediff.source_file_path %>
491 <% final_path = filediff.source_file_path %>
489 %else:
492 %else:
490 ## file was added
493 ## file was added
491 ${filediff.target_file_path}
494 ${filediff.target_file_path}
492 <% final_path = filediff.target_file_path %>
495 <% final_path = filediff.target_file_path %>
493 %endif
496 %endif
494 %endif
497 %endif
495 <i style="color: #aaa" class="on-hover-icon icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy file path')}" onclick="return false;"></i>
498 <i style="color: #aaa" class="on-hover-icon icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy file path')}" onclick="return false;"></i>
496 </span>
499 </span>
497 ## anchor link
500 ## anchor link
498 <a class="pill filediff-anchor" href="#a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></a>
501 <a class="pill filediff-anchor" href="#a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></a>
499
502
500 <span class="pill-group pull-right">
503 <span class="pill-group pull-right">
501
504
502 ## ops pills
505 ## ops pills
503 %if filediff.limited_diff:
506 %if filediff.limited_diff:
504 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
507 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
505 %endif
508 %endif
506
509
507 %if NEW_FILENODE in filediff.patch['stats']['ops']:
510 %if NEW_FILENODE in filediff.patch['stats']['ops']:
508 <span class="pill" op="created">created</span>
511 <span class="pill" op="created">created</span>
509 %if filediff['target_mode'].startswith('120'):
512 %if filediff['target_mode'].startswith('120'):
510 <span class="pill" op="symlink">symlink</span>
513 <span class="pill" op="symlink">symlink</span>
511 %else:
514 %else:
512 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
515 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
513 %endif
516 %endif
514 %endif
517 %endif
515
518
516 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
519 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
517 <span class="pill" op="renamed">renamed</span>
520 <span class="pill" op="renamed">renamed</span>
518 %endif
521 %endif
519
522
520 %if COPIED_FILENODE in filediff.patch['stats']['ops']:
523 %if COPIED_FILENODE in filediff.patch['stats']['ops']:
521 <span class="pill" op="copied">copied</span>
524 <span class="pill" op="copied">copied</span>
522 %endif
525 %endif
523
526
524 %if DEL_FILENODE in filediff.patch['stats']['ops']:
527 %if DEL_FILENODE in filediff.patch['stats']['ops']:
525 <span class="pill" op="removed">removed</span>
528 <span class="pill" op="removed">removed</span>
526 %endif
529 %endif
527
530
528 %if CHMOD_FILENODE in filediff.patch['stats']['ops']:
531 %if CHMOD_FILENODE in filediff.patch['stats']['ops']:
529 <span class="pill" op="mode">
532 <span class="pill" op="mode">
530 ${nice_mode(filediff['source_mode'])}${nice_mode(filediff['target_mode'])}
533 ${nice_mode(filediff['source_mode'])}${nice_mode(filediff['target_mode'])}
531 </span>
534 </span>
532 %endif
535 %endif
533
536
534 %if BIN_FILENODE in filediff.patch['stats']['ops']:
537 %if BIN_FILENODE in filediff.patch['stats']['ops']:
535 <span class="pill" op="binary">binary</span>
538 <span class="pill" op="binary">binary</span>
536 %if MOD_FILENODE in filediff.patch['stats']['ops']:
539 %if MOD_FILENODE in filediff.patch['stats']['ops']:
537 <span class="pill" op="modified">modified</span>
540 <span class="pill" op="modified">modified</span>
538 %endif
541 %endif
539 %endif
542 %endif
540
543
541 <span class="pill" op="added">${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']}</span>
544 <span class="pill" op="added">${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']}</span>
542 <span class="pill" op="deleted">${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)}</span>
545 <span class="pill" op="deleted">${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)}</span>
543
546
544 </span>
547 </span>
545
548
546 </%def>
549 </%def>
547
550
548 <%def name="nice_mode(filemode)">
551 <%def name="nice_mode(filemode)">
549 ${(filemode.startswith('100') and filemode[3:] or filemode)}
552 ${(filemode.startswith('100') and filemode[3:] or filemode)}
550 </%def>
553 </%def>
551
554
552 <%def name="diff_menu(filediff, use_comments=False)">
555 <%def name="diff_menu(filediff, use_comments=False)">
553 <div class="filediff-menu">
556 <div class="filediff-menu">
554
557
555 %if filediff.diffset.source_ref:
558 %if filediff.diffset.source_ref:
556
559
557 ## FILE BEFORE CHANGES
560 ## FILE BEFORE CHANGES
558 %if filediff.operation in ['D', 'M']:
561 %if filediff.operation in ['D', 'M']:
559 <a
562 <a
560 class="tooltip"
563 class="tooltip"
561 href="${h.route_path('repo_files',repo_name=filediff.diffset.target_repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
564 href="${h.route_path('repo_files',repo_name=filediff.diffset.target_repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
562 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
565 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
563 >
566 >
564 ${_('Show file before')}
567 ${_('Show file before')}
565 </a> |
568 </a> |
566 %else:
569 %else:
567 <span
570 <span
568 class="tooltip"
571 class="tooltip"
569 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
572 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
570 >
573 >
571 ${_('Show file before')}
574 ${_('Show file before')}
572 </span> |
575 </span> |
573 %endif
576 %endif
574
577
575 ## FILE AFTER CHANGES
578 ## FILE AFTER CHANGES
576 %if filediff.operation in ['A', 'M']:
579 %if filediff.operation in ['A', 'M']:
577 <a
580 <a
578 class="tooltip"
581 class="tooltip"
579 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)}"
582 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)}"
580 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
583 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
581 >
584 >
582 ${_('Show file after')}
585 ${_('Show file after')}
583 </a>
586 </a>
584 %else:
587 %else:
585 <span
588 <span
586 class="tooltip"
589 class="tooltip"
587 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
590 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
588 >
591 >
589 ${_('Show file after')}
592 ${_('Show file after')}
590 </span>
593 </span>
591 %endif
594 %endif
592
595
593 % if use_comments:
596 % if use_comments:
594 |
597 |
595 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
598 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
596 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
599 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
597 </a>
600 </a>
598 % endif
601 % endif
599
602
600 %endif
603 %endif
601
604
602 </div>
605 </div>
603 </%def>
606 </%def>
604
607
605
608
606 <%def name="inline_comments_container(comments, active_pattern_entries=None)">
609 <%def name="inline_comments_container(comments, active_pattern_entries=None)">
607
610
608 <div class="inline-comments">
611 <div class="inline-comments">
609 %for comment in comments:
612 %for comment in comments:
610 ${commentblock.comment_block(comment, inline=True, active_pattern_entries=active_pattern_entries)}
613 ${commentblock.comment_block(comment, inline=True, active_pattern_entries=active_pattern_entries)}
611 %endfor
614 %endfor
612 % if comments and comments[-1].outdated:
615 % if comments and comments[-1].outdated:
613 <span class="btn btn-secondary cb-comment-add-button comment-outdated}" style="display: none;}">
616 <span class="btn btn-secondary cb-comment-add-button comment-outdated}" style="display: none;}">
614 ${_('Add another comment')}
617 ${_('Add another comment')}
615 </span>
618 </span>
616 % else:
619 % else:
617 <span onclick="return Rhodecode.comments.createComment(this)" class="btn btn-secondary cb-comment-add-button">
620 <span onclick="return Rhodecode.comments.createComment(this)" class="btn btn-secondary cb-comment-add-button">
618 ${_('Add another comment')}
621 ${_('Add another comment')}
619 </span>
622 </span>
620 % endif
623 % endif
621
624
622 </div>
625 </div>
623 </%def>
626 </%def>
624
627
625 <%!
628 <%!
626
629
627 def get_inline_comments(comments, filename):
630 def get_inline_comments(comments, filename):
628 if hasattr(filename, 'unicode_path'):
631 if hasattr(filename, 'unicode_path'):
629 filename = filename.unicode_path
632 filename = filename.unicode_path
630
633
631 if not isinstance(filename, (unicode, str)):
634 if not isinstance(filename, (unicode, str)):
632 return None
635 return None
633
636
634 if comments and filename in comments:
637 if comments and filename in comments:
635 return comments[filename]
638 return comments[filename]
636
639
637 return None
640 return None
638
641
639 def get_comments_for(diff_type, comments, filename, line_version, line_number):
642 def get_comments_for(diff_type, comments, filename, line_version, line_number):
640 if hasattr(filename, 'unicode_path'):
643 if hasattr(filename, 'unicode_path'):
641 filename = filename.unicode_path
644 filename = filename.unicode_path
642
645
643 if not isinstance(filename, (unicode, str)):
646 if not isinstance(filename, (unicode, str)):
644 return None
647 return None
645
648
646 file_comments = get_inline_comments(comments, filename)
649 file_comments = get_inline_comments(comments, filename)
647 if file_comments is None:
650 if file_comments is None:
648 return None
651 return None
649
652
650 line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12
653 line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12
651 if line_key in file_comments:
654 if line_key in file_comments:
652 data = file_comments.pop(line_key)
655 data = file_comments.pop(line_key)
653 return data
656 return data
654 %>
657 %>
655
658
656 <%def name="render_hunk_lines_sideside(filediff, hunk, use_comments=False, inline_comments=None, active_pattern_entries=None)">
659 <%def name="render_hunk_lines_sideside(filediff, hunk, use_comments=False, inline_comments=None, active_pattern_entries=None)">
657 %for i, line in enumerate(hunk.sideside):
660 %for i, line in enumerate(hunk.sideside):
658 <%
661 <%
659 old_line_anchor, new_line_anchor = None, None
662 old_line_anchor, new_line_anchor = None, None
660
663
661 if line.original.lineno:
664 if line.original.lineno:
662 old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, line.original.lineno, 'o')
665 old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, line.original.lineno, 'o')
663 if line.modified.lineno:
666 if line.modified.lineno:
664 new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, line.modified.lineno, 'n')
667 new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, line.modified.lineno, 'n')
665 %>
668 %>
666
669
667 <tr class="cb-line">
670 <tr class="cb-line">
668 <td class="cb-data ${action_class(line.original.action)}"
671 <td class="cb-data ${action_class(line.original.action)}"
669 data-line-no="${line.original.lineno}"
672 data-line-no="${line.original.lineno}"
670 >
673 >
671 <div>
674 <div>
672
675
673 <% line_old_comments = None %>
676 <% line_old_comments = None %>
674 %if line.original.get_comment_args:
677 %if line.original.get_comment_args:
675 <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %>
678 <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %>
676 %endif
679 %endif
677 %if line_old_comments:
680 %if line_old_comments:
678 <% has_outdated = any([x.outdated for x in line_old_comments]) %>
681 <% has_outdated = any([x.outdated for x in line_old_comments]) %>
679 % if has_outdated:
682 % if has_outdated:
680 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(line_old_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
683 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(line_old_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
681 % else:
684 % else:
682 <i class="tooltip" title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
685 <i class="tooltip" title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
683 % endif
686 % endif
684 %endif
687 %endif
685 </div>
688 </div>
686 </td>
689 </td>
687 <td class="cb-lineno ${action_class(line.original.action)}"
690 <td class="cb-lineno ${action_class(line.original.action)}"
688 data-line-no="${line.original.lineno}"
691 data-line-no="${line.original.lineno}"
689 %if old_line_anchor:
692 %if old_line_anchor:
690 id="${old_line_anchor}"
693 id="${old_line_anchor}"
691 %endif
694 %endif
692 >
695 >
693 %if line.original.lineno:
696 %if line.original.lineno:
694 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
697 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
695 %endif
698 %endif
696 </td>
699 </td>
697 <td class="cb-content ${action_class(line.original.action)}"
700 <td class="cb-content ${action_class(line.original.action)}"
698 data-line-no="o${line.original.lineno}"
701 data-line-no="o${line.original.lineno}"
699 >
702 >
700 %if use_comments and line.original.lineno:
703 %if use_comments and line.original.lineno:
701 ${render_add_comment_button()}
704 ${render_add_comment_button()}
702 %endif
705 %endif
703 <span class="cb-code"><span class="cb-action ${action_class(line.original.action)}"></span>${line.original.content or '' | n}</span>
706 <span class="cb-code"><span class="cb-action ${action_class(line.original.action)}"></span>${line.original.content or '' | n}</span>
704
707
705 %if use_comments and line.original.lineno and line_old_comments:
708 %if use_comments and line.original.lineno and line_old_comments:
706 ${inline_comments_container(line_old_comments, active_pattern_entries=active_pattern_entries)}
709 ${inline_comments_container(line_old_comments, active_pattern_entries=active_pattern_entries)}
707 %endif
710 %endif
708
711
709 </td>
712 </td>
710 <td class="cb-data ${action_class(line.modified.action)}"
713 <td class="cb-data ${action_class(line.modified.action)}"
711 data-line-no="${line.modified.lineno}"
714 data-line-no="${line.modified.lineno}"
712 >
715 >
713 <div>
716 <div>
714
717
715 %if line.modified.get_comment_args:
718 %if line.modified.get_comment_args:
716 <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %>
719 <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %>
717 %else:
720 %else:
718 <% line_new_comments = None%>
721 <% line_new_comments = None%>
719 %endif
722 %endif
720 %if line_new_comments:
723 %if line_new_comments:
721 <% has_outdated = any([x.outdated for x in line_new_comments]) %>
724 <% has_outdated = any([x.outdated for x in line_new_comments]) %>
722 % if has_outdated:
725 % if has_outdated:
723 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(line_new_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
726 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(line_new_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
724 % else:
727 % else:
725 <i class="tooltip" title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
728 <i class="tooltip" title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
726 % endif
729 % endif
727 %endif
730 %endif
728 </div>
731 </div>
729 </td>
732 </td>
730 <td class="cb-lineno ${action_class(line.modified.action)}"
733 <td class="cb-lineno ${action_class(line.modified.action)}"
731 data-line-no="${line.modified.lineno}"
734 data-line-no="${line.modified.lineno}"
732 %if new_line_anchor:
735 %if new_line_anchor:
733 id="${new_line_anchor}"
736 id="${new_line_anchor}"
734 %endif
737 %endif
735 >
738 >
736 %if line.modified.lineno:
739 %if line.modified.lineno:
737 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
740 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
738 %endif
741 %endif
739 </td>
742 </td>
740 <td class="cb-content ${action_class(line.modified.action)}"
743 <td class="cb-content ${action_class(line.modified.action)}"
741 data-line-no="n${line.modified.lineno}"
744 data-line-no="n${line.modified.lineno}"
742 >
745 >
743 %if use_comments and line.modified.lineno:
746 %if use_comments and line.modified.lineno:
744 ${render_add_comment_button()}
747 ${render_add_comment_button()}
745 %endif
748 %endif
746 <span class="cb-code"><span class="cb-action ${action_class(line.modified.action)}"></span>${line.modified.content or '' | n}</span>
749 <span class="cb-code"><span class="cb-action ${action_class(line.modified.action)}"></span>${line.modified.content or '' | n}</span>
747 %if use_comments and line.modified.lineno and line_new_comments:
750 %if use_comments and line.modified.lineno and line_new_comments:
748 ${inline_comments_container(line_new_comments, active_pattern_entries=active_pattern_entries)}
751 ${inline_comments_container(line_new_comments, active_pattern_entries=active_pattern_entries)}
749 %endif
752 %endif
750 </td>
753 </td>
751 </tr>
754 </tr>
752 %endfor
755 %endfor
753 </%def>
756 </%def>
754
757
755
758
756 <%def name="render_hunk_lines_unified(filediff, hunk, use_comments=False, inline_comments=None, active_pattern_entries=None)">
759 <%def name="render_hunk_lines_unified(filediff, hunk, use_comments=False, inline_comments=None, active_pattern_entries=None)">
757 %for old_line_no, new_line_no, action, content, comments_args in hunk.unified:
760 %for old_line_no, new_line_no, action, content, comments_args in hunk.unified:
758
761
759 <%
762 <%
760 old_line_anchor, new_line_anchor = None, None
763 old_line_anchor, new_line_anchor = None, None
761 if old_line_no:
764 if old_line_no:
762 old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, old_line_no, 'o')
765 old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, old_line_no, 'o')
763 if new_line_no:
766 if new_line_no:
764 new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, new_line_no, 'n')
767 new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, new_line_no, 'n')
765 %>
768 %>
766 <tr class="cb-line">
769 <tr class="cb-line">
767 <td class="cb-data ${action_class(action)}">
770 <td class="cb-data ${action_class(action)}">
768 <div>
771 <div>
769
772
770 %if comments_args:
773 %if comments_args:
771 <% comments = get_comments_for('unified', inline_comments, *comments_args) %>
774 <% comments = get_comments_for('unified', inline_comments, *comments_args) %>
772 %else:
775 %else:
773 <% comments = None %>
776 <% comments = None %>
774 %endif
777 %endif
775
778
776 % if comments:
779 % if comments:
777 <% has_outdated = any([x.outdated for x in comments]) %>
780 <% has_outdated = any([x.outdated for x in comments]) %>
778 % if has_outdated:
781 % if has_outdated:
779 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
782 <i class="tooltip" title="${_('comments including outdated, click to show them')}:${len(comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
780 % else:
783 % else:
781 <i class="tooltip" title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
784 <i class="tooltip" title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
782 % endif
785 % endif
783 % endif
786 % endif
784 </div>
787 </div>
785 </td>
788 </td>
786 <td class="cb-lineno ${action_class(action)}"
789 <td class="cb-lineno ${action_class(action)}"
787 data-line-no="${old_line_no}"
790 data-line-no="${old_line_no}"
788 %if old_line_anchor:
791 %if old_line_anchor:
789 id="${old_line_anchor}"
792 id="${old_line_anchor}"
790 %endif
793 %endif
791 >
794 >
792 %if old_line_anchor:
795 %if old_line_anchor:
793 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
796 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
794 %endif
797 %endif
795 </td>
798 </td>
796 <td class="cb-lineno ${action_class(action)}"
799 <td class="cb-lineno ${action_class(action)}"
797 data-line-no="${new_line_no}"
800 data-line-no="${new_line_no}"
798 %if new_line_anchor:
801 %if new_line_anchor:
799 id="${new_line_anchor}"
802 id="${new_line_anchor}"
800 %endif
803 %endif
801 >
804 >
802 %if new_line_anchor:
805 %if new_line_anchor:
803 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
806 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
804 %endif
807 %endif
805 </td>
808 </td>
806 <td class="cb-content ${action_class(action)}"
809 <td class="cb-content ${action_class(action)}"
807 data-line-no="${(new_line_no and 'n' or 'o')}${(new_line_no or old_line_no)}"
810 data-line-no="${(new_line_no and 'n' or 'o')}${(new_line_no or old_line_no)}"
808 >
811 >
809 %if use_comments:
812 %if use_comments:
810 ${render_add_comment_button()}
813 ${render_add_comment_button()}
811 %endif
814 %endif
812 <span class="cb-code"><span class="cb-action ${action_class(action)}"></span> ${content or '' | n}</span>
815 <span class="cb-code"><span class="cb-action ${action_class(action)}"></span> ${content or '' | n}</span>
813 %if use_comments and comments:
816 %if use_comments and comments:
814 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
817 ${inline_comments_container(comments, active_pattern_entries=active_pattern_entries)}
815 %endif
818 %endif
816 </td>
819 </td>
817 </tr>
820 </tr>
818 %endfor
821 %endfor
819 </%def>
822 </%def>
820
823
821
824
822 <%def name="render_hunk_lines(filediff, diff_mode, hunk, use_comments, inline_comments, active_pattern_entries)">
825 <%def name="render_hunk_lines(filediff, diff_mode, hunk, use_comments, inline_comments, active_pattern_entries)">
823 % if diff_mode == 'unified':
826 % if diff_mode == 'unified':
824 ${render_hunk_lines_unified(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
827 ${render_hunk_lines_unified(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
825 % elif diff_mode == 'sideside':
828 % elif diff_mode == 'sideside':
826 ${render_hunk_lines_sideside(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
829 ${render_hunk_lines_sideside(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments, active_pattern_entries=active_pattern_entries)}
827 % else:
830 % else:
828 <tr class="cb-line">
831 <tr class="cb-line">
829 <td>unknown diff mode</td>
832 <td>unknown diff mode</td>
830 </tr>
833 </tr>
831 % endif
834 % endif
832 </%def>file changes
835 </%def>file changes
833
836
834
837
835 <%def name="render_add_comment_button()">
838 <%def name="render_add_comment_button()">
836 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
839 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
837 <span><i class="icon-comment"></i></span>
840 <span><i class="icon-comment"></i></span>
838 </button>
841 </button>
839 </%def>
842 </%def>
840
843
841 <%def name="render_diffset_menu(diffset, range_diff_on=None)">
844 <%def name="render_diffset_menu(diffset, range_diff_on=None)">
842 <% diffset_container_id = h.md5(diffset.target_ref) %>
845 <% diffset_container_id = h.md5(diffset.target_ref) %>
843
846
844 <div id="diff-file-sticky" class="diffset-menu clearinner">
847 <div id="diff-file-sticky" class="diffset-menu clearinner">
845 ## auto adjustable
848 ## auto adjustable
846 <div class="sidebar__inner">
849 <div class="sidebar__inner">
847 <div class="sidebar__bar">
850 <div class="sidebar__bar">
848 <div class="pull-right">
851 <div class="pull-right">
849 <div class="btn-group">
852 <div class="btn-group">
850 <a class="btn tooltip toggle-wide-diff" href="#toggle-wide-diff" onclick="toggleWideDiff(this); return false" title="${h.tooltip(_('Toggle wide diff'))}">
853 <a class="btn tooltip toggle-wide-diff" href="#toggle-wide-diff" onclick="toggleWideDiff(this); return false" title="${h.tooltip(_('Toggle wide diff'))}">
851 <i class="icon-wide-mode"></i>
854 <i class="icon-wide-mode"></i>
852 </a>
855 </a>
853 </div>
856 </div>
854 <div class="btn-group">
857 <div class="btn-group">
855
858
856 <a
859 <a
857 class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-active')} tooltip"
860 class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-active')} tooltip"
858 title="${h.tooltip(_('View diff as side by side'))}"
861 title="${h.tooltip(_('View diff as side by side'))}"
859 href="${h.current_route_path(request, diffmode='sideside')}">
862 href="${h.current_route_path(request, diffmode='sideside')}">
860 <span>${_('Side by Side')}</span>
863 <span>${_('Side by Side')}</span>
861 </a>
864 </a>
862
865
863 <a
866 <a
864 class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-active')} tooltip"
867 class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-active')} tooltip"
865 title="${h.tooltip(_('View diff as unified'))}" href="${h.current_route_path(request, diffmode='unified')}">
868 title="${h.tooltip(_('View diff as unified'))}" href="${h.current_route_path(request, diffmode='unified')}">
866 <span>${_('Unified')}</span>
869 <span>${_('Unified')}</span>
867 </a>
870 </a>
868
871
869 % if range_diff_on is True:
872 % if range_diff_on is True:
870 <a
873 <a
871 title="${_('Turn off: Show the diff as commit range')}"
874 title="${_('Turn off: Show the diff as commit range')}"
872 class="btn btn-primary"
875 class="btn btn-primary"
873 href="${h.current_route_path(request, **{"range-diff":"0"})}">
876 href="${h.current_route_path(request, **{"range-diff":"0"})}">
874 <span>${_('Range Diff')}</span>
877 <span>${_('Range Diff')}</span>
875 </a>
878 </a>
876 % elif range_diff_on is False:
879 % elif range_diff_on is False:
877 <a
880 <a
878 title="${_('Show the diff as commit range')}"
881 title="${_('Show the diff as commit range')}"
879 class="btn"
882 class="btn"
880 href="${h.current_route_path(request, **{"range-diff":"1"})}">
883 href="${h.current_route_path(request, **{"range-diff":"1"})}">
881 <span>${_('Range Diff')}</span>
884 <span>${_('Range Diff')}</span>
882 </a>
885 </a>
883 % endif
886 % endif
884 </div>
887 </div>
885 <div class="btn-group">
888 <div class="btn-group">
886
889
887 <div class="pull-left">
890 <div class="pull-left">
888 ${h.hidden('diff_menu_{}'.format(diffset_container_id))}
891 ${h.hidden('diff_menu_{}'.format(diffset_container_id))}
889 </div>
892 </div>
890
893
891 </div>
894 </div>
892 </div>
895 </div>
893 <div class="pull-left">
896 <div class="pull-left">
894 <div class="btn-group">
897 <div class="btn-group">
895 <div class="pull-left">
898 <div class="pull-left">
896 ${h.hidden('file_filter_{}'.format(diffset_container_id))}
899 ${h.hidden('file_filter_{}'.format(diffset_container_id))}
897 </div>
900 </div>
898
901
899 </div>
902 </div>
900 </div>
903 </div>
901 </div>
904 </div>
902 <div class="fpath-placeholder">
905 <div class="fpath-placeholder">
903 <i class="icon-file-text"></i>
906 <i class="icon-file-text"></i>
904 <strong class="fpath-placeholder-text">
907 <strong class="fpath-placeholder-text">
905 Context file:
908 Context file:
906 </strong>
909 </strong>
907 </div>
910 </div>
908 <div class="sidebar_inner_shadow"></div>
911 <div class="sidebar_inner_shadow"></div>
909 </div>
912 </div>
910 </div>
913 </div>
911
914
912 % if diffset:
915 % if diffset:
913 %if diffset.limited_diff:
916 %if diffset.limited_diff:
914 <% file_placeholder = _ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files} %>
917 <% file_placeholder = _ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files} %>
915 %else:
918 %else:
916 <% file_placeholder = h.literal(_ungettext('%(num)s file changed: <span class="op-added">%(linesadd)s inserted</span>, <span class="op-deleted">%(linesdel)s deleted</span>', '%(num)s files changed: <span class="op-added">%(linesadd)s inserted</span>, <span class="op-deleted">%(linesdel)s deleted</span>',
919 <% file_placeholder = h.literal(_ungettext('%(num)s file changed: <span class="op-added">%(linesadd)s inserted</span>, <span class="op-deleted">%(linesdel)s deleted</span>', '%(num)s files changed: <span class="op-added">%(linesadd)s inserted</span>, <span class="op-deleted">%(linesdel)s deleted</span>',
917 diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}) %>
920 diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}) %>
918
921
919 %endif
922 %endif
920 ## case on range-diff placeholder needs to be updated
923 ## case on range-diff placeholder needs to be updated
921 % if range_diff_on is True:
924 % if range_diff_on is True:
922 <% file_placeholder = _('Disabled on range diff') %>
925 <% file_placeholder = _('Disabled on range diff') %>
923 % endif
926 % endif
924
927
925 <script type="text/javascript">
928 <script type="text/javascript">
926 var feedFilesOptions = function (query, initialData) {
929 var feedFilesOptions = function (query, initialData) {
927 var data = {results: []};
930 var data = {results: []};
928 var isQuery = typeof query.term !== 'undefined';
931 var isQuery = typeof query.term !== 'undefined';
929
932
930 var section = _gettext('Changed files');
933 var section = _gettext('Changed files');
931 var filteredData = [];
934 var filteredData = [];
932
935
933 //filter results
936 //filter results
934 $.each(initialData.results, function (idx, value) {
937 $.each(initialData.results, function (idx, value) {
935
938
936 if (!isQuery || query.term.length === 0 || value.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
939 if (!isQuery || query.term.length === 0 || value.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) {
937 filteredData.push({
940 filteredData.push({
938 'id': this.id,
941 'id': this.id,
939 'text': this.text,
942 'text': this.text,
940 "ops": this.ops,
943 "ops": this.ops,
941 })
944 })
942 }
945 }
943
946
944 });
947 });
945
948
946 data.results = filteredData;
949 data.results = filteredData;
947
950
948 query.callback(data);
951 query.callback(data);
949 };
952 };
950
953
951 var selectionFormatter = function(data, escapeMarkup) {
954 var selectionFormatter = function(data, escapeMarkup) {
952 var container = '<div class="filelist" style="padding-right:100px">{0}</div>';
955 var container = '<div class="filelist" style="padding-right:100px">{0}</div>';
953 var tmpl = '<div><strong>{0}</strong></div>'.format(escapeMarkup(data['text']));
956 var tmpl = '<div><strong>{0}</strong></div>'.format(escapeMarkup(data['text']));
954 var pill = '<div class="pill-group" style="position: absolute; top:7px; right: 0">' +
957 var pill = '<div class="pill-group" style="position: absolute; top:7px; right: 0">' +
955 '<span class="pill" op="added">{0}</span>' +
958 '<span class="pill" op="added">{0}</span>' +
956 '<span class="pill" op="deleted">{1}</span>' +
959 '<span class="pill" op="deleted">{1}</span>' +
957 '</div>'
960 '</div>'
958 ;
961 ;
959 var added = data['ops']['added'];
962 var added = data['ops']['added'];
960 if (added === 0) {
963 if (added === 0) {
961 // don't show +0
964 // don't show +0
962 added = 0;
965 added = 0;
963 } else {
966 } else {
964 added = '+' + added;
967 added = '+' + added;
965 }
968 }
966
969
967 var deleted = -1*data['ops']['deleted'];
970 var deleted = -1*data['ops']['deleted'];
968
971
969 tmpl += pill.format(added, deleted);
972 tmpl += pill.format(added, deleted);
970 return container.format(tmpl);
973 return container.format(tmpl);
971 };
974 };
972 var formatFileResult = function(result, container, query, escapeMarkup) {
975 var formatFileResult = function(result, container, query, escapeMarkup) {
973 return selectionFormatter(result, escapeMarkup);
976 return selectionFormatter(result, escapeMarkup);
974 };
977 };
975
978
976 var formatSelection = function (data, container) {
979 var formatSelection = function (data, container) {
977 return '${file_placeholder}'
980 return '${file_placeholder}'
978 };
981 };
979
982
980 if (window.preloadFileFilterData === undefined) {
983 if (window.preloadFileFilterData === undefined) {
981 window.preloadFileFilterData = {}
984 window.preloadFileFilterData = {}
982 }
985 }
983
986
984 preloadFileFilterData["${diffset_container_id}"] = {
987 preloadFileFilterData["${diffset_container_id}"] = {
985 results: [
988 results: [
986 % for filediff in diffset.files:
989 % for filediff in diffset.files:
987 {id:"a_${h.FID(filediff.raw_id, filediff.patch['filename'])}",
990 {id:"a_${h.FID(filediff.raw_id, filediff.patch['filename'])}",
988 text:"${filediff.patch['filename']}",
991 text:"${filediff.patch['filename']}",
989 ops:${h.json.dumps(filediff.patch['stats'])|n}}${('' if loop.last else ',')}
992 ops:${h.json.dumps(filediff.patch['stats'])|n}}${('' if loop.last else ',')}
990 % endfor
993 % endfor
991 ]
994 ]
992 };
995 };
993
996
994 var diffFileFilterId = "#file_filter_" + "${diffset_container_id}";
997 var diffFileFilterId = "#file_filter_" + "${diffset_container_id}";
995 var diffFileFilter = $(diffFileFilterId).select2({
998 var diffFileFilter = $(diffFileFilterId).select2({
996 'dropdownAutoWidth': true,
999 'dropdownAutoWidth': true,
997 'width': 'auto',
1000 'width': 'auto',
998
1001
999 containerCssClass: "drop-menu",
1002 containerCssClass: "drop-menu",
1000 dropdownCssClass: "drop-menu-dropdown",
1003 dropdownCssClass: "drop-menu-dropdown",
1001 data: preloadFileFilterData["${diffset_container_id}"],
1004 data: preloadFileFilterData["${diffset_container_id}"],
1002 query: function(query) {
1005 query: function(query) {
1003 feedFilesOptions(query, preloadFileFilterData["${diffset_container_id}"]);
1006 feedFilesOptions(query, preloadFileFilterData["${diffset_container_id}"]);
1004 },
1007 },
1005 initSelection: function(element, callback) {
1008 initSelection: function(element, callback) {
1006 callback({'init': true});
1009 callback({'init': true});
1007 },
1010 },
1008 formatResult: formatFileResult,
1011 formatResult: formatFileResult,
1009 formatSelection: formatSelection
1012 formatSelection: formatSelection
1010 });
1013 });
1011
1014
1012 % if range_diff_on is True:
1015 % if range_diff_on is True:
1013 diffFileFilter.select2("enable", false);
1016 diffFileFilter.select2("enable", false);
1014 % endif
1017 % endif
1015
1018
1016 $(diffFileFilterId).on('select2-selecting', function (e) {
1019 $(diffFileFilterId).on('select2-selecting', function (e) {
1017 var idSelector = e.choice.id;
1020 var idSelector = e.choice.id;
1018
1021
1019 // expand the container if we quick-select the field
1022 // expand the container if we quick-select the field
1020 $('#'+idSelector).next().prop('checked', false);
1023 $('#'+idSelector).next().prop('checked', false);
1021 // hide the mast as we later do preventDefault()
1024 // hide the mast as we later do preventDefault()
1022 $("#select2-drop-mask").click();
1025 $("#select2-drop-mask").click();
1023
1026
1024 window.location.hash = '#'+idSelector;
1027 window.location.hash = '#'+idSelector;
1025 updateSticky();
1028 updateSticky();
1026
1029
1027 e.preventDefault();
1030 e.preventDefault();
1028 });
1031 });
1029
1032
1030 </script>
1033 </script>
1031 % endif
1034 % endif
1032
1035
1033 <script type="text/javascript">
1036 <script type="text/javascript">
1034 $(document).ready(function () {
1037 $(document).ready(function () {
1035
1038
1036 var contextPrefix = _gettext('Context file: ');
1039 var contextPrefix = _gettext('Context file: ');
1037 ## sticky sidebar
1040 ## sticky sidebar
1038 var sidebarElement = document.getElementById('diff-file-sticky');
1041 var sidebarElement = document.getElementById('diff-file-sticky');
1039 sidebar = new StickySidebar(sidebarElement, {
1042 sidebar = new StickySidebar(sidebarElement, {
1040 topSpacing: 0,
1043 topSpacing: 0,
1041 bottomSpacing: 0,
1044 bottomSpacing: 0,
1042 innerWrapperSelector: '.sidebar__inner'
1045 innerWrapperSelector: '.sidebar__inner'
1043 });
1046 });
1044 sidebarElement.addEventListener('affixed.static.stickySidebar', function () {
1047 sidebarElement.addEventListener('affixed.static.stickySidebar', function () {
1045 // reset our file so it's not holding new value
1048 // reset our file so it's not holding new value
1046 $('.fpath-placeholder-text').html(contextPrefix + ' - ')
1049 $('.fpath-placeholder-text').html(contextPrefix + ' - ')
1047 });
1050 });
1048
1051
1049 updateSticky = function () {
1052 updateSticky = function () {
1050 sidebar.updateSticky();
1053 sidebar.updateSticky();
1051 Waypoint.refreshAll();
1054 Waypoint.refreshAll();
1052 };
1055 };
1053
1056
1054 var animateText = function (fPath, anchorId) {
1057 var animateText = function (fPath, anchorId) {
1055 fPath = Select2.util.escapeMarkup(fPath);
1058 fPath = Select2.util.escapeMarkup(fPath);
1056 $('.fpath-placeholder-text').html(contextPrefix + '<a href="#a_' + anchorId + '">' + fPath + '</a>')
1059 $('.fpath-placeholder-text').html(contextPrefix + '<a href="#a_' + anchorId + '">' + fPath + '</a>')
1057 };
1060 };
1058
1061
1059 ## dynamic file waypoints
1062 ## dynamic file waypoints
1060 var setFPathInfo = function(fPath, anchorId){
1063 var setFPathInfo = function(fPath, anchorId){
1061 animateText(fPath, anchorId)
1064 animateText(fPath, anchorId)
1062 };
1065 };
1063
1066
1064 var codeBlock = $('.filediff');
1067 var codeBlock = $('.filediff');
1065
1068
1066 // forward waypoint
1069 // forward waypoint
1067 codeBlock.waypoint(
1070 codeBlock.waypoint(
1068 function(direction) {
1071 function(direction) {
1069 if (direction === "down"){
1072 if (direction === "down"){
1070 setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId'))
1073 setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId'))
1071 }
1074 }
1072 }, {
1075 }, {
1073 offset: function () {
1076 offset: function () {
1074 return 70;
1077 return 70;
1075 },
1078 },
1076 context: '.fpath-placeholder'
1079 context: '.fpath-placeholder'
1077 }
1080 }
1078 );
1081 );
1079
1082
1080 // backward waypoint
1083 // backward waypoint
1081 codeBlock.waypoint(
1084 codeBlock.waypoint(
1082 function(direction) {
1085 function(direction) {
1083 if (direction === "up"){
1086 if (direction === "up"){
1084 setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId'))
1087 setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId'))
1085 }
1088 }
1086 }, {
1089 }, {
1087 offset: function () {
1090 offset: function () {
1088 return -this.element.clientHeight + 90;
1091 return -this.element.clientHeight + 90;
1089 },
1092 },
1090 context: '.fpath-placeholder'
1093 context: '.fpath-placeholder'
1091 }
1094 }
1092 );
1095 );
1093
1096
1094 toggleWideDiff = function (el) {
1097 toggleWideDiff = function (el) {
1095 updateSticky();
1098 updateSticky();
1096 var wide = Rhodecode.comments.toggleWideMode(this);
1099 var wide = Rhodecode.comments.toggleWideMode(this);
1097 storeUserSessionAttr('rc_user_session_attr.wide_diff_mode', wide);
1100 storeUserSessionAttr('rc_user_session_attr.wide_diff_mode', wide);
1098 if (wide === true) {
1101 if (wide === true) {
1099 $(el).addClass('btn-active');
1102 $(el).addClass('btn-active');
1100 } else {
1103 } else {
1101 $(el).removeClass('btn-active');
1104 $(el).removeClass('btn-active');
1102 }
1105 }
1103 return null;
1106 return null;
1104 };
1107 };
1105
1108
1106 var preloadDiffMenuData = {
1109 var preloadDiffMenuData = {
1107 results: [
1110 results: [
1108
1111
1109 ## Whitespace change
1112 ## Whitespace change
1110 % if request.GET.get('ignorews', '') == '1':
1113 % if request.GET.get('ignorews', '') == '1':
1111 {
1114 {
1112 id: 2,
1115 id: 2,
1113 text: _gettext('Show whitespace changes'),
1116 text: _gettext('Show whitespace changes'),
1114 action: function () {},
1117 action: function () {},
1115 url: "${h.current_route_path(request, ignorews=0)|n}"
1118 url: "${h.current_route_path(request, ignorews=0)|n}"
1116 },
1119 },
1117 % else:
1120 % else:
1118 {
1121 {
1119 id: 2,
1122 id: 2,
1120 text: _gettext('Hide whitespace changes'),
1123 text: _gettext('Hide whitespace changes'),
1121 action: function () {},
1124 action: function () {},
1122 url: "${h.current_route_path(request, ignorews=1)|n}"
1125 url: "${h.current_route_path(request, ignorews=1)|n}"
1123 },
1126 },
1124 % endif
1127 % endif
1125
1128
1126 ## FULL CONTEXT
1129 ## FULL CONTEXT
1127 % if request.GET.get('fullcontext', '') == '1':
1130 % if request.GET.get('fullcontext', '') == '1':
1128 {
1131 {
1129 id: 3,
1132 id: 3,
1130 text: _gettext('Hide full context diff'),
1133 text: _gettext('Hide full context diff'),
1131 action: function () {},
1134 action: function () {},
1132 url: "${h.current_route_path(request, fullcontext=0)|n}"
1135 url: "${h.current_route_path(request, fullcontext=0)|n}"
1133 },
1136 },
1134 % else:
1137 % else:
1135 {
1138 {
1136 id: 3,
1139 id: 3,
1137 text: _gettext('Show full context diff'),
1140 text: _gettext('Show full context diff'),
1138 action: function () {},
1141 action: function () {},
1139 url: "${h.current_route_path(request, fullcontext=1)|n}"
1142 url: "${h.current_route_path(request, fullcontext=1)|n}"
1140 },
1143 },
1141 % endif
1144 % endif
1142
1145
1143 ]
1146 ]
1144 };
1147 };
1145
1148
1146 var diffMenuId = "#diff_menu_" + "${diffset_container_id}";
1149 var diffMenuId = "#diff_menu_" + "${diffset_container_id}";
1147 $(diffMenuId).select2({
1150 $(diffMenuId).select2({
1148 minimumResultsForSearch: -1,
1151 minimumResultsForSearch: -1,
1149 containerCssClass: "drop-menu-no-width",
1152 containerCssClass: "drop-menu-no-width",
1150 dropdownCssClass: "drop-menu-dropdown",
1153 dropdownCssClass: "drop-menu-dropdown",
1151 dropdownAutoWidth: true,
1154 dropdownAutoWidth: true,
1152 data: preloadDiffMenuData,
1155 data: preloadDiffMenuData,
1153 placeholder: "${_('...')}",
1156 placeholder: "${_('...')}",
1154 });
1157 });
1155 $(diffMenuId).on('select2-selecting', function (e) {
1158 $(diffMenuId).on('select2-selecting', function (e) {
1156 e.choice.action();
1159 e.choice.action();
1157 if (e.choice.url !== null) {
1160 if (e.choice.url !== null) {
1158 window.location = e.choice.url
1161 window.location = e.choice.url
1159 }
1162 }
1160 });
1163 });
1161 toggleExpand = function (el, diffsetEl) {
1164 toggleExpand = function (el, diffsetEl) {
1162 var el = $(el);
1165 var el = $(el);
1163 if (el.hasClass('collapsed')) {
1166 if (el.hasClass('collapsed')) {
1164 $('.filediff-collapse-state.collapse-{0}'.format(diffsetEl)).prop('checked', false);
1167 $('.filediff-collapse-state.collapse-{0}'.format(diffsetEl)).prop('checked', false);
1165 el.removeClass('collapsed');
1168 el.removeClass('collapsed');
1166 el.html(
1169 el.html(
1167 '<i class="icon-minus-squared-alt icon-no-margin"></i>' +
1170 '<i class="icon-minus-squared-alt icon-no-margin"></i>' +
1168 _gettext('Collapse all files'));
1171 _gettext('Collapse all files'));
1169 }
1172 }
1170 else {
1173 else {
1171 $('.filediff-collapse-state.collapse-{0}'.format(diffsetEl)).prop('checked', true);
1174 $('.filediff-collapse-state.collapse-{0}'.format(diffsetEl)).prop('checked', true);
1172 el.addClass('collapsed');
1175 el.addClass('collapsed');
1173 el.html(
1176 el.html(
1174 '<i class="icon-plus-squared-alt icon-no-margin"></i>' +
1177 '<i class="icon-plus-squared-alt icon-no-margin"></i>' +
1175 _gettext('Expand all files'));
1178 _gettext('Expand all files'));
1176 }
1179 }
1177 updateSticky()
1180 updateSticky()
1178 };
1181 };
1179
1182
1180 toggleCommitExpand = function (el) {
1183 toggleCommitExpand = function (el) {
1181 var $el = $(el);
1184 var $el = $(el);
1182 var commits = $el.data('toggleCommitsCnt');
1185 var commits = $el.data('toggleCommitsCnt');
1183 var collapseMsg = _ngettext('Collapse {0} commit', 'Collapse {0} commits', commits).format(commits);
1186 var collapseMsg = _ngettext('Collapse {0} commit', 'Collapse {0} commits', commits).format(commits);
1184 var expandMsg = _ngettext('Expand {0} commit', 'Expand {0} commits', commits).format(commits);
1187 var expandMsg = _ngettext('Expand {0} commit', 'Expand {0} commits', commits).format(commits);
1185
1188
1186 if ($el.hasClass('collapsed')) {
1189 if ($el.hasClass('collapsed')) {
1187 $('.compare_select').show();
1190 $('.compare_select').show();
1188 $('.compare_select_hidden').hide();
1191 $('.compare_select_hidden').hide();
1189
1192
1190 $el.removeClass('collapsed');
1193 $el.removeClass('collapsed');
1191 $el.html(
1194 $el.html(
1192 '<i class="icon-minus-squared-alt icon-no-margin"></i>' +
1195 '<i class="icon-minus-squared-alt icon-no-margin"></i>' +
1193 collapseMsg);
1196 collapseMsg);
1194 }
1197 }
1195 else {
1198 else {
1196 $('.compare_select').hide();
1199 $('.compare_select').hide();
1197 $('.compare_select_hidden').show();
1200 $('.compare_select_hidden').show();
1198 $el.addClass('collapsed');
1201 $el.addClass('collapsed');
1199 $el.html(
1202 $el.html(
1200 '<i class="icon-plus-squared-alt icon-no-margin"></i>' +
1203 '<i class="icon-plus-squared-alt icon-no-margin"></i>' +
1201 expandMsg);
1204 expandMsg);
1202 }
1205 }
1203 updateSticky();
1206 updateSticky();
1204 };
1207 };
1205
1208
1206 // get stored diff mode and pre-enable it
1209 // get stored diff mode and pre-enable it
1207 if (templateContext.session_attrs.wide_diff_mode === "true") {
1210 if (templateContext.session_attrs.wide_diff_mode === "true") {
1208 Rhodecode.comments.toggleWideMode(null);
1211 Rhodecode.comments.toggleWideMode(null);
1209 $('.toggle-wide-diff').addClass('btn-active');
1212 $('.toggle-wide-diff').addClass('btn-active');
1210 updateSticky();
1213 updateSticky();
1211 }
1214 }
1212 });
1215 });
1213 </script>
1216 </script>
1214
1217
1215 </%def>
1218 </%def>
General Comments 0
You need to be logged in to leave comments. Login now