Show More
@@ -1,1152 +1,1167 b'' | |||
|
1 | 1 | // Default styles |
|
2 | 2 | |
|
3 | 3 | .diff-collapse { |
|
4 | 4 | margin: @padding 0; |
|
5 | 5 | text-align: right; |
|
6 | 6 | } |
|
7 | 7 | |
|
8 | 8 | .diff-container { |
|
9 | 9 | margin-bottom: @space; |
|
10 | 10 | |
|
11 | 11 | .diffblock { |
|
12 | 12 | margin-bottom: @space; |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | &.hidden { |
|
16 | 16 | display: none; |
|
17 | 17 | overflow: hidden; |
|
18 | 18 | } |
|
19 | 19 | } |
|
20 | 20 | |
|
21 | 21 | |
|
22 | 22 | div.diffblock .sidebyside { |
|
23 | 23 | background: #ffffff; |
|
24 | 24 | } |
|
25 | 25 | |
|
26 | 26 | div.diffblock { |
|
27 | 27 | overflow-x: auto; |
|
28 | 28 | overflow-y: hidden; |
|
29 | 29 | clear: both; |
|
30 | 30 | padding: 0px; |
|
31 | 31 | background: @grey6; |
|
32 | 32 | border: @border-thickness solid @grey5; |
|
33 | 33 | -webkit-border-radius: @border-radius @border-radius 0px 0px; |
|
34 | 34 | border-radius: @border-radius @border-radius 0px 0px; |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | .comments-number { |
|
38 | 38 | float: right; |
|
39 | 39 | } |
|
40 | 40 | |
|
41 | 41 | // BEGIN CODE-HEADER STYLES |
|
42 | 42 | |
|
43 | 43 | .code-header { |
|
44 | 44 | background: @grey6; |
|
45 | 45 | padding: 10px 0 10px 0; |
|
46 | 46 | height: auto; |
|
47 | 47 | width: 100%; |
|
48 | 48 | |
|
49 | 49 | .hash { |
|
50 | 50 | float: left; |
|
51 | 51 | padding: 2px 0 0 2px; |
|
52 | 52 | } |
|
53 | 53 | |
|
54 | 54 | .date { |
|
55 | 55 | float: left; |
|
56 | 56 | text-transform: uppercase; |
|
57 | 57 | padding: 4px 0px 0px 2px; |
|
58 | 58 | } |
|
59 | 59 | |
|
60 | 60 | div { |
|
61 | 61 | margin-left: 4px; |
|
62 | 62 | } |
|
63 | 63 | |
|
64 | 64 | div.compare_header { |
|
65 | 65 | min-height: 40px; |
|
66 | 66 | margin: 0; |
|
67 | 67 | padding: 0 @padding; |
|
68 | 68 | |
|
69 | 69 | .drop-menu { |
|
70 | 70 | float:left; |
|
71 | 71 | display: block; |
|
72 | 72 | margin:0 0 @padding 0; |
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | .compare-label { |
|
76 | 76 | float: left; |
|
77 | 77 | clear: both; |
|
78 | 78 | display: inline-block; |
|
79 | 79 | min-width: 5em; |
|
80 | 80 | margin: 0; |
|
81 | 81 | padding: @button-padding @button-padding @button-padding 0; |
|
82 | 82 | font-family: @text-semibold; |
|
83 | 83 | } |
|
84 | 84 | |
|
85 | 85 | .compare-buttons { |
|
86 | 86 | float: left; |
|
87 | 87 | margin: 0; |
|
88 | 88 | padding: 0 0 @padding; |
|
89 | 89 | |
|
90 | 90 | .btn { |
|
91 | 91 | margin: 0 @padding 0 0; |
|
92 | 92 | } |
|
93 | 93 | } |
|
94 | 94 | } |
|
95 | 95 | |
|
96 | 96 | } |
|
97 | 97 | |
|
98 | 98 | .parents { |
|
99 | 99 | float: left; |
|
100 | 100 | width: 100px; |
|
101 | 101 | font-weight: 400; |
|
102 | 102 | vertical-align: middle; |
|
103 | 103 | padding: 0px 2px 0px 2px; |
|
104 | 104 | background-color: @grey6; |
|
105 | 105 | |
|
106 | 106 | #parent_link { |
|
107 | 107 | margin: 00px 2px; |
|
108 | 108 | |
|
109 | 109 | &.double { |
|
110 | 110 | margin: 0px 2px; |
|
111 | 111 | } |
|
112 | 112 | |
|
113 | 113 | &.disabled{ |
|
114 | 114 | margin-right: @padding; |
|
115 | 115 | } |
|
116 | 116 | } |
|
117 | 117 | } |
|
118 | 118 | |
|
119 | 119 | .children { |
|
120 | 120 | float: right; |
|
121 | 121 | width: 100px; |
|
122 | 122 | font-weight: 400; |
|
123 | 123 | vertical-align: middle; |
|
124 | 124 | text-align: right; |
|
125 | 125 | padding: 0px 2px 0px 2px; |
|
126 | 126 | background-color: @grey6; |
|
127 | 127 | |
|
128 | 128 | #child_link { |
|
129 | 129 | margin: 0px 2px; |
|
130 | 130 | |
|
131 | 131 | &.double { |
|
132 | 132 | margin: 0px 2px; |
|
133 | 133 | } |
|
134 | 134 | |
|
135 | 135 | &.disabled{ |
|
136 | 136 | margin-right: @padding; |
|
137 | 137 | } |
|
138 | 138 | } |
|
139 | 139 | } |
|
140 | 140 | |
|
141 | 141 | .changeset_header { |
|
142 | 142 | height: 16px; |
|
143 | 143 | |
|
144 | 144 | & > div{ |
|
145 | 145 | margin-right: @padding; |
|
146 | 146 | } |
|
147 | 147 | } |
|
148 | 148 | |
|
149 | 149 | .changeset_file { |
|
150 | 150 | text-align: left; |
|
151 | 151 | float: left; |
|
152 | 152 | padding: 0; |
|
153 | 153 | |
|
154 | 154 | a{ |
|
155 | 155 | display: inline-block; |
|
156 | 156 | margin-right: 0.5em; |
|
157 | 157 | } |
|
158 | 158 | |
|
159 | 159 | #selected_mode{ |
|
160 | 160 | margin-left: 0; |
|
161 | 161 | } |
|
162 | 162 | } |
|
163 | 163 | |
|
164 | 164 | .diff-menu-wrapper { |
|
165 | 165 | float: left; |
|
166 | 166 | } |
|
167 | 167 | |
|
168 | 168 | .diff-menu { |
|
169 | 169 | position: absolute; |
|
170 | 170 | background: none repeat scroll 0 0 #FFFFFF; |
|
171 | 171 | border-color: #003367 @grey3 @grey3; |
|
172 | 172 | border-right: 1px solid @grey3; |
|
173 | 173 | border-style: solid solid solid; |
|
174 | 174 | border-width: @border-thickness; |
|
175 | 175 | box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2); |
|
176 | 176 | margin-top: 5px; |
|
177 | 177 | margin-left: 1px; |
|
178 | 178 | } |
|
179 | 179 | |
|
180 | 180 | .diff-actions, .editor-actions { |
|
181 | 181 | float: left; |
|
182 | 182 | |
|
183 | 183 | input{ |
|
184 | 184 | margin: 0 0.5em 0 0; |
|
185 | 185 | } |
|
186 | 186 | } |
|
187 | 187 | |
|
188 | 188 | // END CODE-HEADER STYLES |
|
189 | 189 | |
|
190 | 190 | // BEGIN CODE-BODY STYLES |
|
191 | 191 | |
|
192 | 192 | .code-body { |
|
193 | 193 | padding: 0; |
|
194 | 194 | background-color: #ffffff; |
|
195 | 195 | position: relative; |
|
196 | 196 | max-width: none; |
|
197 | 197 | box-sizing: border-box; |
|
198 | 198 | // TODO: johbo: Parent has overflow: auto, this forces the child here |
|
199 | 199 | // to have the intended size and to scroll. Should be simplified. |
|
200 | 200 | width: 100%; |
|
201 | 201 | overflow-x: auto; |
|
202 | 202 | } |
|
203 | 203 | |
|
204 | 204 | pre.raw { |
|
205 | 205 | background: white; |
|
206 | 206 | color: @grey1; |
|
207 | 207 | } |
|
208 | 208 | // END CODE-BODY STYLES |
|
209 | 209 | |
|
210 | 210 | } |
|
211 | 211 | |
|
212 | 212 | |
|
213 | 213 | table.code-difftable { |
|
214 | 214 | border-collapse: collapse; |
|
215 | 215 | width: 99%; |
|
216 | 216 | border-radius: 0px !important; |
|
217 | 217 | |
|
218 | 218 | td { |
|
219 | 219 | padding: 0 !important; |
|
220 | 220 | background: none !important; |
|
221 | 221 | border: 0 !important; |
|
222 | 222 | } |
|
223 | 223 | |
|
224 | 224 | .context { |
|
225 | 225 | background: none repeat scroll 0 0 #DDE7EF; |
|
226 | 226 | } |
|
227 | 227 | |
|
228 | 228 | .add { |
|
229 | 229 | background: none repeat scroll 0 0 #DDFFDD; |
|
230 | 230 | |
|
231 | 231 | ins { |
|
232 | 232 | background: none repeat scroll 0 0 #AAFFAA; |
|
233 | 233 | text-decoration: none; |
|
234 | 234 | } |
|
235 | 235 | } |
|
236 | 236 | |
|
237 | 237 | .del { |
|
238 | 238 | background: none repeat scroll 0 0 #FFDDDD; |
|
239 | 239 | |
|
240 | 240 | del { |
|
241 | 241 | background: none repeat scroll 0 0 #FFAAAA; |
|
242 | 242 | text-decoration: none; |
|
243 | 243 | } |
|
244 | 244 | } |
|
245 | 245 | |
|
246 | 246 | /** LINE NUMBERS **/ |
|
247 | 247 | .lineno { |
|
248 | 248 | padding-left: 2px !important; |
|
249 | 249 | padding-right: 2px; |
|
250 | 250 | text-align: right; |
|
251 | 251 | width: 32px; |
|
252 | 252 | -moz-user-select: none; |
|
253 | 253 | -webkit-user-select: none; |
|
254 | 254 | border-right: @border-thickness solid @grey5 !important; |
|
255 | 255 | border-left: 0px solid #CCC !important; |
|
256 | 256 | border-top: 0px solid #CCC !important; |
|
257 | 257 | border-bottom: none !important; |
|
258 | 258 | |
|
259 | 259 | a { |
|
260 | 260 | &:extend(pre); |
|
261 | 261 | text-align: right; |
|
262 | 262 | padding-right: 2px; |
|
263 | 263 | cursor: pointer; |
|
264 | 264 | display: block; |
|
265 | 265 | width: 32px; |
|
266 | 266 | } |
|
267 | 267 | } |
|
268 | 268 | |
|
269 | 269 | .context { |
|
270 | 270 | cursor: auto; |
|
271 | 271 | &:extend(pre); |
|
272 | 272 | } |
|
273 | 273 | |
|
274 | 274 | .lineno-inline { |
|
275 | 275 | background: none repeat scroll 0 0 #FFF !important; |
|
276 | 276 | padding-left: 2px; |
|
277 | 277 | padding-right: 2px; |
|
278 | 278 | text-align: right; |
|
279 | 279 | width: 30px; |
|
280 | 280 | -moz-user-select: none; |
|
281 | 281 | -webkit-user-select: none; |
|
282 | 282 | } |
|
283 | 283 | |
|
284 | 284 | /** CODE **/ |
|
285 | 285 | .code { |
|
286 | 286 | display: block; |
|
287 | 287 | width: 100%; |
|
288 | 288 | |
|
289 | 289 | td { |
|
290 | 290 | margin: 0; |
|
291 | 291 | padding: 0; |
|
292 | 292 | } |
|
293 | 293 | |
|
294 | 294 | pre { |
|
295 | 295 | margin: 0; |
|
296 | 296 | padding: 0; |
|
297 | 297 | margin-left: .5em; |
|
298 | 298 | } |
|
299 | 299 | } |
|
300 | 300 | } |
|
301 | 301 | |
|
302 | 302 | |
|
303 | 303 | // Comments |
|
304 | 304 | |
|
305 | 305 | div.comment:target { |
|
306 | 306 | border-left: 6px solid @comment-highlight-color !important; |
|
307 | 307 | padding-left: 3px; |
|
308 | 308 | margin-left: -9px; |
|
309 | 309 | } |
|
310 | 310 | |
|
311 | 311 | //TODO: anderson: can't get an absolute number out of anything, so had to put the |
|
312 | 312 | //current values that might change. But to make it clear I put as a calculation |
|
313 | 313 | @comment-max-width: 1065px; |
|
314 | 314 | @pr-extra-margin: 34px; |
|
315 | 315 | @pr-border-spacing: 4px; |
|
316 | 316 | @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing; |
|
317 | 317 | |
|
318 | 318 | // Pull Request |
|
319 | 319 | .cs_files .code-difftable { |
|
320 | 320 | border: @border-thickness solid @grey5; //borders only on PRs |
|
321 | 321 | |
|
322 | 322 | .comment-inline-form, |
|
323 | 323 | div.comment { |
|
324 | 324 | width: @pr-comment-width; |
|
325 | 325 | } |
|
326 | 326 | } |
|
327 | 327 | |
|
328 | 328 | // Changeset |
|
329 | 329 | .code-difftable { |
|
330 | 330 | .comment-inline-form, |
|
331 | 331 | div.comment { |
|
332 | 332 | width: @comment-max-width; |
|
333 | 333 | } |
|
334 | 334 | } |
|
335 | 335 | |
|
336 | 336 | //Style page |
|
337 | 337 | @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding; |
|
338 | 338 | #style-page .code-difftable{ |
|
339 | 339 | .comment-inline-form, |
|
340 | 340 | div.comment { |
|
341 | 341 | width: @comment-max-width - @style-extra-margin; |
|
342 | 342 | } |
|
343 | 343 | } |
|
344 | 344 | |
|
345 | 345 | #context-bar > h2 { |
|
346 | 346 | font-size: 20px; |
|
347 | 347 | } |
|
348 | 348 | |
|
349 | 349 | #context-bar > h2> a { |
|
350 | 350 | font-size: 20px; |
|
351 | 351 | } |
|
352 | 352 | // end of defaults |
|
353 | 353 | |
|
354 | 354 | .file_diff_buttons { |
|
355 | 355 | padding: 0 0 @padding; |
|
356 | 356 | |
|
357 | 357 | .drop-menu { |
|
358 | 358 | float: left; |
|
359 | 359 | margin: 0 @padding 0 0; |
|
360 | 360 | } |
|
361 | 361 | .btn { |
|
362 | 362 | margin: 0 @padding 0 0; |
|
363 | 363 | } |
|
364 | 364 | } |
|
365 | 365 | |
|
366 | 366 | .code-body.textarea.editor { |
|
367 | 367 | max-width: none; |
|
368 | 368 | padding: 15px; |
|
369 | 369 | } |
|
370 | 370 | |
|
371 | 371 | td.injected_diff{ |
|
372 | 372 | max-width: 1178px; |
|
373 | 373 | overflow-x: auto; |
|
374 | 374 | overflow-y: hidden; |
|
375 | 375 | |
|
376 | 376 | div.diff-container, |
|
377 | 377 | div.diffblock{ |
|
378 | 378 | max-width: 100%; |
|
379 | 379 | } |
|
380 | 380 | |
|
381 | 381 | div.code-body { |
|
382 | 382 | max-width: 1124px; |
|
383 | 383 | overflow-x: auto; |
|
384 | 384 | overflow-y: hidden; |
|
385 | 385 | padding: 0; |
|
386 | 386 | } |
|
387 | 387 | div.diffblock { |
|
388 | 388 | border: none; |
|
389 | 389 | } |
|
390 | 390 | |
|
391 | 391 | &.inline-form { |
|
392 | 392 | width: 99% |
|
393 | 393 | } |
|
394 | 394 | } |
|
395 | 395 | |
|
396 | 396 | |
|
397 | 397 | table.code-difftable { |
|
398 | 398 | width: 100%; |
|
399 | 399 | } |
|
400 | 400 | |
|
401 | 401 | /** PYGMENTS COLORING **/ |
|
402 | 402 | div.codeblock { |
|
403 | 403 | |
|
404 | 404 | // TODO: johbo: Added interim to get rid of the margin around |
|
405 | 405 | // Select2 widgets. This needs further cleanup. |
|
406 | 406 | margin-top: @padding; |
|
407 | 407 | |
|
408 | 408 | overflow: auto; |
|
409 | 409 | padding: 0px; |
|
410 | 410 | border: @border-thickness solid @grey5; |
|
411 | 411 | background: @grey6; |
|
412 | 412 | .border-radius(@border-radius); |
|
413 | 413 | |
|
414 | 414 | #remove_gist { |
|
415 | 415 | float: right; |
|
416 | 416 | } |
|
417 | 417 | |
|
418 | 418 | .gist_url { |
|
419 | 419 | padding: 0px 0px 10px 0px; |
|
420 | 420 | } |
|
421 | 421 | |
|
422 | 422 | .author { |
|
423 | 423 | clear: both; |
|
424 | 424 | vertical-align: middle; |
|
425 | 425 | font-family: @text-bold; |
|
426 | 426 | } |
|
427 | 427 | |
|
428 | 428 | .btn-mini { |
|
429 | 429 | float: left; |
|
430 | 430 | margin: 0 5px 0 0; |
|
431 | 431 | } |
|
432 | 432 | |
|
433 | 433 | .code-header { |
|
434 | 434 | padding: @padding; |
|
435 | 435 | border-bottom: @border-thickness solid @grey5; |
|
436 | 436 | |
|
437 | 437 | .rc-user { |
|
438 | 438 | min-width: 0; |
|
439 | 439 | margin-right: .5em; |
|
440 | 440 | } |
|
441 | 441 | |
|
442 | 442 | .stats { |
|
443 | 443 | clear: both; |
|
444 | 444 | margin: 0 0 @padding 0; |
|
445 | 445 | padding: 0; |
|
446 | 446 | .left { |
|
447 | 447 | float: left; |
|
448 | 448 | clear: left; |
|
449 | 449 | max-width: 75%; |
|
450 | 450 | margin: 0 0 @padding 0; |
|
451 | 451 | |
|
452 | 452 | &.item { |
|
453 | 453 | margin-right: @padding; |
|
454 | 454 | &.last { border-right: none; } |
|
455 | 455 | } |
|
456 | 456 | } |
|
457 | 457 | .buttons { float: right; } |
|
458 | 458 | .author { |
|
459 | 459 | height: 25px; margin-left: 15px; font-weight: bold; |
|
460 | 460 | } |
|
461 | 461 | } |
|
462 | 462 | |
|
463 | 463 | .commit { |
|
464 | 464 | margin: 5px 0 0 26px; |
|
465 | 465 | font-weight: normal; |
|
466 | 466 | white-space: pre-wrap; |
|
467 | 467 | } |
|
468 | 468 | } |
|
469 | 469 | |
|
470 | 470 | .message { |
|
471 | 471 | position: relative; |
|
472 | 472 | margin: @padding; |
|
473 | 473 | |
|
474 | 474 | .codeblock-label { |
|
475 | 475 | margin: 0 0 1em 0; |
|
476 | 476 | } |
|
477 | 477 | } |
|
478 | 478 | |
|
479 | 479 | .code-body { |
|
480 | 480 | padding: @padding; |
|
481 | 481 | background-color: #ffffff; |
|
482 | 482 | min-width: 100%; |
|
483 | 483 | box-sizing: border-box; |
|
484 | 484 | // TODO: johbo: Parent has overflow: auto, this forces the child here |
|
485 | 485 | // to have the intended size and to scroll. Should be simplified. |
|
486 | 486 | width: 100%; |
|
487 | 487 | overflow-x: auto; |
|
488 | 488 | |
|
489 | 489 | img.rendered-binary { |
|
490 | 490 | height: auto; |
|
491 | 491 | width: 100%; |
|
492 | 492 | } |
|
493 | 493 | } |
|
494 | 494 | } |
|
495 | 495 | |
|
496 | 496 | .code-highlighttable, |
|
497 | 497 | div.codeblock { |
|
498 | 498 | |
|
499 | 499 | &.readme { |
|
500 | 500 | background-color: white; |
|
501 | 501 | } |
|
502 | 502 | |
|
503 | 503 | .markdown-block table { |
|
504 | 504 | border-collapse: collapse; |
|
505 | 505 | |
|
506 | 506 | th, |
|
507 | 507 | td { |
|
508 | 508 | padding: .5em; |
|
509 | 509 | border: @border-thickness solid @border-default-color; |
|
510 | 510 | } |
|
511 | 511 | } |
|
512 | 512 | |
|
513 | 513 | table { |
|
514 | 514 | border: 0px; |
|
515 | 515 | margin: 0; |
|
516 | 516 | letter-spacing: normal; |
|
517 | 517 | |
|
518 | 518 | |
|
519 | 519 | td { |
|
520 | 520 | border: 0px; |
|
521 | 521 | vertical-align: top; |
|
522 | 522 | } |
|
523 | 523 | } |
|
524 | 524 | } |
|
525 | 525 | |
|
526 | 526 | div.codeblock .code-header .search-path { padding: 0 0 0 10px; } |
|
527 | 527 | div.search-code-body { |
|
528 | 528 | background-color: #ffffff; padding: 5px 0 5px 10px; |
|
529 | 529 | pre { |
|
530 | 530 | .match { background-color: #faffa6;} |
|
531 | 531 | .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; } |
|
532 | 532 | } |
|
533 | 533 | .code-highlighttable { |
|
534 | 534 | border-collapse: collapse; |
|
535 | 535 | |
|
536 | 536 | tr:hover { |
|
537 | 537 | background: #fafafa; |
|
538 | 538 | } |
|
539 | 539 | td.code { |
|
540 | 540 | padding-left: 10px; |
|
541 | 541 | } |
|
542 | 542 | td.line { |
|
543 | 543 | border-right: 1px solid #ccc !important; |
|
544 | 544 | padding-right: 10px; |
|
545 | 545 | text-align: right; |
|
546 | 546 | font-family: "Lucida Console",Monaco,monospace; |
|
547 | 547 | span { |
|
548 | 548 | white-space: pre-wrap; |
|
549 | 549 | color: #666666; |
|
550 | 550 | } |
|
551 | 551 | } |
|
552 | 552 | } |
|
553 | 553 | } |
|
554 | 554 | |
|
555 | 555 | div.annotatediv { margin-left: 2px; margin-right: 4px; } |
|
556 | 556 | .code-highlight { |
|
557 | 557 | margin: 0; padding: 0; border-left: @border-thickness solid @grey5; |
|
558 | 558 | pre, .linenodiv pre { padding: 0 5px; margin: 0; } |
|
559 | 559 | pre div:target {background-color: @comment-highlight-color !important;} |
|
560 | 560 | } |
|
561 | 561 | |
|
562 | 562 | .linenos a { text-decoration: none; } |
|
563 | 563 | |
|
564 | 564 | .CodeMirror-selected { background: @rchighlightblue; } |
|
565 | 565 | .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; } |
|
566 | 566 | .CodeMirror ::selection { background: @rchighlightblue; } |
|
567 | 567 | .CodeMirror ::-moz-selection { background: @rchighlightblue; } |
|
568 | 568 | |
|
569 | 569 | .code { display: block; border:0px !important; } |
|
570 | 570 | .code-highlight, /* TODO: dan: merge codehilite into code-highlight */ |
|
571 | 571 | .codehilite { |
|
572 | 572 | .hll { background-color: #ffffcc } |
|
573 | 573 | .c { color: #408080; font-style: italic } /* Comment */ |
|
574 | 574 | .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */ |
|
575 | 575 | .k { color: #008000; font-weight: bold } /* Keyword */ |
|
576 | 576 | .o { color: #666666 } /* Operator */ |
|
577 | 577 | .cm { color: #408080; font-style: italic } /* Comment.Multiline */ |
|
578 | 578 | .cp { color: #BC7A00 } /* Comment.Preproc */ |
|
579 | 579 | .c1 { color: #408080; font-style: italic } /* Comment.Single */ |
|
580 | 580 | .cs { color: #408080; font-style: italic } /* Comment.Special */ |
|
581 | 581 | .gd { color: #A00000 } /* Generic.Deleted */ |
|
582 | 582 | .ge { font-style: italic } /* Generic.Emph */ |
|
583 | 583 | .gr { color: #FF0000 } /* Generic.Error */ |
|
584 | 584 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */ |
|
585 | 585 | .gi { color: #00A000 } /* Generic.Inserted */ |
|
586 | 586 | .go { color: #808080 } /* Generic.Output */ |
|
587 | 587 | .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ |
|
588 | 588 | .gs { font-weight: bold } /* Generic.Strong */ |
|
589 | 589 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ |
|
590 | 590 | .gt { color: #0040D0 } /* Generic.Traceback */ |
|
591 | 591 | .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ |
|
592 | 592 | .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ |
|
593 | 593 | .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ |
|
594 | 594 | .kp { color: #008000 } /* Keyword.Pseudo */ |
|
595 | 595 | .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ |
|
596 | 596 | .kt { color: #B00040 } /* Keyword.Type */ |
|
597 | 597 | .m { color: #666666 } /* Literal.Number */ |
|
598 | 598 | .s { color: #BA2121 } /* Literal.String */ |
|
599 | 599 | .na { color: #7D9029 } /* Name.Attribute */ |
|
600 | 600 | .nb { color: #008000 } /* Name.Builtin */ |
|
601 | 601 | .nc { color: #0000FF; font-weight: bold } /* Name.Class */ |
|
602 | 602 | .no { color: #880000 } /* Name.Constant */ |
|
603 | 603 | .nd { color: #AA22FF } /* Name.Decorator */ |
|
604 | 604 | .ni { color: #999999; font-weight: bold } /* Name.Entity */ |
|
605 | 605 | .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ |
|
606 | 606 | .nf { color: #0000FF } /* Name.Function */ |
|
607 | 607 | .nl { color: #A0A000 } /* Name.Label */ |
|
608 | 608 | .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ |
|
609 | 609 | .nt { color: #008000; font-weight: bold } /* Name.Tag */ |
|
610 | 610 | .nv { color: #19177C } /* Name.Variable */ |
|
611 | 611 | .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ |
|
612 | 612 | .w { color: #bbbbbb } /* Text.Whitespace */ |
|
613 | 613 | .mf { color: #666666 } /* Literal.Number.Float */ |
|
614 | 614 | .mh { color: #666666 } /* Literal.Number.Hex */ |
|
615 | 615 | .mi { color: #666666 } /* Literal.Number.Integer */ |
|
616 | 616 | .mo { color: #666666 } /* Literal.Number.Oct */ |
|
617 | 617 | .sb { color: #BA2121 } /* Literal.String.Backtick */ |
|
618 | 618 | .sc { color: #BA2121 } /* Literal.String.Char */ |
|
619 | 619 | .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ |
|
620 | 620 | .s2 { color: #BA2121 } /* Literal.String.Double */ |
|
621 | 621 | .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ |
|
622 | 622 | .sh { color: #BA2121 } /* Literal.String.Heredoc */ |
|
623 | 623 | .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ |
|
624 | 624 | .sx { color: #008000 } /* Literal.String.Other */ |
|
625 | 625 | .sr { color: #BB6688 } /* Literal.String.Regex */ |
|
626 | 626 | .s1 { color: #BA2121 } /* Literal.String.Single */ |
|
627 | 627 | .ss { color: #19177C } /* Literal.String.Symbol */ |
|
628 | 628 | .bp { color: #008000 } /* Name.Builtin.Pseudo */ |
|
629 | 629 | .vc { color: #19177C } /* Name.Variable.Class */ |
|
630 | 630 | .vg { color: #19177C } /* Name.Variable.Global */ |
|
631 | 631 | .vi { color: #19177C } /* Name.Variable.Instance */ |
|
632 | 632 | .il { color: #666666 } /* Literal.Number.Integer.Long */ |
|
633 | 633 | } |
|
634 | 634 | |
|
635 | 635 | /* customized pre blocks for markdown/rst */ |
|
636 | 636 | pre.literal-block, .codehilite pre{ |
|
637 | 637 | padding: @padding; |
|
638 | 638 | border: 1px solid @grey6; |
|
639 | 639 | .border-radius(@border-radius); |
|
640 | 640 | background-color: @grey7; |
|
641 | 641 | } |
|
642 | 642 | |
|
643 | 643 | |
|
644 | 644 | /* START NEW CODE BLOCK CSS */ |
|
645 | 645 | |
|
646 | 646 | @cb-line-height: 18px; |
|
647 | 647 | @cb-line-code-padding: 10px; |
|
648 | 648 | @cb-text-padding: 5px; |
|
649 | 649 | |
|
650 | 650 | @pill-padding: 2px 7px; |
|
651 | @pill-padding-small: 2px 2px 1px 2px; | |
|
651 | 652 | |
|
652 | 653 | input.filediff-collapse-state { |
|
653 | 654 | display: none; |
|
654 | 655 | |
|
655 | 656 | &:checked + .filediff { /* file diff is collapsed */ |
|
656 | 657 | .cb { |
|
657 | 658 | display: none |
|
658 | 659 | } |
|
659 | 660 | .filediff-collapse-indicator { |
|
660 | 661 | width: 0; |
|
661 | 662 | height: 0; |
|
662 | 663 | border-style: solid; |
|
663 | 664 | border-width: 4.5px 0 4.5px 9.3px; |
|
664 | 665 | border-color: transparent transparent transparent #aaa; |
|
665 | 666 | margin: 6px 0px; |
|
666 | 667 | } |
|
667 | 668 | .filediff-menu { |
|
668 | 669 | display: none; |
|
669 | 670 | } |
|
670 | 671 | margin: 10px 0 0 0; |
|
671 | 672 | } |
|
672 | 673 | |
|
673 | 674 | &+ .filediff { /* file diff is expanded */ |
|
674 | 675 | .filediff-collapse-indicator { |
|
675 | 676 | width: 0; |
|
676 | 677 | height: 0; |
|
677 | 678 | border-style: solid; |
|
678 | 679 | border-width: 9.3px 4.5px 0 4.5px; |
|
679 | 680 | border-color: #aaa transparent transparent transparent; |
|
680 | 681 | margin: 6px 0px; |
|
681 | 682 | |
|
682 | 683 | } |
|
683 | 684 | .filediff-menu { |
|
684 | 685 | display: block; |
|
685 | 686 | } |
|
686 | 687 | margin: 10px 0; |
|
687 | 688 | &:nth-child(2) { |
|
688 | 689 | margin: 0; |
|
689 | 690 | } |
|
690 | 691 | } |
|
691 | 692 | } |
|
692 | 693 | .cs_files { |
|
693 | 694 | clear: both; |
|
694 | 695 | } |
|
695 | 696 | |
|
696 | 697 | .diffset-menu { |
|
697 | 698 | margin-bottom: 20px; |
|
698 | 699 | } |
|
699 | 700 | .diffset { |
|
700 | 701 | margin: 20px auto; |
|
701 | 702 | .diffset-heading { |
|
702 | 703 | border: 1px solid @grey5; |
|
703 | 704 | margin-bottom: -1px; |
|
704 | 705 | // margin-top: 20px; |
|
705 | 706 | h2 { |
|
706 | 707 | margin: 0; |
|
707 | 708 | line-height: 38px; |
|
708 | 709 | padding-left: 10px; |
|
709 | 710 | } |
|
710 | 711 | .btn { |
|
711 | 712 | margin: 0; |
|
712 | 713 | } |
|
713 | 714 | background: @grey6; |
|
714 | 715 | display: block; |
|
715 | 716 | padding: 5px; |
|
716 | 717 | } |
|
717 | 718 | .diffset-heading-warning { |
|
718 | 719 | background: @alert3-inner; |
|
719 | 720 | border: 1px solid @alert3; |
|
720 | 721 | } |
|
721 | 722 | &.diffset-comments-disabled { |
|
722 | 723 | .cb-comment-box-opener, .comment-inline-form, .cb-comment-add-button { |
|
723 | 724 | display: none !important; |
|
724 | 725 | } |
|
725 | 726 | } |
|
726 | 727 | } |
|
727 | 728 | |
|
729 | .filelist { | |
|
730 | .pill { | |
|
731 | display: block; | |
|
732 | float: left; | |
|
733 | padding: @pill-padding-small; | |
|
734 | } | |
|
735 | } | |
|
736 | ||
|
728 | 737 | .pill { |
|
729 | 738 | display: block; |
|
730 | 739 | float: left; |
|
731 | 740 | padding: @pill-padding; |
|
732 | 741 | } |
|
742 | ||
|
733 | 743 | .pill-group { |
|
734 | 744 | .pill { |
|
735 | 745 | opacity: .8; |
|
736 | 746 | &:first-child { |
|
737 | 747 | border-radius: @border-radius 0 0 @border-radius; |
|
738 | 748 | } |
|
739 | 749 | &:last-child { |
|
740 | 750 | border-radius: 0 @border-radius @border-radius 0; |
|
741 | 751 | } |
|
742 | 752 | &:only-child { |
|
743 | 753 | border-radius: @border-radius; |
|
744 | 754 | } |
|
745 | 755 | } |
|
746 | 756 | } |
|
747 | 757 | |
|
748 | 758 | /* Main comments*/ |
|
749 | 759 | #comments { |
|
750 | 760 | .comment-selected { |
|
751 | 761 | border-left: 6px solid @comment-highlight-color; |
|
752 | 762 | padding-left: 3px; |
|
753 | 763 | margin-left: -9px; |
|
754 | 764 | } |
|
755 | 765 | } |
|
756 | 766 | |
|
757 | 767 | .filediff { |
|
758 | 768 | border: 1px solid @grey5; |
|
759 | 769 | |
|
760 | 770 | /* START OVERRIDES */ |
|
761 | 771 | .code-highlight { |
|
762 | 772 | border: none; // TODO: remove this border from the global |
|
763 | 773 | // .code-highlight, it doesn't belong there |
|
764 | 774 | } |
|
765 | 775 | label { |
|
766 | 776 | margin: 0; // TODO: remove this margin definition from global label |
|
767 | 777 | // it doesn't belong there - if margin on labels |
|
768 | 778 | // are needed for a form they should be defined |
|
769 | 779 | // in the form's class |
|
770 | 780 | } |
|
771 | 781 | /* END OVERRIDES */ |
|
772 | 782 | |
|
773 | 783 | * { |
|
774 | 784 | box-sizing: border-box; |
|
775 | 785 | } |
|
776 | 786 | .filediff-anchor { |
|
777 | 787 | visibility: hidden; |
|
778 | 788 | } |
|
779 | 789 | &:hover { |
|
780 | 790 | .filediff-anchor { |
|
781 | 791 | visibility: visible; |
|
782 | 792 | } |
|
783 | 793 | } |
|
784 | 794 | |
|
785 | 795 | .filediff-collapse-indicator { |
|
786 | 796 | border-style: solid; |
|
787 | 797 | float: left; |
|
788 | 798 | margin: 4px 0px 0 0; |
|
789 | 799 | cursor: pointer; |
|
790 | 800 | } |
|
791 | 801 | |
|
792 | 802 | .filediff-heading { |
|
793 | 803 | background: @grey7; |
|
794 | 804 | cursor: pointer; |
|
795 | 805 | display: block; |
|
796 | 806 | padding: 5px 10px; |
|
797 | 807 | } |
|
798 | 808 | .filediff-heading:after { |
|
799 | 809 | content: ""; |
|
800 | 810 | display: table; |
|
801 | 811 | clear: both; |
|
802 | 812 | } |
|
803 | 813 | .filediff-heading:hover { |
|
804 | 814 | background: #e1e9f4 !important; |
|
805 | 815 | } |
|
806 | 816 | |
|
807 | 817 | .filediff-menu { |
|
808 | 818 | float: right; |
|
809 | 819 | text-align: right; |
|
810 | 820 | padding: 5px 5px 5px 0px; |
|
811 | 821 | |
|
812 | 822 | &> a, |
|
813 | 823 | &> span { |
|
814 | 824 | padding: 1px; |
|
815 | 825 | } |
|
816 | 826 | } |
|
817 | 827 | |
|
828 | .filediff-collapse-button, .filediff-expand-button { | |
|
829 | cursor: pointer; | |
|
830 | } | |
|
831 | .filediff-collapse-button { | |
|
832 | display: inline; | |
|
833 | } | |
|
834 | .filediff-expand-button { | |
|
835 | display: none; | |
|
836 | } | |
|
837 | .filediff-collapsed .filediff-collapse-button { | |
|
838 | display: none; | |
|
839 | } | |
|
840 | .filediff-collapsed .filediff-expand-button { | |
|
841 | display: inline; | |
|
842 | } | |
|
843 | ||
|
844 | /**** COMMENTS ****/ | |
|
845 | ||
|
846 | .filediff-menu { | |
|
847 | .show-comment-button { | |
|
848 | display: none; | |
|
849 | } | |
|
850 | } | |
|
851 | &.hide-comments { | |
|
852 | .inline-comments { | |
|
853 | display: none; | |
|
854 | } | |
|
855 | .filediff-menu { | |
|
856 | .show-comment-button { | |
|
857 | display: inline; | |
|
858 | } | |
|
859 | .hide-comment-button { | |
|
860 | display: none; | |
|
861 | } | |
|
862 | } | |
|
863 | } | |
|
864 | ||
|
865 | .hide-line-comments { | |
|
866 | .inline-comments { | |
|
867 | display: none; | |
|
868 | } | |
|
869 | } | |
|
870 | ||
|
871 | /**** END COMMENTS ****/ | |
|
872 | ||
|
873 | } | |
|
874 | ||
|
875 | ||
|
876 | ||
|
877 | .filediff, .filelist { | |
|
818 | 878 | .pill { |
|
819 | 879 | &[op="name"] { |
|
820 | 880 | background: none; |
|
821 | 881 | opacity: 1; |
|
822 | 882 | color: white; |
|
823 | 883 | } |
|
824 | 884 | &[op="limited"] { |
|
825 | 885 | background: @grey2; |
|
826 | 886 | color: white; |
|
827 | 887 | } |
|
828 | 888 | &[op="binary"] { |
|
829 | 889 | background: @color7; |
|
830 | 890 | color: white; |
|
831 | 891 | } |
|
832 | 892 | &[op="modified"] { |
|
833 | 893 | background: @alert1; |
|
834 | 894 | color: white; |
|
835 | 895 | } |
|
836 | 896 | &[op="renamed"] { |
|
837 | 897 | background: @color4; |
|
838 | 898 | color: white; |
|
839 | 899 | } |
|
840 | 900 | &[op="copied"] { |
|
841 | 901 | background: @color4; |
|
842 | 902 | color: white; |
|
843 | 903 | } |
|
844 | 904 | &[op="mode"] { |
|
845 | 905 | background: @grey3; |
|
846 | 906 | color: white; |
|
847 | 907 | } |
|
848 | 908 | &[op="symlink"] { |
|
849 | 909 | background: @color8; |
|
850 | 910 | color: white; |
|
851 | 911 | } |
|
852 | 912 | |
|
853 | 913 | &[op="added"] { /* added lines */ |
|
854 | 914 | background: @alert1; |
|
855 | 915 | color: white; |
|
856 | 916 | } |
|
857 | 917 | &[op="deleted"] { /* deleted lines */ |
|
858 | 918 | background: @alert2; |
|
859 | 919 | color: white; |
|
860 | 920 | } |
|
861 | 921 | |
|
862 | 922 | &[op="created"] { /* created file */ |
|
863 | 923 | background: @alert1; |
|
864 | 924 | color: white; |
|
865 | 925 | } |
|
866 | 926 | &[op="removed"] { /* deleted file */ |
|
867 | 927 | background: @color5; |
|
868 | 928 | color: white; |
|
869 | 929 | } |
|
870 | 930 | } |
|
871 | ||
|
872 | .filediff-collapse-button, .filediff-expand-button { | |
|
873 | cursor: pointer; | |
|
874 | } | |
|
875 | .filediff-collapse-button { | |
|
876 | display: inline; | |
|
877 | } | |
|
878 | .filediff-expand-button { | |
|
879 | display: none; | |
|
880 | } | |
|
881 | .filediff-collapsed .filediff-collapse-button { | |
|
882 | display: none; | |
|
883 | } | |
|
884 | .filediff-collapsed .filediff-expand-button { | |
|
885 | display: inline; | |
|
886 | } | |
|
887 | ||
|
888 | /**** COMMENTS ****/ | |
|
931 | } | |
|
889 | 932 | |
|
890 | .filediff-menu { | |
|
891 | .show-comment-button { | |
|
892 | display: none; | |
|
893 | } | |
|
894 | } | |
|
895 | &.hide-comments { | |
|
896 | .inline-comments { | |
|
897 | display: none; | |
|
898 | } | |
|
899 | .filediff-menu { | |
|
900 | .show-comment-button { | |
|
901 | display: inline; | |
|
902 | } | |
|
903 | .hide-comment-button { | |
|
904 | display: none; | |
|
905 | } | |
|
906 | } | |
|
907 | } | |
|
908 | ||
|
909 | .hide-line-comments { | |
|
910 | .inline-comments { | |
|
911 | display: none; | |
|
912 | } | |
|
913 | } | |
|
914 | ||
|
915 | /**** END COMMENTS ****/ | |
|
916 | ||
|
917 | } | |
|
918 | 933 | |
|
919 | 934 | .filediff-outdated { |
|
920 | 935 | padding: 8px 0; |
|
921 | 936 | |
|
922 | 937 | .filediff-heading { |
|
923 | 938 | opacity: .5; |
|
924 | 939 | } |
|
925 | 940 | } |
|
926 | 941 | |
|
927 | 942 | table.cb { |
|
928 | 943 | width: 100%; |
|
929 | 944 | border-collapse: collapse; |
|
930 | 945 | |
|
931 | 946 | .cb-text { |
|
932 | 947 | padding: @cb-text-padding; |
|
933 | 948 | } |
|
934 | 949 | .cb-hunk { |
|
935 | 950 | padding: @cb-text-padding; |
|
936 | 951 | } |
|
937 | 952 | .cb-expand { |
|
938 | 953 | display: none; |
|
939 | 954 | } |
|
940 | 955 | .cb-collapse { |
|
941 | 956 | display: inline; |
|
942 | 957 | } |
|
943 | 958 | &.cb-collapsed { |
|
944 | 959 | .cb-line { |
|
945 | 960 | display: none; |
|
946 | 961 | } |
|
947 | 962 | .cb-expand { |
|
948 | 963 | display: inline; |
|
949 | 964 | } |
|
950 | 965 | .cb-collapse { |
|
951 | 966 | display: none; |
|
952 | 967 | } |
|
953 | 968 | } |
|
954 | 969 | |
|
955 | 970 | /* intentionally general selector since .cb-line-selected must override it |
|
956 | 971 | and they both use !important since the td itself may have a random color |
|
957 | 972 | generated by annotation blocks. TLDR: if you change it, make sure |
|
958 | 973 | annotated block selection and line selection in file view still work */ |
|
959 | 974 | .cb-line-fresh .cb-content { |
|
960 | 975 | background: white !important; |
|
961 | 976 | } |
|
962 | 977 | .cb-warning { |
|
963 | 978 | background: #fff4dd; |
|
964 | 979 | } |
|
965 | 980 | |
|
966 | 981 | &.cb-diff-sideside { |
|
967 | 982 | td { |
|
968 | 983 | &.cb-content { |
|
969 | 984 | width: 50%; |
|
970 | 985 | } |
|
971 | 986 | } |
|
972 | 987 | } |
|
973 | 988 | |
|
974 | 989 | tr { |
|
975 | 990 | &.cb-annotate { |
|
976 | 991 | border-top: 1px solid #eee; |
|
977 | 992 | } |
|
978 | 993 | |
|
979 | 994 | &.cb-comment-info { |
|
980 | 995 | border-top: 1px solid #eee; |
|
981 | 996 | color: rgba(0, 0, 0, 0.3); |
|
982 | 997 | background: #edf2f9; |
|
983 | 998 | |
|
984 | 999 | td { |
|
985 | 1000 | |
|
986 | 1001 | } |
|
987 | 1002 | } |
|
988 | 1003 | |
|
989 | 1004 | &.cb-hunk { |
|
990 | 1005 | font-family: @font-family-monospace; |
|
991 | 1006 | color: rgba(0, 0, 0, 0.3); |
|
992 | 1007 | |
|
993 | 1008 | td { |
|
994 | 1009 | &:first-child { |
|
995 | 1010 | background: #edf2f9; |
|
996 | 1011 | } |
|
997 | 1012 | &:last-child { |
|
998 | 1013 | background: #f4f7fb; |
|
999 | 1014 | } |
|
1000 | 1015 | } |
|
1001 | 1016 | } |
|
1002 | 1017 | } |
|
1003 | 1018 | |
|
1004 | 1019 | |
|
1005 | 1020 | td { |
|
1006 | 1021 | vertical-align: top; |
|
1007 | 1022 | padding: 0; |
|
1008 | 1023 | |
|
1009 | 1024 | &.cb-content { |
|
1010 | 1025 | font-size: 12.35px; |
|
1011 | 1026 | |
|
1012 | 1027 | &.cb-line-selected .cb-code { |
|
1013 | 1028 | background: @comment-highlight-color !important; |
|
1014 | 1029 | } |
|
1015 | 1030 | |
|
1016 | 1031 | span.cb-code { |
|
1017 | 1032 | line-height: @cb-line-height; |
|
1018 | 1033 | padding-left: @cb-line-code-padding; |
|
1019 | 1034 | padding-right: @cb-line-code-padding; |
|
1020 | 1035 | display: block; |
|
1021 | 1036 | white-space: pre-wrap; |
|
1022 | 1037 | font-family: @font-family-monospace; |
|
1023 | 1038 | word-break: break-all; |
|
1024 | 1039 | .nonl { |
|
1025 | 1040 | color: @color5; |
|
1026 | 1041 | } |
|
1027 | 1042 | } |
|
1028 | 1043 | |
|
1029 | 1044 | &> button.cb-comment-box-opener { |
|
1030 | 1045 | |
|
1031 | 1046 | padding: 2px 2px 1px 3px; |
|
1032 | 1047 | margin-left: -6px; |
|
1033 | 1048 | margin-top: -1px; |
|
1034 | 1049 | |
|
1035 | 1050 | border-radius: @border-radius; |
|
1036 | 1051 | position: absolute; |
|
1037 | 1052 | display: none; |
|
1038 | 1053 | } |
|
1039 | 1054 | .cb-comment { |
|
1040 | 1055 | margin-top: 10px; |
|
1041 | 1056 | white-space: normal; |
|
1042 | 1057 | } |
|
1043 | 1058 | } |
|
1044 | 1059 | &:hover { |
|
1045 | 1060 | button.cb-comment-box-opener { |
|
1046 | 1061 | display: block; |
|
1047 | 1062 | } |
|
1048 | 1063 | &+ td button.cb-comment-box-opener { |
|
1049 | 1064 | display: block |
|
1050 | 1065 | } |
|
1051 | 1066 | } |
|
1052 | 1067 | |
|
1053 | 1068 | &.cb-data { |
|
1054 | 1069 | text-align: right; |
|
1055 | 1070 | width: 30px; |
|
1056 | 1071 | font-family: @font-family-monospace; |
|
1057 | 1072 | |
|
1058 | 1073 | .icon-comment { |
|
1059 | 1074 | cursor: pointer; |
|
1060 | 1075 | } |
|
1061 | 1076 | &.cb-line-selected > div { |
|
1062 | 1077 | display: block; |
|
1063 | 1078 | background: @comment-highlight-color !important; |
|
1064 | 1079 | line-height: @cb-line-height; |
|
1065 | 1080 | color: rgba(0, 0, 0, 0.3); |
|
1066 | 1081 | } |
|
1067 | 1082 | } |
|
1068 | 1083 | |
|
1069 | 1084 | &.cb-lineno { |
|
1070 | 1085 | padding: 0; |
|
1071 | 1086 | width: 50px; |
|
1072 | 1087 | color: rgba(0, 0, 0, 0.3); |
|
1073 | 1088 | text-align: right; |
|
1074 | 1089 | border-right: 1px solid #eee; |
|
1075 | 1090 | font-family: @font-family-monospace; |
|
1076 | 1091 | user-select: none; |
|
1077 | 1092 | |
|
1078 | 1093 | a::before { |
|
1079 | 1094 | content: attr(data-line-no); |
|
1080 | 1095 | } |
|
1081 | 1096 | &.cb-line-selected a { |
|
1082 | 1097 | background: @comment-highlight-color !important; |
|
1083 | 1098 | } |
|
1084 | 1099 | |
|
1085 | 1100 | a { |
|
1086 | 1101 | display: block; |
|
1087 | 1102 | padding-right: @cb-line-code-padding; |
|
1088 | 1103 | padding-left: @cb-line-code-padding; |
|
1089 | 1104 | line-height: @cb-line-height; |
|
1090 | 1105 | color: rgba(0, 0, 0, 0.3); |
|
1091 | 1106 | } |
|
1092 | 1107 | } |
|
1093 | 1108 | |
|
1094 | 1109 | &.cb-empty { |
|
1095 | 1110 | background: @grey7; |
|
1096 | 1111 | } |
|
1097 | 1112 | |
|
1098 | 1113 | ins { |
|
1099 | 1114 | color: black; |
|
1100 | 1115 | background: #a6f3a6; |
|
1101 | 1116 | text-decoration: none; |
|
1102 | 1117 | } |
|
1103 | 1118 | del { |
|
1104 | 1119 | color: black; |
|
1105 | 1120 | background: #f8cbcb; |
|
1106 | 1121 | text-decoration: none; |
|
1107 | 1122 | } |
|
1108 | 1123 | &.cb-addition { |
|
1109 | 1124 | background: #ecffec; |
|
1110 | 1125 | |
|
1111 | 1126 | &.blob-lineno { |
|
1112 | 1127 | background: #ddffdd; |
|
1113 | 1128 | } |
|
1114 | 1129 | } |
|
1115 | 1130 | &.cb-deletion { |
|
1116 | 1131 | background: #ffecec; |
|
1117 | 1132 | |
|
1118 | 1133 | &.blob-lineno { |
|
1119 | 1134 | background: #ffdddd; |
|
1120 | 1135 | } |
|
1121 | 1136 | } |
|
1122 | 1137 | &.cb-annotate-message-spacer { |
|
1123 | 1138 | width:8px; |
|
1124 | 1139 | padding: 1px 0px 0px 3px; |
|
1125 | 1140 | } |
|
1126 | 1141 | &.cb-annotate-info { |
|
1127 | 1142 | width: 320px; |
|
1128 | 1143 | min-width: 320px; |
|
1129 | 1144 | max-width: 320px; |
|
1130 | 1145 | padding: 5px 2px; |
|
1131 | 1146 | font-size: 13px; |
|
1132 | 1147 | |
|
1133 | 1148 | .cb-annotate-message { |
|
1134 | 1149 | padding: 2px 0px 0px 0px; |
|
1135 | 1150 | white-space: pre-line; |
|
1136 | 1151 | overflow: hidden; |
|
1137 | 1152 | } |
|
1138 | 1153 | .rc-user { |
|
1139 | 1154 | float: none; |
|
1140 | 1155 | padding: 0 6px 0 17px; |
|
1141 | 1156 | min-width: unset; |
|
1142 | 1157 | min-height: unset; |
|
1143 | 1158 | } |
|
1144 | 1159 | } |
|
1145 | 1160 | |
|
1146 | 1161 | &.cb-annotate-revision { |
|
1147 | 1162 | cursor: pointer; |
|
1148 | 1163 | text-align: right; |
|
1149 | 1164 | padding: 1px 3px 0px 3px; |
|
1150 | 1165 | } |
|
1151 | 1166 | } |
|
1152 | 1167 | } |
@@ -1,354 +1,354 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | <%inherit file="/base/base.mako"/> |
|
4 | 4 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
5 | 5 | |
|
6 | 6 | <%def name="title()"> |
|
7 | 7 | ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)} |
|
8 | 8 | %if c.rhodecode_name: |
|
9 | 9 | · ${h.branding(c.rhodecode_name)} |
|
10 | 10 | %endif |
|
11 | 11 | </%def> |
|
12 | 12 | |
|
13 | 13 | <%def name="menu_bar_nav()"> |
|
14 | 14 | ${self.menu_items(active='repositories')} |
|
15 | 15 | </%def> |
|
16 | 16 | |
|
17 | 17 | <%def name="menu_bar_subnav()"> |
|
18 | 18 | ${self.repo_menu(active='changelog')} |
|
19 | 19 | </%def> |
|
20 | 20 | |
|
21 | 21 | <%def name="main()"> |
|
22 | 22 | <script> |
|
23 | 23 | // TODO: marcink switch this to pyroutes |
|
24 | 24 | AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}"; |
|
25 | 25 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; |
|
26 | 26 | </script> |
|
27 | 27 | <div class="box"> |
|
28 | 28 | <div class="title"> |
|
29 | 29 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
30 | 30 | </div> |
|
31 | 31 | |
|
32 | 32 | <div id="changeset_compare_view_content" class="summary changeset"> |
|
33 | 33 | <div class="summary-detail"> |
|
34 | 34 | <div class="summary-detail-header"> |
|
35 | 35 | <div class="breadcrumbs files_location"> |
|
36 | 36 | <h4> |
|
37 | 37 | ${_('Commit')} |
|
38 | 38 | |
|
39 | 39 | <code> |
|
40 | 40 | ${h.show_id(c.commit)} |
|
41 | 41 | </code> |
|
42 | 42 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
43 | 43 | % if hasattr(c.commit, 'phase'): |
|
44 | 44 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span> |
|
45 | 45 | % endif |
|
46 | 46 | |
|
47 | 47 | ## obsolete commits |
|
48 | 48 | % if hasattr(c.commit, 'obsolete'): |
|
49 | 49 | % if c.commit.obsolete: |
|
50 | 50 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
51 | 51 | % endif |
|
52 | 52 | % endif |
|
53 | 53 | |
|
54 | 54 | ## hidden commits |
|
55 | 55 | % if hasattr(c.commit, 'hidden'): |
|
56 | 56 | % if c.commit.hidden: |
|
57 | 57 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
58 | 58 | % endif |
|
59 | 59 | % endif |
|
60 | 60 | </h4> |
|
61 | 61 | |
|
62 | 62 | </div> |
|
63 | 63 | <div class="pull-right"> |
|
64 | 64 | <span id="parent_link"> |
|
65 | 65 | <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a> |
|
66 | 66 | </span> |
|
67 | 67 | | |
|
68 | 68 | <span id="child_link"> |
|
69 | 69 | <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a> |
|
70 | 70 | </span> |
|
71 | 71 | </div> |
|
72 | 72 | </div> |
|
73 | 73 | |
|
74 | 74 | <div class="fieldset"> |
|
75 | 75 | <div class="left-label"> |
|
76 | 76 | ${_('Description')}: |
|
77 | 77 | </div> |
|
78 | 78 | <div class="right-content"> |
|
79 | 79 | <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
80 | 80 | <div id="message_expand" style="display:none;"> |
|
81 | 81 | ${_('Expand')} |
|
82 | 82 | </div> |
|
83 | 83 | </div> |
|
84 | 84 | </div> |
|
85 | 85 | |
|
86 | 86 | %if c.statuses: |
|
87 | 87 | <div class="fieldset"> |
|
88 | 88 | <div class="left-label"> |
|
89 | 89 | ${_('Commit status')}: |
|
90 | 90 | </div> |
|
91 | 91 | <div class="right-content"> |
|
92 | 92 | <div class="changeset-status-ico"> |
|
93 | 93 | <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div> |
|
94 | 94 | </div> |
|
95 | 95 | <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div> |
|
96 | 96 | </div> |
|
97 | 97 | </div> |
|
98 | 98 | %endif |
|
99 | 99 | |
|
100 | 100 | <div class="fieldset"> |
|
101 | 101 | <div class="left-label"> |
|
102 | 102 | ${_('References')}: |
|
103 | 103 | </div> |
|
104 | 104 | <div class="right-content"> |
|
105 | 105 | <div class="tags"> |
|
106 | 106 | |
|
107 | 107 | %if c.commit.merge: |
|
108 | 108 | <span class="mergetag tag"> |
|
109 | 109 | <i class="icon-merge"></i>${_('merge')} |
|
110 | 110 | </span> |
|
111 | 111 | %endif |
|
112 | 112 | |
|
113 | 113 | %if h.is_hg(c.rhodecode_repo): |
|
114 | 114 | %for book in c.commit.bookmarks: |
|
115 | 115 | <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}"> |
|
116 | 116 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
117 | 117 | </span> |
|
118 | 118 | %endfor |
|
119 | 119 | %endif |
|
120 | 120 | |
|
121 | 121 | %for tag in c.commit.tags: |
|
122 | 122 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}"> |
|
123 | 123 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a> |
|
124 | 124 | </span> |
|
125 | 125 | %endfor |
|
126 | 126 | |
|
127 | 127 | %if c.commit.branch: |
|
128 | 128 | <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}"> |
|
129 | 129 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a> |
|
130 | 130 | </span> |
|
131 | 131 | %endif |
|
132 | 132 | </div> |
|
133 | 133 | </div> |
|
134 | 134 | </div> |
|
135 | 135 | |
|
136 | 136 | <div class="fieldset"> |
|
137 | 137 | <div class="left-label"> |
|
138 | 138 | ${_('Diff options')}: |
|
139 | 139 | </div> |
|
140 | 140 | <div class="right-content"> |
|
141 | 141 | <div class="diff-actions"> |
|
142 | 142 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
143 | 143 | ${_('Raw Diff')} |
|
144 | 144 | </a> |
|
145 | 145 | | |
|
146 | 146 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
147 | 147 | ${_('Patch Diff')} |
|
148 | 148 | </a> |
|
149 | 149 | | |
|
150 | 150 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
151 | 151 | ${_('Download Diff')} |
|
152 | 152 | </a> |
|
153 | 153 | | |
|
154 | 154 | ${c.ignorews_url(request)} |
|
155 | 155 | | |
|
156 | 156 | ${c.context_url(request)} |
|
157 | 157 | </div> |
|
158 | 158 | </div> |
|
159 | 159 | </div> |
|
160 | 160 | |
|
161 | 161 | <div class="fieldset"> |
|
162 | 162 | <div class="left-label"> |
|
163 | 163 | ${_('Comments')}: |
|
164 | 164 | </div> |
|
165 | 165 | <div class="right-content"> |
|
166 | 166 | <div class="comments-number"> |
|
167 | 167 | %if c.comments: |
|
168 | 168 | <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>, |
|
169 | 169 | %else: |
|
170 | 170 | ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)} |
|
171 | 171 | %endif |
|
172 | 172 | %if c.inline_cnt: |
|
173 | 173 | <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> |
|
174 | 174 | %else: |
|
175 | 175 | ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} |
|
176 | 176 | %endif |
|
177 | 177 | </div> |
|
178 | 178 | </div> |
|
179 | 179 | </div> |
|
180 | 180 | |
|
181 | 181 | <div class="fieldset"> |
|
182 | 182 | <div class="left-label"> |
|
183 | 183 | ${_('Unresolved TODOs')}: |
|
184 | 184 | </div> |
|
185 | 185 | <div class="right-content"> |
|
186 | 186 | <div class="comments-number"> |
|
187 | 187 | % if c.unresolved_comments: |
|
188 | 188 | % for co in c.unresolved_comments: |
|
189 | 189 | <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','} |
|
190 | 190 | % endfor |
|
191 | 191 | % else: |
|
192 | 192 | ${_('There are no unresolved TODOs')} |
|
193 | 193 | % endif |
|
194 | 194 | </div> |
|
195 | 195 | </div> |
|
196 | 196 | </div> |
|
197 | 197 | |
|
198 | 198 | </div> <!-- end summary-detail --> |
|
199 | 199 | |
|
200 | 200 | <div id="commit-stats" class="sidebar-right"> |
|
201 | 201 | <div class="summary-detail-header"> |
|
202 | 202 | <h4 class="item"> |
|
203 | 203 | ${_('Author')} |
|
204 | 204 | </h4> |
|
205 | 205 | </div> |
|
206 | 206 | <div class="sidebar-right-content"> |
|
207 | 207 | ${self.gravatar_with_user(c.commit.author)} |
|
208 | 208 | <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div> |
|
209 | 209 | </div> |
|
210 | 210 | </div><!-- end sidebar --> |
|
211 | 211 | </div> <!-- end summary --> |
|
212 | 212 | <div class="cs_files"> |
|
213 | 213 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
214 | ${cbdiffs.render_diffset_menu()} | |
|
214 | ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])} | |
|
215 | 215 | ${cbdiffs.render_diffset( |
|
216 | 216 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )} |
|
217 | 217 | </div> |
|
218 | 218 | |
|
219 | 219 | ## template for inline comment form |
|
220 | 220 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
221 | 221 | |
|
222 | 222 | ## render comments |
|
223 | 223 | ${comment.generate_comments(c.comments)} |
|
224 | 224 | |
|
225 | 225 | ## main comment form and it status |
|
226 | 226 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id), |
|
227 | 227 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} |
|
228 | 228 | </div> |
|
229 | 229 | |
|
230 | 230 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS |
|
231 | 231 | <script type="text/javascript"> |
|
232 | 232 | |
|
233 | 233 | $(document).ready(function() { |
|
234 | 234 | |
|
235 | 235 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); |
|
236 | 236 | if($('#trimmed_message_box').height() === boxmax){ |
|
237 | 237 | $('#message_expand').show(); |
|
238 | 238 | } |
|
239 | 239 | |
|
240 | 240 | $('#message_expand').on('click', function(e){ |
|
241 | 241 | $('#trimmed_message_box').css('max-height', 'none'); |
|
242 | 242 | $(this).hide(); |
|
243 | 243 | }); |
|
244 | 244 | |
|
245 | 245 | $('.show-inline-comments').on('click', function(e){ |
|
246 | 246 | var boxid = $(this).attr('data-comment-id'); |
|
247 | 247 | var button = $(this); |
|
248 | 248 | |
|
249 | 249 | if(button.hasClass("comments-visible")) { |
|
250 | 250 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
251 | 251 | $(this).hide(); |
|
252 | 252 | }); |
|
253 | 253 | button.removeClass("comments-visible"); |
|
254 | 254 | } else { |
|
255 | 255 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
256 | 256 | $(this).show(); |
|
257 | 257 | }); |
|
258 | 258 | button.addClass("comments-visible"); |
|
259 | 259 | } |
|
260 | 260 | }); |
|
261 | 261 | |
|
262 | 262 | |
|
263 | 263 | // next links |
|
264 | 264 | $('#child_link').on('click', function(e){ |
|
265 | 265 | // fetch via ajax what is going to be the next link, if we have |
|
266 | 266 | // >1 links show them to user to choose |
|
267 | 267 | if(!$('#child_link').hasClass('disabled')){ |
|
268 | 268 | $.ajax({ |
|
269 | 269 | url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
270 | 270 | success: function(data) { |
|
271 | 271 | if(data.results.length === 0){ |
|
272 | 272 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); |
|
273 | 273 | } |
|
274 | 274 | if(data.results.length === 1){ |
|
275 | 275 | var commit = data.results[0]; |
|
276 | 276 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
277 | 277 | } |
|
278 | 278 | else if(data.results.length === 2){ |
|
279 | 279 | $('#child_link').addClass('disabled'); |
|
280 | 280 | $('#child_link').addClass('double'); |
|
281 | 281 | var _html = ''; |
|
282 | 282 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
283 | 283 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
284 | 284 | .replace('__title__', data.results[0].message) |
|
285 | 285 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
286 | 286 | _html +=' | '; |
|
287 | 287 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
288 | 288 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
289 | 289 | .replace('__title__', data.results[1].message) |
|
290 | 290 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
291 | 291 | $('#child_link').html(_html); |
|
292 | 292 | } |
|
293 | 293 | } |
|
294 | 294 | }); |
|
295 | 295 | e.preventDefault(); |
|
296 | 296 | } |
|
297 | 297 | }); |
|
298 | 298 | |
|
299 | 299 | // prev links |
|
300 | 300 | $('#parent_link').on('click', function(e){ |
|
301 | 301 | // fetch via ajax what is going to be the next link, if we have |
|
302 | 302 | // >1 links show them to user to choose |
|
303 | 303 | if(!$('#parent_link').hasClass('disabled')){ |
|
304 | 304 | $.ajax({ |
|
305 | 305 | url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
306 | 306 | success: function(data) { |
|
307 | 307 | if(data.results.length === 0){ |
|
308 | 308 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); |
|
309 | 309 | } |
|
310 | 310 | if(data.results.length === 1){ |
|
311 | 311 | var commit = data.results[0]; |
|
312 | 312 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
313 | 313 | } |
|
314 | 314 | else if(data.results.length === 2){ |
|
315 | 315 | $('#parent_link').addClass('disabled'); |
|
316 | 316 | $('#parent_link').addClass('double'); |
|
317 | 317 | var _html = ''; |
|
318 | 318 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
319 | 319 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
320 | 320 | .replace('__title__', data.results[0].message) |
|
321 | 321 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
322 | 322 | _html +=' | '; |
|
323 | 323 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
324 | 324 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
325 | 325 | .replace('__title__', data.results[1].message) |
|
326 | 326 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
327 | 327 | $('#parent_link').html(_html); |
|
328 | 328 | } |
|
329 | 329 | } |
|
330 | 330 | }); |
|
331 | 331 | e.preventDefault(); |
|
332 | 332 | } |
|
333 | 333 | }); |
|
334 | 334 | |
|
335 | 335 | if (location.hash) { |
|
336 | 336 | var result = splitDelimitedHash(location.hash); |
|
337 | 337 | var line = $('html').find(result.loc); |
|
338 | 338 | if (line.length > 0){ |
|
339 | 339 | offsetScroll(line, 70); |
|
340 | 340 | } |
|
341 | 341 | } |
|
342 | 342 | |
|
343 | 343 | // browse tree @ revision |
|
344 | 344 | $('#files_link').on('click', function(e){ |
|
345 | 345 | window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}'; |
|
346 | 346 | e.preventDefault(); |
|
347 | 347 | }); |
|
348 | 348 | |
|
349 | 349 | // inject comments into their proper positions |
|
350 | 350 | var file_comments = $('.inline-comment-placeholder'); |
|
351 | 351 | }) |
|
352 | 352 | </script> |
|
353 | 353 | |
|
354 | 354 | </%def> |
@@ -1,131 +1,131 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Commits') % c.repo_name} - |
|
6 |
r${c.commit_ranges[0]. |
|
|
6 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)} | |
|
7 | 7 | ... |
|
8 |
r${c.commit_ranges[-1]. |
|
|
8 | r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} | |
|
9 | 9 | ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
10 | 10 | %if c.rhodecode_name: |
|
11 | 11 | · ${h.branding(c.rhodecode_name)} |
|
12 | 12 | %endif |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="breadcrumbs_links()"> |
|
16 | 16 | ${_('Commits')} - |
|
17 |
r${c.commit_ranges[0]. |
|
|
17 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)} | |
|
18 | 18 | ... |
|
19 |
r${c.commit_ranges[-1]. |
|
|
19 | r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} | |
|
20 | 20 | ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
21 | 21 | </%def> |
|
22 | 22 | |
|
23 | 23 | <%def name="menu_bar_nav()"> |
|
24 | 24 | ${self.menu_items(active='repositories')} |
|
25 | 25 | </%def> |
|
26 | 26 | |
|
27 | 27 | <%def name="menu_bar_subnav()"> |
|
28 | 28 | ${self.repo_menu(active='changelog')} |
|
29 | 29 | </%def> |
|
30 | 30 | |
|
31 | 31 | <%def name="main()"> |
|
32 | 32 | <div class="summary-header"> |
|
33 | 33 | <div class="title"> |
|
34 | 34 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
35 | 35 | </div> |
|
36 | 36 | </div> |
|
37 | 37 | |
|
38 | 38 | |
|
39 | 39 | <div class="summary changeset"> |
|
40 | 40 | <div class="summary-detail"> |
|
41 | 41 | <div class="summary-detail-header"> |
|
42 | 42 | <span class="breadcrumbs files_location"> |
|
43 | 43 | <h4> |
|
44 | 44 | ${_('Commit Range')} |
|
45 | 45 | <code> |
|
46 |
r${c.commit_ranges[0]. |
|
|
46 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} | |
|
47 | 47 | </code> |
|
48 | 48 | </h4> |
|
49 | 49 | </span> |
|
50 | 50 | </div> |
|
51 | 51 | |
|
52 | 52 | <div class="fieldset"> |
|
53 | 53 | <div class="left-label"> |
|
54 | 54 | ${_('Diff option')}: |
|
55 | 55 | </div> |
|
56 | 56 | <div class="right-content"> |
|
57 |
<div class=" |
|
|
57 | <div class="btn btn-primary"> | |
|
58 | 58 | <a href="${h.route_path('repo_compare', |
|
59 | 59 | repo_name=c.repo_name, |
|
60 | 60 | source_ref_type='rev', |
|
61 | 61 | source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'), |
|
62 | 62 | target_ref_type='rev', |
|
63 | 63 | target_ref=c.commit_ranges[-1].raw_id)}" |
|
64 | 64 | > |
|
65 | 65 | ${_('Show combined compare')} |
|
66 | 66 | </a> |
|
67 | 67 | </div> |
|
68 | 68 | </div> |
|
69 | 69 | </div> |
|
70 | 70 | |
|
71 | 71 | <%doc> |
|
72 | 72 | ##TODO(marcink): implement this and diff menus |
|
73 | 73 | <div class="fieldset"> |
|
74 | 74 | <div class="left-label"> |
|
75 | 75 | ${_('Diff options')}: |
|
76 | 76 | </div> |
|
77 | 77 | <div class="right-content"> |
|
78 | 78 | <div class="diff-actions"> |
|
79 | 79 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
80 | 80 | ${_('Raw Diff')} |
|
81 | 81 | </a> |
|
82 | 82 | | |
|
83 | 83 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
84 | 84 | ${_('Patch Diff')} |
|
85 | 85 | </a> |
|
86 | 86 | | |
|
87 | 87 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
88 | 88 | ${_('Download Diff')} |
|
89 | 89 | </a> |
|
90 | 90 | </div> |
|
91 | 91 | </div> |
|
92 | 92 | </div> |
|
93 | 93 | </%doc> |
|
94 | 94 | </div> <!-- end summary-detail --> |
|
95 | 95 | |
|
96 | 96 | </div> <!-- end summary --> |
|
97 | 97 | |
|
98 | 98 | <div id="changeset_compare_view_content"> |
|
99 | 99 | <div class="pull-left"> |
|
100 | 100 | <div class="btn-group"> |
|
101 | 101 | <a |
|
102 | 102 | class="btn" |
|
103 | 103 | href="#" |
|
104 | 104 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
105 | 105 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
106 | 106 | </a> |
|
107 | 107 | <a |
|
108 | 108 | class="btn" |
|
109 | 109 | href="#" |
|
110 | 110 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
111 | 111 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
112 | 112 | </a> |
|
113 | 113 | </div> |
|
114 | 114 | </div> |
|
115 | 115 | ## Commit range generated below |
|
116 | 116 | <%include file="../compare/compare_commits.mako"/> |
|
117 | 117 | <div class="cs_files"> |
|
118 | 118 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
119 | 119 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
120 | 120 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
121 | 121 | ${cbdiffs.render_diffset_menu()} |
|
122 | 122 | %for commit in c.commit_ranges: |
|
123 | 123 | ${cbdiffs.render_diffset( |
|
124 | 124 | diffset=c.changes[commit.raw_id], |
|
125 | 125 | collapse_when_files_over=5, |
|
126 | 126 | commit=commit, |
|
127 | 127 | )} |
|
128 | 128 | %endfor |
|
129 | 129 | </div> |
|
130 | 130 | </div> |
|
131 | 131 | </%def> |
@@ -1,767 +1,870 b'' | |||
|
1 | 1 | <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="diff_line_anchor(filename, line, type)"><% |
|
4 | 4 | return '%s_%s_%i' % (h.safeid(filename), type, line) |
|
5 | 5 | %></%def> |
|
6 | 6 | |
|
7 | 7 | <%def name="action_class(action)"> |
|
8 | 8 | <% |
|
9 | 9 | return { |
|
10 | 10 | '-': 'cb-deletion', |
|
11 | 11 | '+': 'cb-addition', |
|
12 | 12 | ' ': 'cb-context', |
|
13 | 13 | }.get(action, 'cb-empty') |
|
14 | 14 | %> |
|
15 | 15 | </%def> |
|
16 | 16 | |
|
17 | 17 | <%def name="op_class(op_id)"> |
|
18 | 18 | <% |
|
19 | 19 | return { |
|
20 | 20 | DEL_FILENODE: 'deletion', # file deleted |
|
21 | 21 | BIN_FILENODE: 'warning' # binary diff hidden |
|
22 | 22 | }.get(op_id, 'addition') |
|
23 | 23 | %> |
|
24 | 24 | </%def> |
|
25 | 25 | |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | <%def name="render_diffset(diffset, commit=None, |
|
29 | 29 | |
|
30 | 30 | # collapse all file diff entries when there are more than this amount of files in the diff |
|
31 | 31 | collapse_when_files_over=20, |
|
32 | 32 | |
|
33 | 33 | # collapse lines in the diff when more than this amount of lines changed in the file diff |
|
34 | 34 | lines_changed_limit=500, |
|
35 | 35 | |
|
36 | 36 | # add a ruler at to the output |
|
37 | 37 | ruler_at_chars=0, |
|
38 | 38 | |
|
39 | 39 | # show inline comments |
|
40 | 40 | use_comments=False, |
|
41 | 41 | |
|
42 | 42 | # disable new comments |
|
43 | 43 | disable_new_comments=False, |
|
44 | 44 | |
|
45 | 45 | # special file-comments that were deleted in previous versions |
|
46 | 46 | # it's used for showing outdated comments for deleted files in a PR |
|
47 | 47 | deleted_files_comments=None, |
|
48 | 48 | |
|
49 | 49 | # for cache purpose |
|
50 | 50 | inline_comments=None |
|
51 | 51 | |
|
52 | 52 | )"> |
|
53 | 53 | %if use_comments: |
|
54 | 54 | <div id="cb-comments-inline-container-template" class="js-template"> |
|
55 | 55 | ${inline_comments_container([], inline_comments)} |
|
56 | 56 | </div> |
|
57 | 57 | <div class="js-template" id="cb-comment-inline-form-template"> |
|
58 | 58 | <div class="comment-inline-form ac"> |
|
59 | 59 | |
|
60 | 60 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
61 | 61 | ## render template for inline comments |
|
62 | 62 | ${commentblock.comment_form(form_type='inline')} |
|
63 | 63 | %else: |
|
64 | 64 | ${h.form('', class_='inline-form comment-form-login', method='get')} |
|
65 | 65 | <div class="pull-left"> |
|
66 | 66 | <div class="comment-help pull-right"> |
|
67 | 67 | ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a> |
|
68 | 68 | </div> |
|
69 | 69 | </div> |
|
70 | 70 | <div class="comment-button pull-right"> |
|
71 | 71 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> |
|
72 | 72 | ${_('Cancel')} |
|
73 | 73 | </button> |
|
74 | 74 | </div> |
|
75 | 75 | <div class="clearfix"></div> |
|
76 | 76 | ${h.end_form()} |
|
77 | 77 | %endif |
|
78 | 78 | </div> |
|
79 | 79 | </div> |
|
80 | 80 | |
|
81 | 81 | %endif |
|
82 | 82 | <% |
|
83 | 83 | collapse_all = len(diffset.files) > collapse_when_files_over |
|
84 | 84 | %> |
|
85 | 85 | |
|
86 | 86 | %if c.user_session_attrs["diffmode"] == 'sideside': |
|
87 | 87 | <style> |
|
88 | 88 | .wrapper { |
|
89 | 89 | max-width: 1600px !important; |
|
90 | 90 | } |
|
91 | 91 | </style> |
|
92 | 92 | %endif |
|
93 | 93 | |
|
94 | 94 | %if ruler_at_chars: |
|
95 | 95 | <style> |
|
96 | 96 | .diff table.cb .cb-content:after { |
|
97 | 97 | content: ""; |
|
98 | 98 | border-left: 1px solid blue; |
|
99 | 99 | position: absolute; |
|
100 | 100 | top: 0; |
|
101 | 101 | height: 18px; |
|
102 | 102 | opacity: .2; |
|
103 | 103 | z-index: 10; |
|
104 | 104 | //## +5 to account for diff action (+/-) |
|
105 | 105 | left: ${ruler_at_chars + 5}ch; |
|
106 | 106 | </style> |
|
107 | 107 | %endif |
|
108 | 108 | |
|
109 | 109 | <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}"> |
|
110 | 110 | <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}"> |
|
111 | 111 | %if commit: |
|
112 | 112 | <div class="pull-right"> |
|
113 | 113 | <a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.route_path('repo_files',repo_name=diffset.repo_name, commit_id=commit.raw_id, f_path='')}"> |
|
114 | 114 | ${_('Browse Files')} |
|
115 | 115 | </a> |
|
116 | 116 | </div> |
|
117 | 117 | %endif |
|
118 | 118 | <h2 class="clearinner"> |
|
119 |
|
|
|
120 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> - | |
|
121 | ${h.age_component(commit.date)} - | |
|
122 | %endif | |
|
123 | ||
|
124 | %if diffset.limited_diff: | |
|
125 | ${_('The requested commit is too big and content was truncated.')} | |
|
126 | ||
|
127 | ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} | |
|
128 | <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
|
129 | %else: | |
|
130 |
|
|
|
131 |
|
|
|
132 | %endif | |
|
119 | ## invidual commit | |
|
120 | % if commit: | |
|
121 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a> - | |
|
122 | ${h.age_component(commit.date)} | |
|
123 | % if diffset.limited_diff: | |
|
124 | - ${_('The requested commit is too big and content was truncated.')} | |
|
125 | ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} | |
|
126 | <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
|
127 | % elif hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1: | |
|
128 | ## compare diff, has no file-selector and we want to show stats anyway | |
|
129 | ${_ungettext('{num} file changed: {linesadd} inserted, ''{linesdel} deleted', | |
|
130 | '{num} files changed: {linesadd} inserted, {linesdel} deleted', diffset.changed_files) \ | |
|
131 | .format(num=diffset.changed_files, linesadd=diffset.lines_added, linesdel=diffset.lines_deleted)} | |
|
132 | % endif | |
|
133 | % else: | |
|
134 | ## pull requests/compare | |
|
135 | ${_('File Changes')} | |
|
136 | % endif | |
|
133 | 137 | |
|
134 | 138 | </h2> |
|
135 | 139 | </div> |
|
136 | 140 | |
|
137 | 141 | %if diffset.has_hidden_changes: |
|
138 | 142 | <p class="empty_data">${_('Some changes may be hidden')}</p> |
|
139 | 143 | %elif not diffset.files: |
|
140 | 144 | <p class="empty_data">${_('No files')}</p> |
|
141 | 145 | %endif |
|
142 | 146 | |
|
143 | 147 | <div class="filediffs"> |
|
144 | 148 | ## initial value could be marked as False later on |
|
145 | 149 | <% over_lines_changed_limit = False %> |
|
146 | 150 | %for i, filediff in enumerate(diffset.files): |
|
147 | 151 | |
|
148 | 152 | <% |
|
149 | 153 | lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted'] |
|
150 | 154 | over_lines_changed_limit = lines_changed > lines_changed_limit |
|
151 | 155 | %> |
|
152 | 156 | |
|
153 | 157 | <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox"> |
|
154 | 158 | <div |
|
155 | 159 | class="filediff" |
|
156 | 160 | data-f-path="${filediff.patch['filename']}" |
|
157 | 161 | id="a_${h.FID('', filediff.patch['filename'])}" |
|
158 | 162 | > |
|
159 | 163 | |
|
160 | 164 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> |
|
161 | 165 | <div class="filediff-collapse-indicator"></div> |
|
162 | 166 | ${diff_ops(filediff)} |
|
163 | 167 | </label> |
|
164 | 168 | ${diff_menu(filediff, use_comments=use_comments)} |
|
165 | 169 | <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}"> |
|
166 | 170 | |
|
167 | 171 | ## new/deleted/empty content case |
|
168 | 172 | % if not filediff.hunks: |
|
169 | 173 | ## Comment container, on "fakes" hunk that contains all data to render comments |
|
170 | 174 | ${render_hunk_lines(c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments)} |
|
171 | 175 | % endif |
|
172 | 176 | |
|
173 | 177 | %if filediff.limited_diff: |
|
174 | 178 | <tr class="cb-warning cb-collapser"> |
|
175 | 179 | <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}> |
|
176 | 180 | ${_('The requested commit is too big and content was truncated.')} <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
177 | 181 | </td> |
|
178 | 182 | </tr> |
|
179 | 183 | %else: |
|
180 | 184 | %if over_lines_changed_limit: |
|
181 | 185 | <tr class="cb-warning cb-collapser"> |
|
182 | 186 | <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}> |
|
183 | 187 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} |
|
184 | 188 | <a href="#" class="cb-expand" |
|
185 | 189 | onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')} |
|
186 | 190 | </a> |
|
187 | 191 | <a href="#" class="cb-collapse" |
|
188 | 192 | onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')} |
|
189 | 193 | </a> |
|
190 | 194 | </td> |
|
191 | 195 | </tr> |
|
192 | 196 | %endif |
|
193 | 197 | %endif |
|
194 | 198 | |
|
195 | 199 | % for hunk in filediff.hunks: |
|
196 | 200 | <tr class="cb-hunk"> |
|
197 | 201 | <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}> |
|
198 | 202 | ## TODO: dan: add ajax loading of more context here |
|
199 | 203 | ## <a href="#"> |
|
200 | 204 | <i class="icon-more"></i> |
|
201 | 205 | ## </a> |
|
202 | 206 | </td> |
|
203 | 207 | <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}> |
|
204 | 208 | @@ |
|
205 | 209 | -${hunk.source_start},${hunk.source_length} |
|
206 | 210 | +${hunk.target_start},${hunk.target_length} |
|
207 | 211 | ${hunk.section_header} |
|
208 | 212 | </td> |
|
209 | 213 | </tr> |
|
210 | 214 | ${render_hunk_lines(c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
211 | 215 | % endfor |
|
212 | 216 | |
|
213 | 217 | <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %> |
|
214 | 218 | |
|
215 | 219 | ## outdated comments that do not fit into currently displayed lines |
|
216 | 220 | % for lineno, comments in unmatched_comments.items(): |
|
217 | 221 | |
|
218 | 222 | %if c.user_session_attrs["diffmode"] == 'unified': |
|
219 | 223 | % if loop.index == 0: |
|
220 | 224 | <tr class="cb-hunk"> |
|
221 | 225 | <td colspan="3"></td> |
|
222 | 226 | <td> |
|
223 | 227 | <div> |
|
224 | 228 | ${_('Unmatched inline comments below')} |
|
225 | 229 | </div> |
|
226 | 230 | </td> |
|
227 | 231 | </tr> |
|
228 | 232 | % endif |
|
229 | 233 | <tr class="cb-line"> |
|
230 | 234 | <td class="cb-data cb-context"></td> |
|
231 | 235 | <td class="cb-lineno cb-context"></td> |
|
232 | 236 | <td class="cb-lineno cb-context"></td> |
|
233 | 237 | <td class="cb-content cb-context"> |
|
234 | 238 | ${inline_comments_container(comments, inline_comments)} |
|
235 | 239 | </td> |
|
236 | 240 | </tr> |
|
237 | 241 | %elif c.user_session_attrs["diffmode"] == 'sideside': |
|
238 | 242 | % if loop.index == 0: |
|
239 | 243 | <tr class="cb-comment-info"> |
|
240 | 244 | <td colspan="2"></td> |
|
241 | 245 | <td class="cb-line"> |
|
242 | 246 | <div> |
|
243 | 247 | ${_('Unmatched inline comments below')} |
|
244 | 248 | </div> |
|
245 | 249 | </td> |
|
246 | 250 | <td colspan="2"></td> |
|
247 | 251 | <td class="cb-line"> |
|
248 | 252 | <div> |
|
249 | 253 | ${_('Unmatched comments below')} |
|
250 | 254 | </div> |
|
251 | 255 | </td> |
|
252 | 256 | </tr> |
|
253 | 257 | % endif |
|
254 | 258 | <tr class="cb-line"> |
|
255 | 259 | <td class="cb-data cb-context"></td> |
|
256 | 260 | <td class="cb-lineno cb-context"></td> |
|
257 | 261 | <td class="cb-content cb-context"> |
|
258 | 262 | % if lineno.startswith('o'): |
|
259 | 263 | ${inline_comments_container(comments, inline_comments)} |
|
260 | 264 | % endif |
|
261 | 265 | </td> |
|
262 | 266 | |
|
263 | 267 | <td class="cb-data cb-context"></td> |
|
264 | 268 | <td class="cb-lineno cb-context"></td> |
|
265 | 269 | <td class="cb-content cb-context"> |
|
266 | 270 | % if lineno.startswith('n'): |
|
267 | 271 | ${inline_comments_container(comments, inline_comments)} |
|
268 | 272 | % endif |
|
269 | 273 | </td> |
|
270 | 274 | </tr> |
|
271 | 275 | %endif |
|
272 | 276 | |
|
273 | 277 | % endfor |
|
274 | 278 | |
|
275 | 279 | </table> |
|
276 | 280 | </div> |
|
277 | 281 | %endfor |
|
278 | 282 | |
|
279 | 283 | ## outdated comments that are made for a file that has been deleted |
|
280 | 284 | % for filename, comments_dict in (deleted_files_comments or {}).items(): |
|
281 | 285 | <% |
|
282 | 286 | display_state = 'display: none' |
|
283 | 287 | open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False] |
|
284 | 288 | if open_comments_in_file: |
|
285 | 289 | display_state = '' |
|
286 | 290 | %> |
|
287 | 291 | <div class="filediffs filediff-outdated" style="${display_state}"> |
|
288 | 292 | <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox"> |
|
289 | 293 | <div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}"> |
|
290 | 294 | <label for="filediff-collapse-${id(filename)}" class="filediff-heading"> |
|
291 | 295 | <div class="filediff-collapse-indicator"></div> |
|
292 | 296 | <span class="pill"> |
|
293 | 297 | ## file was deleted |
|
294 | 298 | <strong>${filename}</strong> |
|
295 | 299 | </span> |
|
296 | 300 | <span class="pill-group" style="float: left"> |
|
297 | 301 | ## file op, doesn't need translation |
|
298 | 302 | <span class="pill" op="removed">removed in this version</span> |
|
299 | 303 | </span> |
|
300 | 304 | <a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">ΒΆ</a> |
|
301 | 305 | <span class="pill-group" style="float: right"> |
|
302 | 306 | <span class="pill" op="deleted">-${comments_dict['stats']}</span> |
|
303 | 307 | </span> |
|
304 | 308 | </label> |
|
305 | 309 | |
|
306 | 310 | <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> |
|
307 | 311 | <tr> |
|
308 | 312 | % if c.user_session_attrs["diffmode"] == 'unified': |
|
309 | 313 | <td></td> |
|
310 | 314 | %endif |
|
311 | 315 | |
|
312 | 316 | <td></td> |
|
313 | 317 | <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}> |
|
314 | 318 | ${_('File was deleted in this version. There are still outdated/unresolved comments attached to it.')} |
|
315 | 319 | </td> |
|
316 | 320 | </tr> |
|
317 | 321 | %if c.user_session_attrs["diffmode"] == 'unified': |
|
318 | 322 | <tr class="cb-line"> |
|
319 | 323 | <td class="cb-data cb-context"></td> |
|
320 | 324 | <td class="cb-lineno cb-context"></td> |
|
321 | 325 | <td class="cb-lineno cb-context"></td> |
|
322 | 326 | <td class="cb-content cb-context"> |
|
323 | 327 | ${inline_comments_container(comments_dict['comments'], inline_comments)} |
|
324 | 328 | </td> |
|
325 | 329 | </tr> |
|
326 | 330 | %elif c.user_session_attrs["diffmode"] == 'sideside': |
|
327 | 331 | <tr class="cb-line"> |
|
328 | 332 | <td class="cb-data cb-context"></td> |
|
329 | 333 | <td class="cb-lineno cb-context"></td> |
|
330 | 334 | <td class="cb-content cb-context"></td> |
|
331 | 335 | |
|
332 | 336 | <td class="cb-data cb-context"></td> |
|
333 | 337 | <td class="cb-lineno cb-context"></td> |
|
334 | 338 | <td class="cb-content cb-context"> |
|
335 | 339 | ${inline_comments_container(comments_dict['comments'], inline_comments)} |
|
336 | 340 | </td> |
|
337 | 341 | </tr> |
|
338 | 342 | %endif |
|
339 | 343 | </table> |
|
340 | 344 | </div> |
|
341 | 345 | </div> |
|
342 | 346 | % endfor |
|
343 | 347 | |
|
344 | 348 | </div> |
|
345 | 349 | </div> |
|
346 | 350 | </%def> |
|
347 | 351 | |
|
348 | 352 | <%def name="diff_ops(filediff)"> |
|
349 | 353 | <% |
|
350 | 354 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ |
|
351 | 355 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE |
|
352 | 356 | %> |
|
353 | 357 | <span class="pill"> |
|
354 | 358 | %if filediff.source_file_path and filediff.target_file_path: |
|
355 | 359 | %if filediff.source_file_path != filediff.target_file_path: |
|
356 | 360 | ## file was renamed, or copied |
|
357 | 361 | %if RENAMED_FILENODE in filediff.patch['stats']['ops']: |
|
358 | 362 | <strong>${filediff.target_file_path}</strong> β¬ <del>${filediff.source_file_path}</del> |
|
359 | 363 | <% final_path = filediff.target_file_path %> |
|
360 | 364 | %elif COPIED_FILENODE in filediff.patch['stats']['ops']: |
|
361 | 365 | <strong>${filediff.target_file_path}</strong> β¬ ${filediff.source_file_path} |
|
362 | 366 | <% final_path = filediff.target_file_path %> |
|
363 | 367 | %endif |
|
364 | 368 | %else: |
|
365 | 369 | ## file was modified |
|
366 | 370 | <strong>${filediff.source_file_path}</strong> |
|
367 | 371 | <% final_path = filediff.source_file_path %> |
|
368 | 372 | %endif |
|
369 | 373 | %else: |
|
370 | 374 | %if filediff.source_file_path: |
|
371 | 375 | ## file was deleted |
|
372 | 376 | <strong>${filediff.source_file_path}</strong> |
|
373 | 377 | <% final_path = filediff.source_file_path %> |
|
374 | 378 | %else: |
|
375 | 379 | ## file was added |
|
376 | 380 | <strong>${filediff.target_file_path}</strong> |
|
377 | 381 | <% final_path = filediff.target_file_path %> |
|
378 | 382 | %endif |
|
379 | 383 | %endif |
|
380 | 384 | <i style="color: #aaa" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy the full path')}" onclick="return false;"></i> |
|
381 | 385 | </span> |
|
382 | 386 | <span class="pill-group" style="float: left"> |
|
383 | 387 | %if filediff.limited_diff: |
|
384 | 388 | <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span> |
|
385 | 389 | %endif |
|
386 | 390 | |
|
387 | 391 | %if RENAMED_FILENODE in filediff.patch['stats']['ops']: |
|
388 | 392 | <span class="pill" op="renamed">renamed</span> |
|
389 | 393 | %endif |
|
390 | 394 | |
|
391 | 395 | %if COPIED_FILENODE in filediff.patch['stats']['ops']: |
|
392 | 396 | <span class="pill" op="copied">copied</span> |
|
393 | 397 | %endif |
|
394 | 398 | |
|
395 | 399 | %if NEW_FILENODE in filediff.patch['stats']['ops']: |
|
396 | 400 | <span class="pill" op="created">created</span> |
|
397 | 401 | %if filediff['target_mode'].startswith('120'): |
|
398 | 402 | <span class="pill" op="symlink">symlink</span> |
|
399 | 403 | %else: |
|
400 | 404 | <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span> |
|
401 | 405 | %endif |
|
402 | 406 | %endif |
|
403 | 407 | |
|
404 | 408 | %if DEL_FILENODE in filediff.patch['stats']['ops']: |
|
405 | 409 | <span class="pill" op="removed">removed</span> |
|
406 | 410 | %endif |
|
407 | 411 | |
|
408 | 412 | %if CHMOD_FILENODE in filediff.patch['stats']['ops']: |
|
409 | 413 | <span class="pill" op="mode"> |
|
410 | 414 | ${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])} |
|
411 | 415 | </span> |
|
412 | 416 | %endif |
|
413 | 417 | </span> |
|
414 | 418 | |
|
415 | 419 | <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a> |
|
416 | 420 | |
|
417 | 421 | <span class="pill-group" style="float: right"> |
|
418 | 422 | %if BIN_FILENODE in filediff.patch['stats']['ops']: |
|
419 | 423 | <span class="pill" op="binary">binary</span> |
|
420 | 424 | %if MOD_FILENODE in filediff.patch['stats']['ops']: |
|
421 | 425 | <span class="pill" op="modified">modified</span> |
|
422 | 426 | %endif |
|
423 | 427 | %endif |
|
424 | 428 | %if filediff.patch['stats']['added']: |
|
425 | 429 | <span class="pill" op="added">+${filediff.patch['stats']['added']}</span> |
|
426 | 430 | %endif |
|
427 | 431 | %if filediff.patch['stats']['deleted']: |
|
428 | 432 | <span class="pill" op="deleted">-${filediff.patch['stats']['deleted']}</span> |
|
429 | 433 | %endif |
|
430 | 434 | </span> |
|
431 | 435 | |
|
432 | 436 | </%def> |
|
433 | 437 | |
|
434 | 438 | <%def name="nice_mode(filemode)"> |
|
435 | ${filemode.startswith('100') and filemode[3:] or filemode} | |
|
439 | ${(filemode.startswith('100') and filemode[3:] or filemode)} | |
|
436 | 440 | </%def> |
|
437 | 441 | |
|
438 | 442 | <%def name="diff_menu(filediff, use_comments=False)"> |
|
439 | 443 | <div class="filediff-menu"> |
|
440 | 444 | %if filediff.diffset.source_ref: |
|
441 | 445 | %if filediff.operation in ['D', 'M']: |
|
442 | 446 | <a |
|
443 | 447 | class="tooltip" |
|
444 | 448 | href="${h.route_path('repo_files',repo_name=filediff.diffset.repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}" |
|
445 | 449 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
446 | 450 | > |
|
447 | 451 | ${_('Show file before')} |
|
448 | 452 | </a> | |
|
449 | 453 | %else: |
|
450 | 454 | <span |
|
451 | 455 | class="tooltip" |
|
452 | 456 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
453 | 457 | > |
|
454 | 458 | ${_('Show file before')} |
|
455 | 459 | </span> | |
|
456 | 460 | %endif |
|
457 | 461 | %if filediff.operation in ['A', 'M']: |
|
458 | 462 | <a |
|
459 | 463 | class="tooltip" |
|
460 | 464 | href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}" |
|
461 | 465 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
462 | 466 | > |
|
463 | 467 | ${_('Show file after')} |
|
464 | 468 | </a> | |
|
465 | 469 | %else: |
|
466 | 470 | <span |
|
467 | 471 | class="tooltip" |
|
468 | 472 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
469 | 473 | > |
|
470 | 474 | ${_('Show file after')} |
|
471 | 475 | </span> | |
|
472 | 476 | %endif |
|
473 | 477 | <a |
|
474 | 478 | class="tooltip" |
|
475 | 479 | title="${h.tooltip(_('Raw diff'))}" |
|
476 | 480 | href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw'))}" |
|
477 | 481 | > |
|
478 | 482 | ${_('Raw diff')} |
|
479 | 483 | </a> | |
|
480 | 484 | <a |
|
481 | 485 | class="tooltip" |
|
482 | 486 | title="${h.tooltip(_('Download diff'))}" |
|
483 | 487 | href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download'))}" |
|
484 | 488 | > |
|
485 | 489 | ${_('Download diff')} |
|
486 | 490 | </a> |
|
487 | 491 | % if use_comments: |
|
488 | 492 | | |
|
489 | 493 | % endif |
|
490 | 494 | |
|
491 | 495 | ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks) |
|
492 | 496 | %if hasattr(c, 'ignorews_url'): |
|
493 | 497 | ${c.ignorews_url(request, h.FID('', filediff.patch['filename']))} |
|
494 | 498 | %endif |
|
495 | 499 | %if hasattr(c, 'context_url'): |
|
496 | 500 | ${c.context_url(request, h.FID('', filediff.patch['filename']))} |
|
497 | 501 | %endif |
|
498 | 502 | |
|
499 | 503 | %if use_comments: |
|
500 | 504 | <a href="#" onclick="return Rhodecode.comments.toggleComments(this);"> |
|
501 | 505 | <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span> |
|
502 | 506 | </a> |
|
503 | 507 | %endif |
|
504 | 508 | %endif |
|
505 | 509 | </div> |
|
506 | 510 | </%def> |
|
507 | 511 | |
|
508 | 512 | |
|
509 | 513 | <%def name="inline_comments_container(comments, inline_comments)"> |
|
510 | 514 | <div class="inline-comments"> |
|
511 | 515 | %for comment in comments: |
|
512 | 516 | ${commentblock.comment_block(comment, inline=True)} |
|
513 | 517 | %endfor |
|
514 | 518 | % if comments and comments[-1].outdated: |
|
515 | 519 | <span class="btn btn-secondary cb-comment-add-button comment-outdated}" |
|
516 | 520 | style="display: none;}"> |
|
517 | 521 | ${_('Add another comment')} |
|
518 | 522 | </span> |
|
519 | 523 | % else: |
|
520 | 524 | <span onclick="return Rhodecode.comments.createComment(this)" |
|
521 | 525 | class="btn btn-secondary cb-comment-add-button"> |
|
522 | 526 | ${_('Add another comment')} |
|
523 | 527 | </span> |
|
524 | 528 | % endif |
|
525 | 529 | |
|
526 | 530 | </div> |
|
527 | 531 | </%def> |
|
528 | 532 | |
|
529 | 533 | <%! |
|
530 | 534 | def get_comments_for(diff_type, comments, filename, line_version, line_number): |
|
531 | 535 | if hasattr(filename, 'unicode_path'): |
|
532 | 536 | filename = filename.unicode_path |
|
533 | 537 | |
|
534 | 538 | if not isinstance(filename, basestring): |
|
535 | 539 | return None |
|
536 | 540 | |
|
537 | 541 | line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12 |
|
538 | 542 | |
|
539 | 543 | if comments and filename in comments: |
|
540 | 544 | file_comments = comments[filename] |
|
541 | 545 | if line_key in file_comments: |
|
542 | 546 | data = file_comments.pop(line_key) |
|
543 | 547 | return data |
|
544 | 548 | %> |
|
545 | 549 | |
|
546 | 550 | <%def name="render_hunk_lines_sideside(hunk, use_comments=False, inline_comments=None)"> |
|
547 | 551 | |
|
548 | 552 | %for i, line in enumerate(hunk.sideside): |
|
549 | 553 | <% |
|
550 | 554 | old_line_anchor, new_line_anchor = None, None |
|
551 | 555 | if line.original.lineno: |
|
552 | 556 | old_line_anchor = diff_line_anchor(hunk.source_file_path, line.original.lineno, 'o') |
|
553 | 557 | if line.modified.lineno: |
|
554 | 558 | new_line_anchor = diff_line_anchor(hunk.target_file_path, line.modified.lineno, 'n') |
|
555 | 559 | %> |
|
556 | 560 | |
|
557 | 561 | <tr class="cb-line"> |
|
558 | 562 | <td class="cb-data ${action_class(line.original.action)}" |
|
559 | 563 | data-line-no="${line.original.lineno}" |
|
560 | 564 | > |
|
561 | 565 | <div> |
|
562 | 566 | |
|
563 | 567 | <% line_old_comments = None %> |
|
564 | 568 | %if line.original.get_comment_args: |
|
565 | 569 | <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %> |
|
566 | 570 | %endif |
|
567 | 571 | %if line_old_comments: |
|
568 | 572 | <% has_outdated = any([x.outdated for x in line_old_comments]) %> |
|
569 | 573 | % if has_outdated: |
|
570 | 574 | <i title="${_('comments including outdated')}:${len(line_old_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
571 | 575 | % else: |
|
572 | 576 | <i title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
573 | 577 | % endif |
|
574 | 578 | %endif |
|
575 | 579 | </div> |
|
576 | 580 | </td> |
|
577 | 581 | <td class="cb-lineno ${action_class(line.original.action)}" |
|
578 | 582 | data-line-no="${line.original.lineno}" |
|
579 | 583 | %if old_line_anchor: |
|
580 | 584 | id="${old_line_anchor}" |
|
581 | 585 | %endif |
|
582 | 586 | > |
|
583 | 587 | %if line.original.lineno: |
|
584 | 588 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> |
|
585 | 589 | %endif |
|
586 | 590 | </td> |
|
587 | 591 | <td class="cb-content ${action_class(line.original.action)}" |
|
588 | 592 | data-line-no="o${line.original.lineno}" |
|
589 | 593 | > |
|
590 | 594 | %if use_comments and line.original.lineno: |
|
591 | 595 | ${render_add_comment_button()} |
|
592 | 596 | %endif |
|
593 | 597 | <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span> |
|
594 | 598 | |
|
595 | 599 | %if use_comments and line.original.lineno and line_old_comments: |
|
596 | 600 | ${inline_comments_container(line_old_comments, inline_comments)} |
|
597 | 601 | %endif |
|
598 | 602 | |
|
599 | 603 | </td> |
|
600 | 604 | <td class="cb-data ${action_class(line.modified.action)}" |
|
601 | 605 | data-line-no="${line.modified.lineno}" |
|
602 | 606 | > |
|
603 | 607 | <div> |
|
604 | 608 | |
|
605 | 609 | %if line.modified.get_comment_args: |
|
606 | 610 | <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %> |
|
607 | 611 | %else: |
|
608 | 612 | <% line_new_comments = None%> |
|
609 | 613 | %endif |
|
610 | 614 | %if line_new_comments: |
|
611 | 615 | <% has_outdated = any([x.outdated for x in line_new_comments]) %> |
|
612 | 616 | % if has_outdated: |
|
613 | 617 | <i title="${_('comments including outdated')}:${len(line_new_comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
614 | 618 | % else: |
|
615 | 619 | <i title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
616 | 620 | % endif |
|
617 | 621 | %endif |
|
618 | 622 | </div> |
|
619 | 623 | </td> |
|
620 | 624 | <td class="cb-lineno ${action_class(line.modified.action)}" |
|
621 | 625 | data-line-no="${line.modified.lineno}" |
|
622 | 626 | %if new_line_anchor: |
|
623 | 627 | id="${new_line_anchor}" |
|
624 | 628 | %endif |
|
625 | 629 | > |
|
626 | 630 | %if line.modified.lineno: |
|
627 | 631 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> |
|
628 | 632 | %endif |
|
629 | 633 | </td> |
|
630 | 634 | <td class="cb-content ${action_class(line.modified.action)}" |
|
631 | 635 | data-line-no="n${line.modified.lineno}" |
|
632 | 636 | > |
|
633 | 637 | %if use_comments and line.modified.lineno: |
|
634 | 638 | ${render_add_comment_button()} |
|
635 | 639 | %endif |
|
636 | 640 | <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span> |
|
637 | 641 | %if use_comments and line.modified.lineno and line_new_comments: |
|
638 | 642 | ${inline_comments_container(line_new_comments, inline_comments)} |
|
639 | 643 | %endif |
|
640 | 644 | </td> |
|
641 | 645 | </tr> |
|
642 | 646 | %endfor |
|
643 | 647 | </%def> |
|
644 | 648 | |
|
645 | 649 | |
|
646 | 650 | <%def name="render_hunk_lines_unified(hunk, use_comments=False, inline_comments=None)"> |
|
647 | 651 | %for old_line_no, new_line_no, action, content, comments_args in hunk.unified: |
|
648 | 652 | <% |
|
649 | 653 | old_line_anchor, new_line_anchor = None, None |
|
650 | 654 | if old_line_no: |
|
651 | 655 | old_line_anchor = diff_line_anchor(hunk.source_file_path, old_line_no, 'o') |
|
652 | 656 | if new_line_no: |
|
653 | 657 | new_line_anchor = diff_line_anchor(hunk.target_file_path, new_line_no, 'n') |
|
654 | 658 | %> |
|
655 | 659 | <tr class="cb-line"> |
|
656 | 660 | <td class="cb-data ${action_class(action)}"> |
|
657 | 661 | <div> |
|
658 | 662 | |
|
659 | 663 | %if comments_args: |
|
660 | 664 | <% comments = get_comments_for('unified', inline_comments, *comments_args) %> |
|
661 | 665 | %else: |
|
662 | 666 | <% comments = None %> |
|
663 | 667 | %endif |
|
664 | 668 | |
|
665 | 669 | % if comments: |
|
666 | 670 | <% has_outdated = any([x.outdated for x in comments]) %> |
|
667 | 671 | % if has_outdated: |
|
668 | 672 | <i title="${_('comments including outdated')}:${len(comments)}" class="icon-comment_toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
669 | 673 | % else: |
|
670 | 674 | <i title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
671 | 675 | % endif |
|
672 | 676 | % endif |
|
673 | 677 | </div> |
|
674 | 678 | </td> |
|
675 | 679 | <td class="cb-lineno ${action_class(action)}" |
|
676 | 680 | data-line-no="${old_line_no}" |
|
677 | 681 | %if old_line_anchor: |
|
678 | 682 | id="${old_line_anchor}" |
|
679 | 683 | %endif |
|
680 | 684 | > |
|
681 | 685 | %if old_line_anchor: |
|
682 | 686 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> |
|
683 | 687 | %endif |
|
684 | 688 | </td> |
|
685 | 689 | <td class="cb-lineno ${action_class(action)}" |
|
686 | 690 | data-line-no="${new_line_no}" |
|
687 | 691 | %if new_line_anchor: |
|
688 | 692 | id="${new_line_anchor}" |
|
689 | 693 | %endif |
|
690 | 694 | > |
|
691 | 695 | %if new_line_anchor: |
|
692 | 696 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> |
|
693 | 697 | %endif |
|
694 | 698 | </td> |
|
695 | 699 | <td class="cb-content ${action_class(action)}" |
|
696 | data-line-no="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}" | |
|
700 | data-line-no="${(new_line_no and 'n' or 'o')}${(new_line_no or old_line_no)}" | |
|
697 | 701 | > |
|
698 | 702 | %if use_comments: |
|
699 | 703 | ${render_add_comment_button()} |
|
700 | 704 | %endif |
|
701 | 705 | <span class="cb-code">${action} ${content or '' | n}</span> |
|
702 | 706 | %if use_comments and comments: |
|
703 | 707 | ${inline_comments_container(comments, inline_comments)} |
|
704 | 708 | %endif |
|
705 | 709 | </td> |
|
706 | 710 | </tr> |
|
707 | 711 | %endfor |
|
708 | 712 | </%def> |
|
709 | 713 | |
|
710 | 714 | |
|
711 | 715 | <%def name="render_hunk_lines(diff_mode, hunk, use_comments, inline_comments)"> |
|
712 | 716 | % if diff_mode == 'unified': |
|
713 | 717 | ${render_hunk_lines_unified(hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
714 | 718 | % elif diff_mode == 'sideside': |
|
715 | 719 | ${render_hunk_lines_sideside(hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
716 | 720 | % else: |
|
717 | 721 | <tr class="cb-line"> |
|
718 | 722 | <td>unknown diff mode</td> |
|
719 | 723 | </tr> |
|
720 | 724 | % endif |
|
721 | 725 | </%def> |
|
722 | 726 | |
|
723 | 727 | |
|
724 | 728 | <%def name="render_add_comment_button()"> |
|
725 | 729 | <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)"> |
|
726 | 730 | <span><i class="icon-comment"></i></span> |
|
727 | 731 | </button> |
|
728 | 732 | </%def> |
|
729 | 733 | |
|
730 | <%def name="render_diffset_menu()"> | |
|
734 | <%def name="render_diffset_menu(diffset=None)"> | |
|
731 | 735 | |
|
732 | 736 | <div class="diffset-menu clearinner"> |
|
733 | 737 | <div class="pull-right"> |
|
734 | 738 | <div class="btn-group"> |
|
735 | 739 | |
|
736 | 740 | <a |
|
737 | 741 | class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-primary')} tooltip" |
|
738 | 742 | title="${h.tooltip(_('View side by side'))}" |
|
739 | 743 | href="${h.current_route_path(request, diffmode='sideside')}"> |
|
740 | 744 | <span>${_('Side by Side')}</span> |
|
741 | 745 | </a> |
|
742 | 746 | <a |
|
743 | 747 | class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-primary')} tooltip" |
|
744 | 748 | title="${h.tooltip(_('View unified'))}" href="${h.current_route_path(request, diffmode='unified')}"> |
|
745 | 749 | <span>${_('Unified')}</span> |
|
746 | 750 | </a> |
|
747 | 751 | </div> |
|
748 | 752 | </div> |
|
749 | 753 | |
|
750 | 754 | <div class="pull-left"> |
|
751 | 755 | <div class="btn-group"> |
|
756 | <div class="pull-left"> | |
|
757 | ${h.hidden('file_filter')} | |
|
758 | </div> | |
|
752 | 759 | <a |
|
753 | 760 | class="btn" |
|
754 | 761 | href="#" |
|
755 | 762 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a> |
|
756 | 763 | <a |
|
757 | 764 | class="btn" |
|
758 | 765 | href="#" |
|
759 | 766 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a> |
|
760 | 767 | <a |
|
761 | 768 | class="btn" |
|
762 | 769 | href="#" |
|
763 | 770 | onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a> |
|
771 | ||
|
764 | 772 | </div> |
|
765 | 773 | </div> |
|
766 | 774 | </div> |
|
775 | ||
|
776 | % if diffset: | |
|
777 | ||
|
778 | %if diffset.limited_diff: | |
|
779 | <% file_placeholder = _ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}%> | |
|
780 | %else: | |
|
781 | <% file_placeholder = _ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}%> | |
|
782 | %endif | |
|
783 | ||
|
784 | <script> | |
|
785 | ||
|
786 | var feedFilesOptions = function (query, initialData) { | |
|
787 | var data = {results: []}; | |
|
788 | var isQuery = typeof query.term !== 'undefined'; | |
|
789 | ||
|
790 | var section = _gettext('Changed files'); | |
|
791 | var filteredData = []; | |
|
792 | ||
|
793 | //filter results | |
|
794 | $.each(initialData.results, function (idx, value) { | |
|
795 | ||
|
796 | if (!isQuery || query.term.length === 0 || value.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { | |
|
797 | filteredData.push({ | |
|
798 | 'id': this.id, | |
|
799 | 'text': this.text, | |
|
800 | "ops": this.ops, | |
|
801 | }) | |
|
802 | } | |
|
803 | ||
|
804 | }); | |
|
805 | ||
|
806 | data.results = filteredData; | |
|
807 | ||
|
808 | query.callback(data); | |
|
809 | }; | |
|
810 | ||
|
811 | var formatFileResult = function(result, container, query, escapeMarkup) { | |
|
812 | return function(data, escapeMarkup) { | |
|
813 | var container = '<div class="filelist" style="padding-right:100px">{0}</div>'; | |
|
814 | var tmpl = '<span style="margin-right:-50px"><strong>{0}</strong></span>'.format(escapeMarkup(data['text'])); | |
|
815 | var pill = '<span class="pill-group" style="float: right;margin-right: -100px">' + | |
|
816 | '<span class="pill" op="added">{0}</span>' + | |
|
817 | '<span class="pill" op="deleted">{1}</span>' + | |
|
818 | '</span>' | |
|
819 | ; | |
|
820 | var added = data['ops']['added']; | |
|
821 | if (added === 0) { | |
|
822 | // don't show +0 | |
|
823 | added = 0; | |
|
824 | } else { | |
|
825 | added = '+' + added; | |
|
826 | } | |
|
827 | ||
|
828 | var deleted = -1*data['ops']['deleted']; | |
|
829 | ||
|
830 | tmpl += pill.format(added, deleted); | |
|
831 | return container.format(tmpl); | |
|
832 | ||
|
833 | }(result, escapeMarkup); | |
|
834 | }; | |
|
835 | var preloadData = { | |
|
836 | results: [ | |
|
837 | % for filediff in diffset.files: | |
|
838 | {id:"a_${h.FID('', filediff.patch['filename'])}", | |
|
839 | text:"${filediff.patch['filename']}", | |
|
840 | ops:${h.json.dumps(filediff.patch['stats'])|n}}${('' if loop.last else ',')} | |
|
841 | % endfor | |
|
842 | ] | |
|
843 | }; | |
|
844 | ||
|
845 | $("#file_filter").select2({ | |
|
846 | 'dropdownAutoWidth': true, | |
|
847 | 'width': 'auto', | |
|
848 | 'placeholder': "${file_placeholder}", | |
|
849 | containerCssClass: "drop-menu", | |
|
850 | dropdownCssClass: "drop-menu-dropdown", | |
|
851 | data: preloadData, | |
|
852 | query: function(query) { | |
|
853 | feedFilesOptions(query, preloadData); | |
|
854 | }, | |
|
855 | formatResult: formatFileResult | |
|
856 | }); | |
|
857 | ||
|
858 | $("#file_filter").on('click', function (e) { | |
|
859 | e.preventDefault(); | |
|
860 | var selected = $('#file_filter').select2('data'); | |
|
861 | var idSelector = "#"+selected.id; | |
|
862 | window.location.hash = idSelector; | |
|
863 | // expand the container if we quick-select the field | |
|
864 | $(idSelector).prev().prop('checked', false); | |
|
865 | }) | |
|
866 | ||
|
867 | </script> | |
|
868 | % endif | |
|
869 | ||
|
767 | 870 | </%def> |
@@ -1,117 +1,117 b'' | |||
|
1 | 1 | ## Changesets table ! |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | %if c.ancestor: |
|
5 | 5 | <div class="ancestor">${_('Common Ancestor Commit')}: |
|
6 | 6 | <a href="${h.route_path('repo_commit', repo_name=c.repo_name, commit_id=c.ancestor)}"> |
|
7 | 7 | ${h.short_id(c.ancestor)} |
|
8 | 8 | </a>. ${_('Compare was calculated based on this shared commit.')} |
|
9 | 9 | <input id="common_ancestor" type="hidden" name="common_ancestor" value="${c.ancestor}"> |
|
10 | 10 | </div> |
|
11 | 11 | %endif |
|
12 | 12 | |
|
13 | 13 | <div class="container"> |
|
14 | 14 | <input type="hidden" name="__start__" value="revisions:sequence"> |
|
15 | 15 | <table class="rctable compare_view_commits"> |
|
16 | 16 | <tr> |
|
17 | 17 | <th>${_('Time')}</th> |
|
18 | 18 | <th>${_('Author')}</th> |
|
19 | 19 | <th>${_('Commit')}</th> |
|
20 | 20 | <th></th> |
|
21 | 21 | <th>${_('Description')}</th> |
|
22 | 22 | </tr> |
|
23 | 23 | ## to speed up lookups cache some functions before the loop |
|
24 | 24 | <% |
|
25 | 25 | active_patterns = h.get_active_pattern_entries(c.repo_name) |
|
26 | 26 | urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns) |
|
27 | 27 | %> |
|
28 | 28 | %for commit in c.commit_ranges: |
|
29 | 29 | <tr id="row-${commit.raw_id}" |
|
30 | 30 | commit_id="${commit.raw_id}" |
|
31 | 31 | class="compare_select" |
|
32 | 32 | style="${'display: none' if c.collapse_all_commits else ''}" |
|
33 | 33 | > |
|
34 | 34 | <td class="td-time"> |
|
35 | 35 | ${h.age_component(commit.date)} |
|
36 | 36 | </td> |
|
37 | 37 | <td class="td-user"> |
|
38 | 38 | ${base.gravatar_with_user(commit.author, 16)} |
|
39 | 39 | </td> |
|
40 | 40 | <td class="td-hash"> |
|
41 | 41 | <code> |
|
42 | 42 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
43 |
r${commit. |
|
|
43 | r${commit.idx}:${h.short_id(commit.raw_id)} | |
|
44 | 44 | </a> |
|
45 | 45 | ${h.hidden('revisions',commit.raw_id)} |
|
46 | 46 | </code> |
|
47 | 47 | </td> |
|
48 | 48 | <td class="expand_commit" |
|
49 | 49 | data-commit-id="${commit.raw_id}" |
|
50 | 50 | title="${_( 'Expand commit message')}" |
|
51 | 51 | > |
|
52 | 52 | <div class="show_more_col"> |
|
53 | 53 | <i class="show_more"></i> |
|
54 | 54 | </div> |
|
55 | 55 | </td> |
|
56 | 56 | <td class="mid td-description"> |
|
57 | 57 | <div class="log-container truncate-wrap"> |
|
58 | 58 | <div |
|
59 | 59 | id="c-${commit.raw_id}" |
|
60 | 60 | class="message truncate" |
|
61 | 61 | data-message-raw="${commit.message}" |
|
62 | 62 | > |
|
63 | 63 | ${urlify_commit_message(commit.message, c.repo_name)} |
|
64 | 64 | </div> |
|
65 | 65 | </div> |
|
66 | 66 | </td> |
|
67 | 67 | </tr> |
|
68 | 68 | %endfor |
|
69 | 69 | <tr class="compare_select_hidden" style="${'' if c.collapse_all_commits else 'display: none'}"> |
|
70 | 70 | <td colspan="5"> |
|
71 | 71 | ${_ungettext('%s commit hidden','%s commits hidden', len(c.commit_ranges)) % len(c.commit_ranges)}, |
|
72 | 72 | <a href="#" onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false">${_ungettext('show it','show them', len(c.commit_ranges))}</a> |
|
73 | 73 | </td> |
|
74 | 74 | </tr> |
|
75 | 75 | % if not c.commit_ranges: |
|
76 | 76 | <tr class="compare_select"> |
|
77 | 77 | <td colspan="5"> |
|
78 | 78 | ${_('No commits in this compare')} |
|
79 | 79 | </td> |
|
80 | 80 | </tr> |
|
81 | 81 | % endif |
|
82 | 82 | </table> |
|
83 | 83 | <input type="hidden" name="__end__" value="revisions:sequence"> |
|
84 | 84 | |
|
85 | 85 | </div> |
|
86 | 86 | |
|
87 | 87 | <script> |
|
88 | 88 | $('.expand_commit').on('click',function(e){ |
|
89 | 89 | var target_expand = $(this); |
|
90 | 90 | var cid = target_expand.data('commitId'); |
|
91 | 91 | |
|
92 | 92 | // ## TODO: dan: extract styles into css, and just toggleClass('open') here |
|
93 | 93 | if (target_expand.hasClass('open')){ |
|
94 | 94 | $('#c-'+cid).css({ |
|
95 | 95 | 'height': '1.5em', |
|
96 | 96 | 'white-space': 'nowrap', |
|
97 | 97 | 'text-overflow': 'ellipsis', |
|
98 | 98 | 'overflow':'hidden' |
|
99 | 99 | }); |
|
100 | 100 | target_expand.removeClass('open'); |
|
101 | 101 | } |
|
102 | 102 | else { |
|
103 | 103 | $('#c-'+cid).css({ |
|
104 | 104 | 'height': 'auto', |
|
105 | 105 | 'white-space': 'pre-line', |
|
106 | 106 | 'text-overflow': 'initial', |
|
107 | 107 | 'overflow':'visible' |
|
108 | 108 | }); |
|
109 | 109 | target_expand.addClass('open'); |
|
110 | 110 | } |
|
111 | 111 | }); |
|
112 | 112 | |
|
113 | 113 | $('.compare_select').on('click',function(e){ |
|
114 | 114 | var cid = $(this).attr('commit_id'); |
|
115 | 115 | $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl')); |
|
116 | 116 | }); |
|
117 | 117 | </script> |
@@ -1,333 +1,333 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="title()"> |
|
6 | 6 | %if c.compare_home: |
|
7 | 7 | ${_('%s Compare') % c.repo_name} |
|
8 | 8 | %else: |
|
9 | 9 | ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} > ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)} |
|
10 | 10 | %endif |
|
11 | 11 | %if c.rhodecode_name: |
|
12 | 12 | · ${h.branding(c.rhodecode_name)} |
|
13 | 13 | %endif |
|
14 | 14 | </%def> |
|
15 | 15 | |
|
16 | 16 | <%def name="breadcrumbs_links()"> |
|
17 | 17 | ${_ungettext('%s commit','%s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
18 | 18 | </%def> |
|
19 | 19 | |
|
20 | 20 | <%def name="menu_bar_nav()"> |
|
21 | 21 | ${self.menu_items(active='repositories')} |
|
22 | 22 | </%def> |
|
23 | 23 | |
|
24 | 24 | <%def name="menu_bar_subnav()"> |
|
25 | 25 | ${self.repo_menu(active='compare')} |
|
26 | 26 | </%def> |
|
27 | 27 | |
|
28 | 28 | <%def name="main()"> |
|
29 | 29 | <script type="text/javascript"> |
|
30 | 30 | // set fake commitId on this commit-range page |
|
31 | 31 | templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}"; |
|
32 | 32 | </script> |
|
33 | 33 | |
|
34 | 34 | <div class="box"> |
|
35 | 35 | <div class="title"> |
|
36 | 36 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
37 | 37 | </div> |
|
38 | 38 | |
|
39 | 39 | <div class="summary changeset"> |
|
40 | 40 | <div class="summary-detail"> |
|
41 | 41 | <div class="summary-detail-header"> |
|
42 | 42 | <span class="breadcrumbs files_location"> |
|
43 | 43 | <h4> |
|
44 | 44 | ${_('Compare Commits')} |
|
45 | 45 | % if c.file_path: |
|
46 | 46 | ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a> |
|
47 | 47 | % endif |
|
48 | 48 | |
|
49 | 49 | % if c.commit_ranges: |
|
50 | 50 | <code> |
|
51 | 51 | r${c.source_commit.revision}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.revision}:${h.short_id(c.target_commit.raw_id)} |
|
52 | 52 | </code> |
|
53 | 53 | % endif |
|
54 | 54 | </h4> |
|
55 | 55 | </span> |
|
56 | 56 | </div> |
|
57 | 57 | |
|
58 | 58 | <div class="fieldset"> |
|
59 | 59 | <div class="left-label"> |
|
60 | 60 | ${_('Target')}: |
|
61 | 61 | </div> |
|
62 | 62 | <div class="right-content"> |
|
63 | 63 | <div> |
|
64 | 64 | <div class="code-header" > |
|
65 | 65 | <div class="compare_header"> |
|
66 | 66 | ## The hidden elements are replaced with a select2 widget |
|
67 | 67 | ${h.hidden('compare_source')} |
|
68 | 68 | </div> |
|
69 | 69 | </div> |
|
70 | 70 | </div> |
|
71 | 71 | </div> |
|
72 | 72 | </div> |
|
73 | 73 | |
|
74 | 74 | <div class="fieldset"> |
|
75 | 75 | <div class="left-label"> |
|
76 | 76 | ${_('Source')}: |
|
77 | 77 | </div> |
|
78 | 78 | <div class="right-content"> |
|
79 | 79 | <div> |
|
80 | 80 | <div class="code-header" > |
|
81 | 81 | <div class="compare_header"> |
|
82 | 82 | ## The hidden elements are replaced with a select2 widget |
|
83 | 83 | ${h.hidden('compare_target')} |
|
84 | 84 | </div> |
|
85 | 85 | </div> |
|
86 | 86 | </div> |
|
87 | 87 | </div> |
|
88 | 88 | </div> |
|
89 | 89 | |
|
90 | 90 | <div class="fieldset"> |
|
91 | 91 | <div class="left-label"> |
|
92 | 92 | ${_('Actions')}: |
|
93 | 93 | </div> |
|
94 | 94 | <div class="right-content"> |
|
95 | 95 | <div> |
|
96 | 96 | <div class="code-header" > |
|
97 | 97 | <div class="compare_header"> |
|
98 | 98 | |
|
99 | 99 | <div class="compare-buttons"> |
|
100 | 100 | % if c.compare_home: |
|
101 | 101 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
102 | 102 | |
|
103 | 103 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
104 | 104 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
105 | 105 | <div id="changeset_compare_view_content"> |
|
106 | 106 | <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div> |
|
107 | 107 | </div> |
|
108 | 108 | |
|
109 | 109 | % elif c.preview_mode: |
|
110 | 110 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a> |
|
111 | 111 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
112 | 112 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
113 | 113 | |
|
114 | 114 | % else: |
|
115 | 115 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
116 | 116 | <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a> |
|
117 | 117 | |
|
118 | 118 | ## allow comment only if there are commits to comment on |
|
119 | 119 | % if c.diffset and c.diffset.files and c.commit_ranges: |
|
120 | 120 | <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a> |
|
121 | 121 | % else: |
|
122 | 122 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
123 | 123 | % endif |
|
124 | 124 | % endif |
|
125 | 125 | </div> |
|
126 | 126 | </div> |
|
127 | 127 | </div> |
|
128 | 128 | </div> |
|
129 | 129 | </div> |
|
130 | 130 | </div> |
|
131 | 131 | |
|
132 | 132 | <%doc> |
|
133 | 133 | ##TODO(marcink): implement this and diff menus |
|
134 | 134 | <div class="fieldset"> |
|
135 | 135 | <div class="left-label"> |
|
136 | 136 | ${_('Diff options')}: |
|
137 | 137 | </div> |
|
138 | 138 | <div class="right-content"> |
|
139 | 139 | <div class="diff-actions"> |
|
140 | 140 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
141 | 141 | ${_('Raw Diff')} |
|
142 | 142 | </a> |
|
143 | 143 | | |
|
144 | 144 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id='?')}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
145 | 145 | ${_('Patch Diff')} |
|
146 | 146 | </a> |
|
147 | 147 | | |
|
148 | 148 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id='?',_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
149 | 149 | ${_('Download Diff')} |
|
150 | 150 | </a> |
|
151 | 151 | </div> |
|
152 | 152 | </div> |
|
153 | 153 | </div> |
|
154 | 154 | </%doc> |
|
155 | 155 | |
|
156 | 156 | ## commit status form |
|
157 | 157 | <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;"> |
|
158 | 158 | <div class="left-label"> |
|
159 | 159 | ${_('Commit status')}: |
|
160 | 160 | </div> |
|
161 | 161 | <div class="right-content"> |
|
162 | 162 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
163 | 163 | ## main comment form and it status |
|
164 | 164 | <% |
|
165 | 165 | def revs(_revs): |
|
166 | 166 | form_inputs = [] |
|
167 | 167 | for cs in _revs: |
|
168 | 168 | tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id} |
|
169 | 169 | form_inputs.append(tmpl) |
|
170 | 170 | return form_inputs |
|
171 | 171 | %> |
|
172 | 172 | <div> |
|
173 | 173 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))} |
|
174 | 174 | </div> |
|
175 | 175 | </div> |
|
176 | 176 | </div> |
|
177 | 177 | |
|
178 | 178 | </div> <!-- end summary-detail --> |
|
179 | 179 | </div> <!-- end summary --> |
|
180 | 180 | |
|
181 | 181 | ## use JS script to load it quickly before potentially large diffs render long time |
|
182 | 182 | ## this prevents from situation when large diffs block rendering of select2 fields |
|
183 | 183 | <script type="text/javascript"> |
|
184 | 184 | |
|
185 | 185 | var cache = {}; |
|
186 | 186 | |
|
187 | 187 | var formatSelection = function(repoName){ |
|
188 | 188 | return function(data, container, escapeMarkup) { |
|
189 | 189 | var selection = data ? this.text(data) : ""; |
|
190 | 190 | return escapeMarkup('{0}@{1}'.format(repoName, selection)); |
|
191 | 191 | } |
|
192 | 192 | }; |
|
193 | 193 | |
|
194 | 194 | var feedCompareData = function(query, cachedValue){ |
|
195 | 195 | var data = {results: []}; |
|
196 | 196 | //filter results |
|
197 | 197 | $.each(cachedValue.results, function() { |
|
198 | 198 | var section = this.text; |
|
199 | 199 | var children = []; |
|
200 | 200 | $.each(this.children, function() { |
|
201 | 201 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { |
|
202 | 202 | children.push({ |
|
203 | 203 | 'id': this.id, |
|
204 | 204 | 'text': this.text, |
|
205 | 205 | 'type': this.type |
|
206 | 206 | }) |
|
207 | 207 | } |
|
208 | 208 | }); |
|
209 | 209 | data.results.push({ |
|
210 | 210 | 'text': section, |
|
211 | 211 | 'children': children |
|
212 | 212 | }) |
|
213 | 213 | }); |
|
214 | 214 | //push the typed in changeset |
|
215 | 215 | data.results.push({ |
|
216 | 216 | 'text': _gettext('specify commit'), |
|
217 | 217 | 'children': [{ |
|
218 | 218 | 'id': query.term, |
|
219 | 219 | 'text': query.term, |
|
220 | 220 | 'type': 'rev' |
|
221 | 221 | }] |
|
222 | 222 | }); |
|
223 | 223 | query.callback(data); |
|
224 | 224 | }; |
|
225 | 225 | |
|
226 | 226 | var loadCompareData = function(repoName, query, cache){ |
|
227 | 227 | $.ajax({ |
|
228 | 228 | url: pyroutes.url('repo_refs_data', {'repo_name': repoName}), |
|
229 | 229 | data: {}, |
|
230 | 230 | dataType: 'json', |
|
231 | 231 | type: 'GET', |
|
232 | 232 | success: function(data) { |
|
233 | 233 | cache[repoName] = data; |
|
234 | 234 | query.callback({results: data.results}); |
|
235 | 235 | } |
|
236 | 236 | }) |
|
237 | 237 | }; |
|
238 | 238 | |
|
239 | 239 | var enable_fields = ${"false" if c.preview_mode else "true"}; |
|
240 | 240 | $("#compare_source").select2({ |
|
241 | 241 | placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}", |
|
242 | 242 | containerCssClass: "drop-menu", |
|
243 | 243 | dropdownCssClass: "drop-menu-dropdown", |
|
244 | 244 | formatSelection: formatSelection("${c.source_repo.repo_name}"), |
|
245 | 245 | dropdownAutoWidth: true, |
|
246 | 246 | query: function(query) { |
|
247 | 247 | var repoName = '${c.source_repo.repo_name}'; |
|
248 | 248 | var cachedValue = cache[repoName]; |
|
249 | 249 | |
|
250 | 250 | if (cachedValue){ |
|
251 | 251 | feedCompareData(query, cachedValue); |
|
252 | 252 | } |
|
253 | 253 | else { |
|
254 | 254 | loadCompareData(repoName, query, cache); |
|
255 | 255 | } |
|
256 | 256 | } |
|
257 | 257 | }).select2("enable", enable_fields); |
|
258 | 258 | |
|
259 | 259 | $("#compare_target").select2({ |
|
260 | 260 | placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}", |
|
261 | 261 | dropdownAutoWidth: true, |
|
262 | 262 | containerCssClass: "drop-menu", |
|
263 | 263 | dropdownCssClass: "drop-menu-dropdown", |
|
264 | 264 | formatSelection: formatSelection("${c.target_repo.repo_name}"), |
|
265 | 265 | query: function(query) { |
|
266 | 266 | var repoName = '${c.target_repo.repo_name}'; |
|
267 | 267 | var cachedValue = cache[repoName]; |
|
268 | 268 | |
|
269 | 269 | if (cachedValue){ |
|
270 | 270 | feedCompareData(query, cachedValue); |
|
271 | 271 | } |
|
272 | 272 | else { |
|
273 | 273 | loadCompareData(repoName, query, cache); |
|
274 | 274 | } |
|
275 | 275 | } |
|
276 | 276 | }).select2("enable", enable_fields); |
|
277 | 277 | var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"}; |
|
278 | 278 | var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"}; |
|
279 | 279 | |
|
280 | 280 | $('#compare_revs').on('click', function(e) { |
|
281 | 281 | var source = $('#compare_source').select2('data') || initial_compare_source; |
|
282 | 282 | var target = $('#compare_target').select2('data') || initial_compare_target; |
|
283 | 283 | if (source && target) { |
|
284 | 284 | var url_data = { |
|
285 | 285 | repo_name: "${c.repo_name}", |
|
286 | 286 | source_ref: source.id, |
|
287 | 287 | source_ref_type: source.type, |
|
288 | 288 | target_ref: target.id, |
|
289 | 289 | target_ref_type: target.type |
|
290 | 290 | }; |
|
291 | 291 | window.location = pyroutes.url('repo_compare', url_data); |
|
292 | 292 | } |
|
293 | 293 | }); |
|
294 | 294 | $('#compare_changeset_status_toggle').on('click', function(e) { |
|
295 | 295 | $('#compare_changeset_status').toggle(); |
|
296 | 296 | }); |
|
297 | 297 | |
|
298 | 298 | </script> |
|
299 | 299 | |
|
300 | 300 | ## table diff data |
|
301 | 301 | <div class="table"> |
|
302 | 302 | |
|
303 | 303 | |
|
304 | 304 | % if not c.compare_home: |
|
305 | 305 | <div id="changeset_compare_view_content"> |
|
306 | 306 | <div class="pull-left"> |
|
307 | 307 | <div class="btn-group"> |
|
308 | 308 | <a |
|
309 | 309 | class="btn" |
|
310 | 310 | href="#" |
|
311 | 311 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
312 | 312 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
313 | 313 | </a> |
|
314 | 314 | <a |
|
315 | 315 | class="btn" |
|
316 | 316 | href="#" |
|
317 | 317 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
318 | 318 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
319 | 319 | </a> |
|
320 | 320 | </div> |
|
321 | 321 | </div> |
|
322 | 322 | <div style="padding:0 10px 10px 0px" class="pull-left"></div> |
|
323 | 323 | ## commit compare generated below |
|
324 | 324 | <%include file="compare_commits.mako"/> |
|
325 | ${cbdiffs.render_diffset_menu()} | |
|
325 | ${cbdiffs.render_diffset_menu(c.diffset)} | |
|
326 | 326 | ${cbdiffs.render_diffset(c.diffset)} |
|
327 | 327 | </div> |
|
328 | 328 | % endif |
|
329 | 329 | |
|
330 | 330 | </div> |
|
331 | 331 | </div> |
|
332 | 332 | |
|
333 | </%def> No newline at end of file | |
|
333 | </%def> |
@@ -1,859 +1,859 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="title()"> |
|
6 | 6 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} |
|
7 | 7 | %if c.rhodecode_name: |
|
8 | 8 | · ${h.branding(c.rhodecode_name)} |
|
9 | 9 | %endif |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="breadcrumbs_links()"> |
|
13 | 13 | <span id="pr-title"> |
|
14 | 14 | ${c.pull_request.title} |
|
15 | 15 | %if c.pull_request.is_closed(): |
|
16 | 16 | (${_('Closed')}) |
|
17 | 17 | %endif |
|
18 | 18 | </span> |
|
19 | 19 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
20 | 20 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} |
|
21 | 21 | </div> |
|
22 | 22 | </%def> |
|
23 | 23 | |
|
24 | 24 | <%def name="menu_bar_nav()"> |
|
25 | 25 | ${self.menu_items(active='repositories')} |
|
26 | 26 | </%def> |
|
27 | 27 | |
|
28 | 28 | <%def name="menu_bar_subnav()"> |
|
29 | 29 | ${self.repo_menu(active='showpullrequest')} |
|
30 | 30 | </%def> |
|
31 | 31 | |
|
32 | 32 | <%def name="main()"> |
|
33 | 33 | |
|
34 | 34 | <script type="text/javascript"> |
|
35 | 35 | // TODO: marcink switch this to pyroutes |
|
36 | 36 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; |
|
37 | 37 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
38 | 38 | </script> |
|
39 | 39 | <div class="box"> |
|
40 | 40 | |
|
41 | 41 | <div class="title"> |
|
42 | 42 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
43 | 43 | </div> |
|
44 | 44 | |
|
45 | 45 | ${self.breadcrumbs()} |
|
46 | 46 | |
|
47 | 47 | <div class="box pr-summary"> |
|
48 | 48 | |
|
49 | 49 | <div class="summary-details block-left"> |
|
50 | 50 | <% summary = lambda n:{False:'summary-short'}.get(n) %> |
|
51 | 51 | <div class="pr-details-title"> |
|
52 | 52 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
53 | 53 | %if c.allowed_to_update: |
|
54 | 54 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> |
|
55 | 55 | % if c.allowed_to_delete: |
|
56 | 56 | ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)} |
|
57 | 57 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), |
|
58 | 58 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} |
|
59 | 59 | ${h.end_form()} |
|
60 | 60 | % else: |
|
61 | 61 | ${_('Delete')} |
|
62 | 62 | % endif |
|
63 | 63 | </div> |
|
64 | 64 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> |
|
65 | 65 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> |
|
66 | 66 | %endif |
|
67 | 67 | </div> |
|
68 | 68 | |
|
69 | 69 | <div id="summary" class="fields pr-details-content"> |
|
70 | 70 | <div class="field"> |
|
71 | 71 | <div class="label-summary"> |
|
72 | 72 | <label>${_('Source')}:</label> |
|
73 | 73 | </div> |
|
74 | 74 | <div class="input"> |
|
75 | 75 | <div class="pr-origininfo"> |
|
76 | 76 | ## branch link is only valid if it is a branch |
|
77 | 77 | <span class="tag"> |
|
78 | 78 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
79 | 79 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> |
|
80 | 80 | %else: |
|
81 | 81 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
82 | 82 | %endif |
|
83 | 83 | </span> |
|
84 | 84 | <span class="clone-url"> |
|
85 | 85 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
86 | 86 | </span> |
|
87 | 87 | <br/> |
|
88 | 88 | % if c.ancestor_commit: |
|
89 | 89 | ${_('Common ancestor')}: |
|
90 | 90 | <code><a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
91 | 91 | % endif |
|
92 | 92 | </div> |
|
93 | 93 | %if h.is_hg(c.pull_request.source_repo): |
|
94 | 94 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
95 | 95 | %elif h.is_git(c.pull_request.source_repo): |
|
96 | 96 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
97 | 97 | %endif |
|
98 | 98 | |
|
99 | 99 | <div class=""> |
|
100 | 100 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> |
|
101 | 101 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> |
|
102 | 102 | </div> |
|
103 | 103 | |
|
104 | 104 | </div> |
|
105 | 105 | </div> |
|
106 | 106 | <div class="field"> |
|
107 | 107 | <div class="label-summary"> |
|
108 | 108 | <label>${_('Target')}:</label> |
|
109 | 109 | </div> |
|
110 | 110 | <div class="input"> |
|
111 | 111 | <div class="pr-targetinfo"> |
|
112 | 112 | ## branch link is only valid if it is a branch |
|
113 | 113 | <span class="tag"> |
|
114 | 114 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
115 | 115 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
116 | 116 | %else: |
|
117 | 117 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
118 | 118 | %endif |
|
119 | 119 | </span> |
|
120 | 120 | <span class="clone-url"> |
|
121 | 121 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
122 | 122 | </span> |
|
123 | 123 | </div> |
|
124 | 124 | </div> |
|
125 | 125 | </div> |
|
126 | 126 | |
|
127 | 127 | ## Link to the shadow repository. |
|
128 | 128 | <div class="field"> |
|
129 | 129 | <div class="label-summary"> |
|
130 | 130 | <label>${_('Merge')}:</label> |
|
131 | 131 | </div> |
|
132 | 132 | <div class="input"> |
|
133 | 133 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
134 | 134 | %if h.is_hg(c.pull_request.target_repo): |
|
135 | 135 | <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
136 | 136 | %elif h.is_git(c.pull_request.target_repo): |
|
137 | 137 | <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
138 | 138 | %endif |
|
139 | 139 | <div class=""> |
|
140 | 140 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> |
|
141 | 141 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> |
|
142 | 142 | </div> |
|
143 | 143 | % else: |
|
144 | 144 | <div class=""> |
|
145 | 145 | ${_('Shadow repository data not available')}. |
|
146 | 146 | </div> |
|
147 | 147 | % endif |
|
148 | 148 | </div> |
|
149 | 149 | </div> |
|
150 | 150 | |
|
151 | 151 | <div class="field"> |
|
152 | 152 | <div class="label-summary"> |
|
153 | 153 | <label>${_('Review')}:</label> |
|
154 | 154 | </div> |
|
155 | 155 | <div class="input"> |
|
156 | 156 | %if c.pull_request_review_status: |
|
157 | 157 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
158 | 158 | <span class="changeset-status-lbl tooltip"> |
|
159 | 159 | %if c.pull_request.is_closed(): |
|
160 | 160 | ${_('Closed')}, |
|
161 | 161 | %endif |
|
162 | 162 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
163 | 163 | </span> |
|
164 | 164 | - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
165 | 165 | %endif |
|
166 | 166 | </div> |
|
167 | 167 | </div> |
|
168 | 168 | <div class="field"> |
|
169 | 169 | <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}"> |
|
170 | 170 | <label>${_('Description')}:</label> |
|
171 | 171 | </div> |
|
172 | 172 | <div id="pr-desc" class="input"> |
|
173 | 173 | <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer)}</div> |
|
174 | 174 | </div> |
|
175 | 175 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
176 | 176 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> |
|
177 | 177 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} |
|
178 | 178 | </div> |
|
179 | 179 | </div> |
|
180 | 180 | |
|
181 | 181 | <div class="field"> |
|
182 | 182 | <div class="label-summary"> |
|
183 | 183 | <label>${_('Versions')}:</label> |
|
184 | 184 | </div> |
|
185 | 185 | |
|
186 | 186 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> |
|
187 | 187 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> |
|
188 | 188 | |
|
189 | 189 | <div class="pr-versions"> |
|
190 | 190 | % if c.show_version_changes: |
|
191 | 191 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> |
|
192 | 192 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> |
|
193 | 193 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
194 | 194 | data-toggle-on="${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
195 | 195 | data-toggle-off="${_('Hide all versions of this pull request')}"> |
|
196 | 196 | ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
197 | 197 | </a> |
|
198 | 198 | <table> |
|
199 | 199 | ## SHOW ALL VERSIONS OF PR |
|
200 | 200 | <% ver_pr = None %> |
|
201 | 201 | |
|
202 | 202 | % for data in reversed(list(enumerate(c.versions, 1))): |
|
203 | 203 | <% ver_pos = data[0] %> |
|
204 | 204 | <% ver = data[1] %> |
|
205 | 205 | <% ver_pr = ver.pull_request_version_id %> |
|
206 | 206 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> |
|
207 | 207 | |
|
208 | 208 | <tr class="version-pr" style="display: ${display_row}"> |
|
209 | 209 | <td> |
|
210 | 210 | <code> |
|
211 | 211 | <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a> |
|
212 | 212 | </code> |
|
213 | 213 | </td> |
|
214 | 214 | <td> |
|
215 | 215 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
216 | 216 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
217 | 217 | </td> |
|
218 | 218 | <td> |
|
219 | 219 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> |
|
220 | 220 | <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}"> |
|
221 | 221 | </div> |
|
222 | 222 | </td> |
|
223 | 223 | <td> |
|
224 | 224 | % if c.at_version_num != ver_pr: |
|
225 | 225 | <i class="icon-comment"></i> |
|
226 | 226 | <code class="tooltip" title="${_('Comment from pull request version v{0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
227 | 227 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} |
|
228 | 228 | </code> |
|
229 | 229 | % endif |
|
230 | 230 | </td> |
|
231 | 231 | <td> |
|
232 | 232 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> |
|
233 | 233 | </td> |
|
234 | 234 | <td> |
|
235 | 235 | ${h.age_component(ver.updated_on, time_is_local=True)} |
|
236 | 236 | </td> |
|
237 | 237 | </tr> |
|
238 | 238 | % endfor |
|
239 | 239 | |
|
240 | 240 | <tr> |
|
241 | 241 | <td colspan="6"> |
|
242 | 242 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" |
|
243 | 243 | data-label-text-locked="${_('select versions to show changes')}" |
|
244 | 244 | data-label-text-diff="${_('show changes between versions')}" |
|
245 | 245 | data-label-text-show="${_('show pull request for this version')}" |
|
246 | 246 | > |
|
247 | 247 | ${_('select versions to show changes')} |
|
248 | 248 | </button> |
|
249 | 249 | </td> |
|
250 | 250 | </tr> |
|
251 | 251 | |
|
252 | 252 | ## show comment/inline comments summary |
|
253 | 253 | <%def name="comments_summary()"> |
|
254 | 254 | <tr> |
|
255 | 255 | <td colspan="6" class="comments-summary-td"> |
|
256 | 256 | |
|
257 | 257 | % if c.at_version: |
|
258 | 258 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> |
|
259 | 259 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> |
|
260 | 260 | ${_('Comments at this version')}: |
|
261 | 261 | % else: |
|
262 | 262 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> |
|
263 | 263 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> |
|
264 | 264 | ${_('Comments for this pull request')}: |
|
265 | 265 | % endif |
|
266 | 266 | |
|
267 | 267 | |
|
268 | 268 | %if general_comm_count_ver: |
|
269 | 269 | <a href="#comments">${_("%d General ") % general_comm_count_ver}</a> |
|
270 | 270 | %else: |
|
271 | 271 | ${_("%d General ") % general_comm_count_ver} |
|
272 | 272 | %endif |
|
273 | 273 | |
|
274 | 274 | %if inline_comm_count_ver: |
|
275 | 275 | , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a> |
|
276 | 276 | %else: |
|
277 | 277 | , ${_("%d Inline") % inline_comm_count_ver} |
|
278 | 278 | %endif |
|
279 | 279 | |
|
280 | 280 | %if outdated_comm_count_ver: |
|
281 | 281 | , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a> |
|
282 | 282 | <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a> |
|
283 | 283 | <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a> |
|
284 | 284 | %else: |
|
285 | 285 | , ${_("%d Outdated") % outdated_comm_count_ver} |
|
286 | 286 | %endif |
|
287 | 287 | </td> |
|
288 | 288 | </tr> |
|
289 | 289 | </%def> |
|
290 | 290 | ${comments_summary()} |
|
291 | 291 | </table> |
|
292 | 292 | % else: |
|
293 | 293 | <div class="input"> |
|
294 | 294 | ${_('Pull request versions not available')}. |
|
295 | 295 | </div> |
|
296 | 296 | <div> |
|
297 | 297 | <table> |
|
298 | 298 | ${comments_summary()} |
|
299 | 299 | </table> |
|
300 | 300 | </div> |
|
301 | 301 | % endif |
|
302 | 302 | </div> |
|
303 | 303 | </div> |
|
304 | 304 | |
|
305 | 305 | <div id="pr-save" class="field" style="display: none;"> |
|
306 | 306 | <div class="label-summary"></div> |
|
307 | 307 | <div class="input"> |
|
308 | 308 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
309 | 309 | </div> |
|
310 | 310 | </div> |
|
311 | 311 | </div> |
|
312 | 312 | </div> |
|
313 | 313 | <div> |
|
314 | 314 | ## AUTHOR |
|
315 | 315 | <div class="reviewers-title block-right"> |
|
316 | 316 | <div class="pr-details-title"> |
|
317 | 317 | ${_('Author of this pull request')} |
|
318 | 318 | </div> |
|
319 | 319 | </div> |
|
320 | 320 | <div class="block-right pr-details-content reviewers"> |
|
321 | 321 | <ul class="group_members"> |
|
322 | 322 | <li> |
|
323 | 323 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
324 | 324 | </li> |
|
325 | 325 | </ul> |
|
326 | 326 | </div> |
|
327 | 327 | |
|
328 | 328 | ## REVIEW RULES |
|
329 | 329 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> |
|
330 | 330 | <div class="pr-details-title"> |
|
331 | 331 | ${_('Reviewer rules')} |
|
332 | 332 | %if c.allowed_to_update: |
|
333 | 333 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> |
|
334 | 334 | %endif |
|
335 | 335 | </div> |
|
336 | 336 | <div class="pr-reviewer-rules"> |
|
337 | 337 | ## review rules will be appended here, by default reviewers logic |
|
338 | 338 | </div> |
|
339 | 339 | <input id="review_data" type="hidden" name="review_data" value=""> |
|
340 | 340 | </div> |
|
341 | 341 | |
|
342 | 342 | ## REVIEWERS |
|
343 | 343 | <div class="reviewers-title block-right"> |
|
344 | 344 | <div class="pr-details-title"> |
|
345 | 345 | ${_('Pull request reviewers')} |
|
346 | 346 | %if c.allowed_to_update: |
|
347 | 347 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> |
|
348 | 348 | %endif |
|
349 | 349 | </div> |
|
350 | 350 | </div> |
|
351 | 351 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
352 | 352 | |
|
353 | 353 | ## members redering block |
|
354 | 354 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
355 | 355 | <ul id="review_members" class="group_members"> |
|
356 | 356 | |
|
357 | 357 | % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers: |
|
358 | 358 | <script> |
|
359 | 359 | var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n}; |
|
360 | 360 | var status = "${(status[0][1].status if status else 'not_reviewed')}"; |
|
361 | 361 | var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}"; |
|
362 | 362 | var allowed_to_update = ${h.json.dumps(c.allowed_to_update)}; |
|
363 | 363 | |
|
364 | 364 | var entry = renderTemplate('reviewMemberEntry', { |
|
365 | 365 | 'member': member, |
|
366 | 366 | 'mandatory': member.mandatory, |
|
367 | 367 | 'reasons': member.reasons, |
|
368 | 368 | 'allowed_to_update': allowed_to_update, |
|
369 | 369 | 'review_status': status, |
|
370 | 370 | 'review_status_label': status_lbl, |
|
371 | 371 | 'user_group': member.user_group, |
|
372 | 372 | 'create': false |
|
373 | 373 | }); |
|
374 | 374 | $('#review_members').append(entry) |
|
375 | 375 | </script> |
|
376 | 376 | |
|
377 | 377 | % endfor |
|
378 | 378 | |
|
379 | 379 | </ul> |
|
380 | 380 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
381 | 381 | ## end members redering block |
|
382 | 382 | |
|
383 | 383 | %if not c.pull_request.is_closed(): |
|
384 | 384 | <div id="add_reviewer" class="ac" style="display: none;"> |
|
385 | 385 | %if c.allowed_to_update: |
|
386 | 386 | % if not c.forbid_adding_reviewers: |
|
387 | 387 | <div id="add_reviewer_input" class="reviewer_ac"> |
|
388 | 388 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} |
|
389 | 389 | <div id="reviewers_container"></div> |
|
390 | 390 | </div> |
|
391 | 391 | % endif |
|
392 | 392 | <div class="pull-right"> |
|
393 | 393 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> |
|
394 | 394 | </div> |
|
395 | 395 | %endif |
|
396 | 396 | </div> |
|
397 | 397 | %endif |
|
398 | 398 | </div> |
|
399 | 399 | </div> |
|
400 | 400 | </div> |
|
401 | 401 | <div class="box"> |
|
402 | 402 | ##DIFF |
|
403 | 403 | <div class="table" > |
|
404 | 404 | <div id="changeset_compare_view_content"> |
|
405 | 405 | ##CS |
|
406 | 406 | % if c.missing_requirements: |
|
407 | 407 | <div class="box"> |
|
408 | 408 | <div class="alert alert-warning"> |
|
409 | 409 | <div> |
|
410 | 410 | <strong>${_('Missing requirements:')}</strong> |
|
411 | 411 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
412 | 412 | </div> |
|
413 | 413 | </div> |
|
414 | 414 | </div> |
|
415 | 415 | % elif c.missing_commits: |
|
416 | 416 | <div class="box"> |
|
417 | 417 | <div class="alert alert-warning"> |
|
418 | 418 | <div> |
|
419 | 419 | <strong>${_('Missing commits')}:</strong> |
|
420 | 420 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
421 | 421 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
422 | 422 | ${_('Consider doing a {force_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n} |
|
423 | 423 | </div> |
|
424 | 424 | </div> |
|
425 | 425 | </div> |
|
426 | 426 | % endif |
|
427 | 427 | |
|
428 | 428 | <div class="compare_view_commits_title"> |
|
429 | 429 | % if not c.compare_mode: |
|
430 | 430 | |
|
431 | 431 | % if c.at_version_pos: |
|
432 | 432 | <h4> |
|
433 | 433 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} |
|
434 | 434 | </h4> |
|
435 | 435 | % endif |
|
436 | 436 | |
|
437 | 437 | <div class="pull-left"> |
|
438 | 438 | <div class="btn-group"> |
|
439 | 439 | <a |
|
440 | 440 | class="btn" |
|
441 | 441 | href="#" |
|
442 | 442 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
443 | 443 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
444 | 444 | </a> |
|
445 | 445 | <a |
|
446 | 446 | class="btn" |
|
447 | 447 | href="#" |
|
448 | 448 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
449 | 449 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
450 | 450 | </a> |
|
451 | 451 | </div> |
|
452 | 452 | </div> |
|
453 | 453 | |
|
454 | 454 | <div class="pull-right"> |
|
455 | 455 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
456 | 456 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> |
|
457 | 457 | % else: |
|
458 | 458 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> |
|
459 | 459 | % endif |
|
460 | 460 | |
|
461 | 461 | </div> |
|
462 | 462 | % endif |
|
463 | 463 | </div> |
|
464 | 464 | |
|
465 | 465 | % if not c.missing_commits: |
|
466 | 466 | % if c.compare_mode: |
|
467 | 467 | % if c.at_version: |
|
468 | 468 | <h4> |
|
469 | 469 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: |
|
470 | 470 | </h4> |
|
471 | 471 | |
|
472 | 472 | <div class="subtitle-compare"> |
|
473 | 473 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} |
|
474 | 474 | </div> |
|
475 | 475 | |
|
476 | 476 | <div class="container"> |
|
477 | 477 | <table class="rctable compare_view_commits"> |
|
478 | 478 | <tr> |
|
479 | 479 | <th></th> |
|
480 | 480 | <th>${_('Time')}</th> |
|
481 | 481 | <th>${_('Author')}</th> |
|
482 | 482 | <th>${_('Commit')}</th> |
|
483 | 483 | <th></th> |
|
484 | 484 | <th>${_('Description')}</th> |
|
485 | 485 | </tr> |
|
486 | 486 | |
|
487 | 487 | % for c_type, commit in c.commit_changes: |
|
488 | 488 | % if c_type in ['a', 'r']: |
|
489 | 489 | <% |
|
490 | 490 | if c_type == 'a': |
|
491 | 491 | cc_title = _('Commit added in displayed changes') |
|
492 | 492 | elif c_type == 'r': |
|
493 | 493 | cc_title = _('Commit removed in displayed changes') |
|
494 | 494 | else: |
|
495 | 495 | cc_title = '' |
|
496 | 496 | %> |
|
497 | 497 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> |
|
498 | 498 | <td> |
|
499 | 499 | <div class="commit-change-indicator color-${c_type}-border"> |
|
500 | 500 | <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}"> |
|
501 | 501 | ${c_type.upper()} |
|
502 | 502 | </div> |
|
503 | 503 | </div> |
|
504 | 504 | </td> |
|
505 | 505 | <td class="td-time"> |
|
506 | 506 | ${h.age_component(commit.date)} |
|
507 | 507 | </td> |
|
508 | 508 | <td class="td-user"> |
|
509 | 509 | ${base.gravatar_with_user(commit.author, 16)} |
|
510 | 510 | </td> |
|
511 | 511 | <td class="td-hash"> |
|
512 | 512 | <code> |
|
513 | 513 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
514 | 514 | r${commit.revision}:${h.short_id(commit.raw_id)} |
|
515 | 515 | </a> |
|
516 | 516 | ${h.hidden('revisions', commit.raw_id)} |
|
517 | 517 | </code> |
|
518 | 518 | </td> |
|
519 | 519 | <td class="expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}"> |
|
520 | 520 | <div class="show_more_col"> |
|
521 | 521 | <i class="show_more"></i> |
|
522 | 522 | </div> |
|
523 | 523 | </td> |
|
524 | 524 | <td class="mid td-description"> |
|
525 | 525 | <div class="log-container truncate-wrap"> |
|
526 | 526 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}"> |
|
527 | 527 | ${h.urlify_commit_message(commit.message, c.repo_name)} |
|
528 | 528 | </div> |
|
529 | 529 | </div> |
|
530 | 530 | </td> |
|
531 | 531 | </tr> |
|
532 | 532 | % endif |
|
533 | 533 | % endfor |
|
534 | 534 | </table> |
|
535 | 535 | </div> |
|
536 | 536 | |
|
537 | 537 | <script> |
|
538 | 538 | $('.expand_commit').on('click',function(e){ |
|
539 | 539 | var target_expand = $(this); |
|
540 | 540 | var cid = target_expand.data('commitId'); |
|
541 | 541 | |
|
542 | 542 | if (target_expand.hasClass('open')){ |
|
543 | 543 | $('#c-'+cid).css({ |
|
544 | 544 | 'height': '1.5em', |
|
545 | 545 | 'white-space': 'nowrap', |
|
546 | 546 | 'text-overflow': 'ellipsis', |
|
547 | 547 | 'overflow':'hidden' |
|
548 | 548 | }); |
|
549 | 549 | target_expand.removeClass('open'); |
|
550 | 550 | } |
|
551 | 551 | else { |
|
552 | 552 | $('#c-'+cid).css({ |
|
553 | 553 | 'height': 'auto', |
|
554 | 554 | 'white-space': 'pre-line', |
|
555 | 555 | 'text-overflow': 'initial', |
|
556 | 556 | 'overflow':'visible' |
|
557 | 557 | }); |
|
558 | 558 | target_expand.addClass('open'); |
|
559 | 559 | } |
|
560 | 560 | }); |
|
561 | 561 | </script> |
|
562 | 562 | |
|
563 | 563 | % endif |
|
564 | 564 | |
|
565 | 565 | % else: |
|
566 | 566 | <%include file="/compare/compare_commits.mako" /> |
|
567 | 567 | % endif |
|
568 | 568 | |
|
569 | 569 | <div class="cs_files"> |
|
570 | 570 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
571 | ${cbdiffs.render_diffset_menu()} | |
|
571 | ${cbdiffs.render_diffset_menu(c.diffset)} | |
|
572 | 572 | ${cbdiffs.render_diffset( |
|
573 | 573 | c.diffset, use_comments=True, |
|
574 | 574 | collapse_when_files_over=30, |
|
575 | 575 | disable_new_comments=not c.allowed_to_comment, |
|
576 | 576 | deleted_files_comments=c.deleted_files_comments, |
|
577 | 577 | inline_comments=c.inline_comments)} |
|
578 | 578 | </div> |
|
579 | 579 | % else: |
|
580 | 580 | ## skipping commits we need to clear the view for missing commits |
|
581 | 581 | <div style="clear:both;"></div> |
|
582 | 582 | % endif |
|
583 | 583 | |
|
584 | 584 | </div> |
|
585 | 585 | </div> |
|
586 | 586 | |
|
587 | 587 | ## template for inline comment form |
|
588 | 588 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
589 | 589 | |
|
590 | 590 | ## render general comments |
|
591 | 591 | |
|
592 | 592 | <div id="comment-tr-show"> |
|
593 | 593 | <div class="comment"> |
|
594 | 594 | % if general_outdated_comm_count_ver: |
|
595 | 595 | <div class="meta"> |
|
596 | 596 | % if general_outdated_comm_count_ver == 1: |
|
597 | 597 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, |
|
598 | 598 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> |
|
599 | 599 | % else: |
|
600 | 600 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, |
|
601 | 601 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> |
|
602 | 602 | % endif |
|
603 | 603 | </div> |
|
604 | 604 | % endif |
|
605 | 605 | </div> |
|
606 | 606 | </div> |
|
607 | 607 | |
|
608 | 608 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} |
|
609 | 609 | |
|
610 | 610 | % if not c.pull_request.is_closed(): |
|
611 | 611 | ## merge status, and merge action |
|
612 | 612 | <div class="pull-request-merge"> |
|
613 | 613 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> |
|
614 | 614 | </div> |
|
615 | 615 | |
|
616 | 616 | ## main comment form and it status |
|
617 | 617 | ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, |
|
618 | 618 | pull_request_id=c.pull_request.pull_request_id), |
|
619 | 619 | c.pull_request_review_status, |
|
620 | 620 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
621 | 621 | %endif |
|
622 | 622 | |
|
623 | 623 | <script type="text/javascript"> |
|
624 | 624 | if (location.hash) { |
|
625 | 625 | var result = splitDelimitedHash(location.hash); |
|
626 | 626 | var line = $('html').find(result.loc); |
|
627 | 627 | // show hidden comments if we use location.hash |
|
628 | 628 | if (line.hasClass('comment-general')) { |
|
629 | 629 | $(line).show(); |
|
630 | 630 | } else if (line.hasClass('comment-inline')) { |
|
631 | 631 | $(line).show(); |
|
632 | 632 | var $cb = $(line).closest('.cb'); |
|
633 | 633 | $cb.removeClass('cb-collapsed') |
|
634 | 634 | } |
|
635 | 635 | if (line.length > 0){ |
|
636 | 636 | offsetScroll(line, 70); |
|
637 | 637 | } |
|
638 | 638 | } |
|
639 | 639 | |
|
640 | 640 | versionController = new VersionController(); |
|
641 | 641 | versionController.init(); |
|
642 | 642 | |
|
643 | 643 | reviewersController = new ReviewersController(); |
|
644 | 644 | |
|
645 | 645 | $(function(){ |
|
646 | 646 | |
|
647 | 647 | // custom code mirror |
|
648 | 648 | var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm; |
|
649 | 649 | |
|
650 | 650 | var PRDetails = { |
|
651 | 651 | editButton: $('#open_edit_pullrequest'), |
|
652 | 652 | closeButton: $('#close_edit_pullrequest'), |
|
653 | 653 | deleteButton: $('#delete_pullrequest'), |
|
654 | 654 | viewFields: $('#pr-desc, #pr-title'), |
|
655 | 655 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
656 | 656 | |
|
657 | 657 | init: function() { |
|
658 | 658 | var that = this; |
|
659 | 659 | this.editButton.on('click', function(e) { that.edit(); }); |
|
660 | 660 | this.closeButton.on('click', function(e) { that.view(); }); |
|
661 | 661 | }, |
|
662 | 662 | |
|
663 | 663 | edit: function(event) { |
|
664 | 664 | this.viewFields.hide(); |
|
665 | 665 | this.editButton.hide(); |
|
666 | 666 | this.deleteButton.hide(); |
|
667 | 667 | this.closeButton.show(); |
|
668 | 668 | this.editFields.show(); |
|
669 | 669 | codeMirrorInstance.refresh(); |
|
670 | 670 | }, |
|
671 | 671 | |
|
672 | 672 | view: function(event) { |
|
673 | 673 | this.editButton.show(); |
|
674 | 674 | this.deleteButton.show(); |
|
675 | 675 | this.editFields.hide(); |
|
676 | 676 | this.closeButton.hide(); |
|
677 | 677 | this.viewFields.show(); |
|
678 | 678 | } |
|
679 | 679 | }; |
|
680 | 680 | |
|
681 | 681 | var ReviewersPanel = { |
|
682 | 682 | editButton: $('#open_edit_reviewers'), |
|
683 | 683 | closeButton: $('#close_edit_reviewers'), |
|
684 | 684 | addButton: $('#add_reviewer'), |
|
685 | 685 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'), |
|
686 | 686 | |
|
687 | 687 | init: function() { |
|
688 | 688 | var self = this; |
|
689 | 689 | this.editButton.on('click', function(e) { self.edit(); }); |
|
690 | 690 | this.closeButton.on('click', function(e) { self.close(); }); |
|
691 | 691 | }, |
|
692 | 692 | |
|
693 | 693 | edit: function(event) { |
|
694 | 694 | this.editButton.hide(); |
|
695 | 695 | this.closeButton.show(); |
|
696 | 696 | this.addButton.show(); |
|
697 | 697 | this.removeButtons.css('visibility', 'visible'); |
|
698 | 698 | // review rules |
|
699 | 699 | reviewersController.loadReviewRules( |
|
700 | 700 | ${c.pull_request.reviewer_data_json | n}); |
|
701 | 701 | }, |
|
702 | 702 | |
|
703 | 703 | close: function(event) { |
|
704 | 704 | this.editButton.show(); |
|
705 | 705 | this.closeButton.hide(); |
|
706 | 706 | this.addButton.hide(); |
|
707 | 707 | this.removeButtons.css('visibility', 'hidden'); |
|
708 | 708 | // hide review rules |
|
709 | 709 | reviewersController.hideReviewRules() |
|
710 | 710 | } |
|
711 | 711 | }; |
|
712 | 712 | |
|
713 | 713 | PRDetails.init(); |
|
714 | 714 | ReviewersPanel.init(); |
|
715 | 715 | |
|
716 | 716 | showOutdated = function(self){ |
|
717 | 717 | $('.comment-inline.comment-outdated').show(); |
|
718 | 718 | $('.filediff-outdated').show(); |
|
719 | 719 | $('.showOutdatedComments').hide(); |
|
720 | 720 | $('.hideOutdatedComments').show(); |
|
721 | 721 | }; |
|
722 | 722 | |
|
723 | 723 | hideOutdated = function(self){ |
|
724 | 724 | $('.comment-inline.comment-outdated').hide(); |
|
725 | 725 | $('.filediff-outdated').hide(); |
|
726 | 726 | $('.hideOutdatedComments').hide(); |
|
727 | 727 | $('.showOutdatedComments').show(); |
|
728 | 728 | }; |
|
729 | 729 | |
|
730 | 730 | refreshMergeChecks = function(){ |
|
731 | 731 | var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}"; |
|
732 | 732 | $('.pull-request-merge').css('opacity', 0.3); |
|
733 | 733 | $('.action-buttons-extra').css('opacity', 0.3); |
|
734 | 734 | |
|
735 | 735 | $('.pull-request-merge').load( |
|
736 | 736 | loadUrl, function() { |
|
737 | 737 | $('.pull-request-merge').css('opacity', 1); |
|
738 | 738 | |
|
739 | 739 | $('.action-buttons-extra').css('opacity', 1); |
|
740 | 740 | injectCloseAction(); |
|
741 | 741 | } |
|
742 | 742 | ); |
|
743 | 743 | }; |
|
744 | 744 | |
|
745 | 745 | injectCloseAction = function() { |
|
746 | 746 | var closeAction = $('#close-pull-request-action').html(); |
|
747 | 747 | var $actionButtons = $('.action-buttons-extra'); |
|
748 | 748 | // clear the action before |
|
749 | 749 | $actionButtons.html(""); |
|
750 | 750 | $actionButtons.html(closeAction); |
|
751 | 751 | }; |
|
752 | 752 | |
|
753 | 753 | closePullRequest = function (status) { |
|
754 | 754 | // inject closing flag |
|
755 | 755 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); |
|
756 | 756 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); |
|
757 | 757 | $(generalCommentForm.submitForm).submit(); |
|
758 | 758 | }; |
|
759 | 759 | |
|
760 | 760 | $('#show-outdated-comments').on('click', function(e){ |
|
761 | 761 | var button = $(this); |
|
762 | 762 | var outdated = $('.comment-outdated'); |
|
763 | 763 | |
|
764 | 764 | if (button.html() === "(Show)") { |
|
765 | 765 | button.html("(Hide)"); |
|
766 | 766 | outdated.show(); |
|
767 | 767 | } else { |
|
768 | 768 | button.html("(Show)"); |
|
769 | 769 | outdated.hide(); |
|
770 | 770 | } |
|
771 | 771 | }); |
|
772 | 772 | |
|
773 | 773 | $('.show-inline-comments').on('change', function(e){ |
|
774 | 774 | var show = 'none'; |
|
775 | 775 | var target = e.currentTarget; |
|
776 | 776 | if(target.checked){ |
|
777 | 777 | show = '' |
|
778 | 778 | } |
|
779 | 779 | var boxid = $(target).attr('id_for'); |
|
780 | 780 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
781 | 781 | var fn_display = function(idx){ |
|
782 | 782 | $(this).css('display', show); |
|
783 | 783 | }; |
|
784 | 784 | $(comments).each(fn_display); |
|
785 | 785 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
786 | 786 | $(btns).each(fn_display); |
|
787 | 787 | }); |
|
788 | 788 | |
|
789 | 789 | $('#merge_pull_request_form').submit(function() { |
|
790 | 790 | if (!$('#merge_pull_request').attr('disabled')) { |
|
791 | 791 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
792 | 792 | } |
|
793 | 793 | return true; |
|
794 | 794 | }); |
|
795 | 795 | |
|
796 | 796 | $('#edit_pull_request').on('click', function(e){ |
|
797 | 797 | var title = $('#pr-title-input').val(); |
|
798 | 798 | var description = codeMirrorInstance.getValue(); |
|
799 | 799 | var renderer = $('#pr-renderer-input').val(); |
|
800 | 800 | editPullRequest( |
|
801 | 801 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
802 | 802 | title, description, renderer); |
|
803 | 803 | }); |
|
804 | 804 | |
|
805 | 805 | $('#update_pull_request').on('click', function(e){ |
|
806 | 806 | $(this).attr('disabled', 'disabled'); |
|
807 | 807 | $(this).addClass('disabled'); |
|
808 | 808 | $(this).html(_gettext('Saving...')); |
|
809 | 809 | reviewersController.updateReviewers( |
|
810 | 810 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
811 | 811 | }); |
|
812 | 812 | |
|
813 | 813 | $('#update_commits').on('click', function(e){ |
|
814 | 814 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
815 | 815 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
816 | 816 | $(e.currentTarget).addClass('disabled'); |
|
817 | 817 | $(e.currentTarget).removeClass('btn-primary'); |
|
818 | 818 | $(e.currentTarget).text(_gettext('Updating...')); |
|
819 | 819 | if(isDisabled){ |
|
820 | 820 | updateCommits( |
|
821 | 821 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
822 | 822 | } |
|
823 | 823 | }); |
|
824 | 824 | // fixing issue with caches on firefox |
|
825 | 825 | $('#update_commits').removeAttr("disabled"); |
|
826 | 826 | |
|
827 | 827 | $('.show-inline-comments').on('click', function(e){ |
|
828 | 828 | var boxid = $(this).attr('data-comment-id'); |
|
829 | 829 | var button = $(this); |
|
830 | 830 | |
|
831 | 831 | if(button.hasClass("comments-visible")) { |
|
832 | 832 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
833 | 833 | $(this).hide(); |
|
834 | 834 | }); |
|
835 | 835 | button.removeClass("comments-visible"); |
|
836 | 836 | } else { |
|
837 | 837 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
838 | 838 | $(this).show(); |
|
839 | 839 | }); |
|
840 | 840 | button.addClass("comments-visible"); |
|
841 | 841 | } |
|
842 | 842 | }); |
|
843 | 843 | |
|
844 | 844 | // register submit callback on commentForm form to track TODOs |
|
845 | 845 | window.commentFormGlobalSubmitSuccessCallback = function(){ |
|
846 | 846 | refreshMergeChecks(); |
|
847 | 847 | }; |
|
848 | 848 | // initial injection |
|
849 | 849 | injectCloseAction(); |
|
850 | 850 | |
|
851 | 851 | ReviewerAutoComplete('#user'); |
|
852 | 852 | |
|
853 | 853 | }) |
|
854 | 854 | </script> |
|
855 | 855 | |
|
856 | 856 | </div> |
|
857 | 857 | </div> |
|
858 | 858 | |
|
859 | 859 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now