Show More
@@ -1,470 +1,478 b'' | |||
|
1 | 1 | // summary.less |
|
2 | 2 | // For use in RhodeCode applications; |
|
3 | 3 | // Used for headers and file detail summary screens. |
|
4 | 4 | |
|
5 | 5 | .summary { |
|
6 | 6 | clear: both; |
|
7 | 7 | float: none; |
|
8 | 8 | position: relative; |
|
9 | 9 | width: 100%; |
|
10 | 10 | margin: 0; |
|
11 | 11 | padding: 0; |
|
12 | 12 | background: #FCFCFC; |
|
13 | 13 | border: 1px solid #EAEAEA; |
|
14 | 14 | border-radius: @border-radius; |
|
15 | 15 | margin-bottom: 20px; |
|
16 | 16 | |
|
17 | 17 | .summary-detail-header { |
|
18 | 18 | display: block; |
|
19 | 19 | width: 100%; |
|
20 |
margin-bottom: |
|
|
20 | margin-bottom: 10px; | |
|
21 | 21 | padding: 0 0 .5em 0; |
|
22 | 22 | border-bottom: @border-thickness solid @border-default-color; |
|
23 | 23 | |
|
24 | 24 | .breadcrumbs { |
|
25 | 25 | display: inline; |
|
26 | 26 | margin: 0; |
|
27 | 27 | padding: 0; |
|
28 | 28 | } |
|
29 | 29 | |
|
30 | 30 | h4 { |
|
31 | 31 | margin: 0 1em 0 0; |
|
32 | padding: 0; | |
|
32 | padding: 10px 0 5px 20px; | |
|
33 | 33 | line-height: 1.2em; |
|
34 | 34 | font-size: @basefontsize; |
|
35 | 35 | } |
|
36 | 36 | |
|
37 | 37 | .action_link { |
|
38 | 38 | float: right; |
|
39 | 39 | } |
|
40 | 40 | |
|
41 | 41 | .new-file { |
|
42 | 42 | float: right; |
|
43 | 43 | margin-top: -1.5em; |
|
44 | 44 | } |
|
45 | 45 | } |
|
46 | 46 | |
|
47 | 47 | .summary-detail { |
|
48 | 48 | float: none; |
|
49 | 49 | position: relative; |
|
50 | 50 | width: 100%; |
|
51 | 51 | margin: 0; |
|
52 | padding: 0; | |
|
52 | padding: 0 0 20px 0; | |
|
53 | 53 | |
|
54 | 54 | .file_diff_buttons { |
|
55 | 55 | margin-top: @space; |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | // commit message |
|
59 | 59 | .commit { |
|
60 | 60 | white-space: pre-wrap; |
|
61 | 61 | } |
|
62 | 62 | |
|
63 | 63 | .left-clone { |
|
64 | 64 | float: left; |
|
65 | 65 | height: 30px; |
|
66 | 66 | margin: 0; |
|
67 | 67 | padding: 0; |
|
68 | 68 | width: 130px; |
|
69 | 69 | font-weight: @text-semibold-weight; |
|
70 | 70 | font-family: @text-semibold; |
|
71 | 71 | } |
|
72 | 72 | .left-clone select { |
|
73 | 73 | width: 130px; |
|
74 | 74 | margin-right: 0; |
|
75 | 75 | background-color: @grey7; |
|
76 | 76 | border-color: @grey4; |
|
77 | 77 | color: #5C5C5C; |
|
78 | 78 | border-top-right-radius: 0; |
|
79 | 79 | border-bottom-right-radius: 0; |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | 82 | .right-clone { |
|
83 | 83 | float: left; |
|
84 | 84 | width: ~"calc(100% - 170px)"; |
|
85 | 85 | |
|
86 | 86 | .clipboard-action { |
|
87 | 87 | margin-left: -30px; |
|
88 | 88 | } |
|
89 | 89 | } |
|
90 | 90 | |
|
91 | 91 | .clone_url_input { |
|
92 | 92 | width: ~"calc(100% - 90px)"; |
|
93 | 93 | padding: 6px 30px 6px 10px; |
|
94 | 94 | height: 14px; |
|
95 | 95 | box-shadow: 0 1px 1px 0 rgba(0,0,0,0.07); |
|
96 | 96 | border-top-left-radius: 0; |
|
97 | 97 | border-bottom-left-radius: 0; |
|
98 | 98 | margin-left: -1px; |
|
99 | 99 | } |
|
100 | 100 | |
|
101 | 101 | &.directory { |
|
102 | 102 | margin-bottom: 0; |
|
103 | 103 | } |
|
104 | 104 | |
|
105 | 105 | .desc { |
|
106 | 106 | white-space: pre-wrap; |
|
107 | 107 | } |
|
108 | 108 | .disabled { |
|
109 | 109 | opacity: .5; |
|
110 | 110 | cursor: inherit; |
|
111 | 111 | } |
|
112 | 112 | .help-block { |
|
113 | 113 | color: inherit; |
|
114 | 114 | margin: 0; |
|
115 | 115 | } |
|
116 | 116 | } |
|
117 | 117 | |
|
118 | 118 | .sidebar-right { |
|
119 | 119 | float: left; |
|
120 | 120 | width: 24%; |
|
121 | 121 | margin: 0; |
|
122 | 122 | padding: 0; |
|
123 | 123 | |
|
124 | 124 | ul { |
|
125 | 125 | margin-left: 0; |
|
126 | 126 | padding-left: 0; |
|
127 | 127 | |
|
128 | 128 | li { |
|
129 | 129 | list-style-type: none; |
|
130 | 130 | } |
|
131 | 131 | } |
|
132 | 132 | } |
|
133 | 133 | |
|
134 | 134 | #clone_by_name, #clone_by_id{ |
|
135 | 135 | display: inline-block; |
|
136 | 136 | margin-left: 0px; |
|
137 | 137 | } |
|
138 | 138 | |
|
139 | 139 | .codeblock { |
|
140 | 140 | border: none; |
|
141 | 141 | background-color: transparent; |
|
142 | 142 | } |
|
143 | 143 | |
|
144 | 144 | .code-body { |
|
145 | 145 | border: @border-thickness solid @border-default-color; |
|
146 | 146 | .border-radius(@border-radius); |
|
147 | 147 | } |
|
148 | 148 | |
|
149 | 149 | .btn-collapse { |
|
150 | 150 | clear: both; |
|
151 | 151 | float: none; |
|
152 | 152 | background: #F7F7F7; |
|
153 | 153 | text-align: center; |
|
154 | 154 | color: #949494; |
|
155 | 155 | font-size: 11px; |
|
156 | 156 | |
|
157 | 157 | &:hover { |
|
158 | 158 | background: #f1f1f1; |
|
159 | 159 | color: #2B2B2D; |
|
160 | 160 | } |
|
161 | 161 | } |
|
162 | 162 | } |
|
163 | 163 | |
|
164 | 164 | // this is used outside of just the summary |
|
165 | 165 | .fieldset, // similar to form fieldset |
|
166 | 166 | .summary .sidebar-right-content { // these have to match |
|
167 | 167 | clear: both; |
|
168 | 168 | float: none; |
|
169 | 169 | position: relative; |
|
170 | 170 | display:block; |
|
171 | 171 | width: 100%; |
|
172 | 172 | min-height: 1em; |
|
173 | 173 | margin-bottom: 10px; |
|
174 | 174 | padding: 0; |
|
175 | 175 | line-height: 1.2em; |
|
176 | 176 | |
|
177 | 177 | &:after { // clearfix |
|
178 | 178 | content: ""; |
|
179 | 179 | clear: both; |
|
180 | 180 | width: 100%; |
|
181 | 181 | height: 1em; |
|
182 | 182 | } |
|
183 | 183 | } |
|
184 | 184 | |
|
185 | 185 | .summary .sidebar-right-content { |
|
186 | 186 | margin-bottom: 0; |
|
187 | 187 | |
|
188 | 188 | .rc-user { |
|
189 | 189 | min-width: 0; |
|
190 | 190 | } |
|
191 | 191 | |
|
192 | 192 | li { |
|
193 | 193 | list-style: none; |
|
194 | 194 | line-height: normal; |
|
195 | 195 | } |
|
196 | 196 | } |
|
197 | 197 | |
|
198 | 198 | .summary { |
|
199 | 199 | .fieldset { |
|
200 | 200 | margin-bottom: 0; |
|
201 | 201 | } |
|
202 | 202 | } |
|
203 | 203 | |
|
204 | 204 | .fieldset { |
|
205 | 205 | |
|
206 | 206 | .left-label { // similar to form legend |
|
207 | 207 | display: block; |
|
208 | 208 | margin: 0; |
|
209 | 209 | padding: 0; |
|
210 | 210 | font-weight: @text-semibold-weight; |
|
211 | 211 | font-family: @text-semibold; |
|
212 | 212 | } |
|
213 | 213 | |
|
214 | 214 | .left-label-summary { |
|
215 | 215 | padding-left: 20px; |
|
216 | 216 | margin-bottom: 5px; |
|
217 | 217 | |
|
218 | 218 | p { |
|
219 | 219 | margin-bottom: 5px; |
|
220 | 220 | color: @grey1; |
|
221 | 221 | float: left; |
|
222 | 222 | width: 130px; |
|
223 | ||
|
224 | &.spacing { | |
|
225 | margin-top: 10px; | |
|
226 | } | |
|
223 | 227 | } |
|
224 | 228 | |
|
225 | 229 | .right-label-summary { |
|
226 | 230 | float: left; |
|
227 | 231 | margin-top: 7px; |
|
228 | 232 | width: ~"calc(100% - 160px)"; |
|
229 | 233 | } |
|
230 | 234 | } |
|
231 | 235 | |
|
232 | 236 | .left-label-summary-files { |
|
233 | 237 | padding-left: 45px; |
|
234 | 238 | margin-top: 5px; |
|
235 | 239 | |
|
236 | 240 | p { |
|
237 | 241 | margin-bottom: 5px; |
|
238 | 242 | color: @grey1; |
|
239 | 243 | float: left; |
|
240 | 244 | width: 130px; |
|
245 | ||
|
246 | &.spacing { | |
|
247 | margin-top: 10px; | |
|
248 | } | |
|
241 | 249 | } |
|
242 | 250 | |
|
243 | 251 | .right-label-summary { |
|
244 | 252 | float: left; |
|
245 | 253 | margin-top: 7px; |
|
246 | 254 | } |
|
247 | 255 | } |
|
248 | 256 | |
|
249 | 257 | .left-content { |
|
250 | 258 | width: ~"calc(60% - 20px)"; |
|
251 | 259 | float: left; |
|
252 | 260 | margin: 15px 0 15px 20px; |
|
253 | 261 | |
|
254 | 262 | .rc-user { |
|
255 | 263 | min-width: auto; |
|
256 | 264 | max-width: none; |
|
257 | 265 | min-height: auto; |
|
258 | 266 | padding-right: 5px; |
|
259 | 267 | } |
|
260 | 268 | |
|
261 | 269 | .left-content-avatar { |
|
262 | 270 | width: 45px; |
|
263 | 271 | float: left; |
|
264 | 272 | margin-top: 8px; |
|
265 | 273 | } |
|
266 | 274 | |
|
267 | 275 | .left-content-message { |
|
268 | 276 | float: left; |
|
269 | 277 | width: ~"calc(100% - 45px)"; |
|
270 | 278 | } |
|
271 | 279 | } |
|
272 | 280 | |
|
273 | 281 | .right-content { // similar to form fields |
|
274 | 282 | float: left; |
|
275 | 283 | display: block; |
|
276 | 284 | width: ~"calc(40% - 20px)"; |
|
277 | 285 | text-align: right; |
|
278 | 286 | margin: 15px 20px 15px 0; |
|
279 | 287 | |
|
280 | 288 | .truncate-wrap, |
|
281 | 289 | .truncate { |
|
282 | 290 | max-width: 100%; |
|
283 | 291 | width: 100%; |
|
284 | 292 | } |
|
285 | 293 | |
|
286 | 294 | .commit-long { |
|
287 | 295 | overflow-x: auto; |
|
288 | 296 | } |
|
289 | 297 | |
|
290 | 298 | .commit-info { |
|
291 | 299 | margin-top: 7px; |
|
292 | 300 | } |
|
293 | 301 | |
|
294 | 302 | .tag, .tagtag, .branchtag, .booktag, .metatag, .perm_tag { |
|
295 | 303 | background:transparent; |
|
296 | 304 | border: none; |
|
297 | 305 | box-shadow: none; |
|
298 | 306 | margin-left: 10px; |
|
299 | 307 | font-size: 13px; |
|
300 | 308 | } |
|
301 | 309 | |
|
302 | 310 | .tag span, .tag i { |
|
303 | 311 | color: @grey1; |
|
304 | 312 | } |
|
305 | 313 | } |
|
306 | 314 | .commit { |
|
307 | 315 | color: @grey1; |
|
308 | 316 | margin-bottom: 5px; |
|
309 | 317 | white-space: pre; |
|
310 | 318 | } |
|
311 | 319 | .commit.truncate-wrap { |
|
312 | 320 | overflow:hidden; |
|
313 | 321 | text-overflow: ellipsis; |
|
314 | 322 | } |
|
315 | 323 | .commit-author { |
|
316 | 324 | color: @grey1; |
|
317 | 325 | } |
|
318 | 326 | .commit-date { |
|
319 | 327 | color: @grey4; |
|
320 | 328 | } |
|
321 | 329 | } |
|
322 | 330 | |
|
323 | 331 | // expand commit message |
|
324 | 332 | #message_expand { |
|
325 | 333 | clear: both; |
|
326 | 334 | display: block; |
|
327 | 335 | color: @rcblue; |
|
328 | 336 | cursor: pointer; |
|
329 | 337 | } |
|
330 | 338 | |
|
331 | 339 | #trimmed_message_box { |
|
332 | 340 | max-height: floor(2 * @basefontsize * 1.2); // 2 lines * line-height |
|
333 | 341 | overflow: hidden; |
|
334 | 342 | } |
|
335 | 343 | |
|
336 | 344 | // show/hide comments button |
|
337 | 345 | .show-inline-comments { |
|
338 | 346 | display: inline; |
|
339 | 347 | cursor: pointer; |
|
340 | 348 | |
|
341 | 349 | .comments-show { display: inline; } |
|
342 | 350 | .comments-hide { display: none; } |
|
343 | 351 | |
|
344 | 352 | &.comments-visible { |
|
345 | 353 | .comments-show { display: none; } |
|
346 | 354 | .comments-hide { display: inline; } |
|
347 | 355 | } |
|
348 | 356 | } |
|
349 | 357 | |
|
350 | 358 | // Quick Start section |
|
351 | 359 | |
|
352 | 360 | .empty-repo { |
|
353 | 361 | border: 1px solid #EAEAEA; |
|
354 | 362 | border-bottom: 0; |
|
355 | 363 | border-radius: @border-radius; |
|
356 | 364 | padding: 0 20px; |
|
357 | 365 | } |
|
358 | 366 | |
|
359 | 367 | .empty-repo h3, .quick_start p { |
|
360 | 368 | margin-bottom: 10px; |
|
361 | 369 | } |
|
362 | 370 | |
|
363 | 371 | .quick_start pre { |
|
364 | 372 | background: #FCFEFF; |
|
365 | 373 | border: 1px solid #CBDBEB; |
|
366 | 374 | box-shadow: @button-shadow; |
|
367 | 375 | padding: 10px 15px; |
|
368 | 376 | border-radius: 4px; |
|
369 | 377 | color: @grey2; |
|
370 | 378 | } |
|
371 | 379 | |
|
372 | 380 | .clear-fix { |
|
373 | 381 | clear: both; |
|
374 | 382 | } |
|
375 | 383 | |
|
376 | 384 | .quick_start { |
|
377 | 385 | display: block; |
|
378 | 386 | position: relative; |
|
379 | 387 | border: 1px solid #EAEAEA; |
|
380 | 388 | border-top: 0; |
|
381 | 389 | border-radius: @border-radius; |
|
382 | 390 | padding: 0 20px; |
|
383 | 391 | |
|
384 | 392 | // adds some space to make copy and paste easier |
|
385 | 393 | .left-label, |
|
386 | 394 | .right-content { |
|
387 | 395 | line-height: 1.6em; |
|
388 | 396 | } |
|
389 | 397 | } |
|
390 | 398 | |
|
391 | 399 | |
|
392 | 400 | .submodule { |
|
393 | 401 | .summary-detail { |
|
394 | 402 | width: 100%; |
|
395 | 403 | |
|
396 | 404 | .btn-collapse { |
|
397 | 405 | display: none; |
|
398 | 406 | } |
|
399 | 407 | } |
|
400 | 408 | } |
|
401 | 409 | |
|
402 | 410 | .codeblock-header { |
|
403 | 411 | float: left; |
|
404 | 412 | display: block; |
|
405 | 413 | width: 100%; |
|
406 | 414 | margin: 0; |
|
407 | 415 | |
|
408 | 416 | .stats { |
|
409 | 417 | float: left; |
|
410 | 418 | padding: 10px; |
|
411 | 419 | } |
|
412 | 420 | .stats-filename { |
|
413 | 421 | font-size: 120%; |
|
414 | 422 | } |
|
415 | 423 | .stats-first-item { |
|
416 | 424 | padding: 0px 0px 0px 3px; |
|
417 | 425 | } |
|
418 | 426 | |
|
419 | 427 | .stats-info { |
|
420 | 428 | margin-top: 5px; |
|
421 | 429 | color: @grey4; |
|
422 | 430 | } |
|
423 | 431 | |
|
424 | 432 | .buttons { |
|
425 | 433 | float: right; |
|
426 | 434 | text-align: right; |
|
427 | 435 | color: @grey4; |
|
428 | 436 | padding: 10px; |
|
429 | 437 | margin-top: 15px; |
|
430 | 438 | } |
|
431 | 439 | |
|
432 | 440 | .file-container { |
|
433 | 441 | display: inline-block; |
|
434 | 442 | width: 100%; |
|
435 | 443 | } |
|
436 | 444 | |
|
437 | 445 | } |
|
438 | 446 | |
|
439 | 447 | #summary-menu-stats { |
|
440 | 448 | |
|
441 | 449 | .stats-bullet { |
|
442 | 450 | color: @grey3; |
|
443 | 451 | min-width: 3em; |
|
444 | 452 | } |
|
445 | 453 | |
|
446 | 454 | .repo-size { |
|
447 | 455 | margin-bottom: .5em; |
|
448 | 456 | } |
|
449 | 457 | |
|
450 | 458 | } |
|
451 | 459 | |
|
452 | 460 | .rctable.repo_summary { |
|
453 | 461 | border: 1px solid #eaeaea; |
|
454 | 462 | border-radius: 2px; |
|
455 | 463 | border-collapse: inherit; |
|
456 | 464 | border-bottom: 0; |
|
457 | 465 | |
|
458 | 466 | th { |
|
459 | 467 | background: @grey7; |
|
460 | 468 | border-bottom: 0; |
|
461 | 469 | } |
|
462 | 470 | |
|
463 | 471 | td { |
|
464 | 472 | border-color: #eaeaea; |
|
465 | 473 | } |
|
466 | 474 | |
|
467 | 475 | td.td-status { |
|
468 | 476 | padding: 0 0 0 10px; |
|
469 | 477 | } |
|
470 | 478 | } |
@@ -1,303 +1,297 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()"></%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="menu_bar_nav()"> |
|
19 | 19 | ${self.menu_items(active='repositories')} |
|
20 | 20 | </%def> |
|
21 | 21 | |
|
22 | 22 | <%def name="menu_bar_subnav()"> |
|
23 | 23 | ${self.repo_menu(active='compare')} |
|
24 | 24 | </%def> |
|
25 | 25 | |
|
26 | 26 | <%def name="main()"> |
|
27 | 27 | <script type="text/javascript"> |
|
28 | 28 | // set fake commitId on this commit-range page |
|
29 | 29 | templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}"; |
|
30 | 30 | </script> |
|
31 | 31 | |
|
32 | 32 | <div class="box"> |
|
33 | 33 | <div class="summary changeset"> |
|
34 | 34 | <div class="summary-detail"> |
|
35 | 35 | <div class="summary-detail-header"> |
|
36 | 36 | <span class="breadcrumbs files_location"> |
|
37 | 37 | <h4> |
|
38 | 38 | ${_('Compare Commits')} |
|
39 | 39 | % if c.file_path: |
|
40 | 40 | ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a> |
|
41 | 41 | % endif |
|
42 | 42 | |
|
43 | 43 | % if c.commit_ranges: |
|
44 | 44 | <code> |
|
45 | 45 | r${c.source_commit.idx}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.idx}:${h.short_id(c.target_commit.raw_id)} |
|
46 | 46 | </code> |
|
47 | 47 | % endif |
|
48 | 48 | </h4> |
|
49 | 49 | </span> |
|
50 | <div class="clear-fix"></div> | |
|
50 | 51 | </div> |
|
51 | 52 | |
|
52 | 53 | <div class="fieldset"> |
|
53 | <div class="left-label"> | |
|
54 | ${_('Target')}: | |
|
55 | </div> | |
|
56 | <div class="right-content"> | |
|
57 | <div> | |
|
54 | <div class="left-label-summary"> | |
|
55 | <p class="spacing">${_('Target')}:</p> | |
|
56 | <div class="right-label-summary"> | |
|
58 | 57 | <div class="code-header" > |
|
59 | 58 | <div class="compare_header"> |
|
60 | 59 | ## The hidden elements are replaced with a select2 widget |
|
61 | 60 | ${h.hidden('compare_source')} |
|
62 | 61 | </div> |
|
63 | 62 | </div> |
|
64 | 63 | </div> |
|
65 | 64 | </div> |
|
66 | 65 | </div> |
|
67 | 66 | |
|
68 | 67 | <div class="fieldset"> |
|
69 | <div class="left-label"> | |
|
70 | ${_('Source')}: | |
|
71 | </div> | |
|
72 | <div class="right-content"> | |
|
73 | <div> | |
|
68 | <div class="left-label-summary"> | |
|
69 | <p class="spacing">${_('Source')}:</p> | |
|
70 | <div class="right-label-summary"> | |
|
74 | 71 | <div class="code-header" > |
|
75 | 72 | <div class="compare_header"> |
|
76 | 73 | ## The hidden elements are replaced with a select2 widget |
|
77 | 74 | ${h.hidden('compare_target')} |
|
78 | 75 | </div> |
|
79 | 76 | </div> |
|
80 | 77 | </div> |
|
81 | 78 | </div> |
|
82 | 79 | </div> |
|
83 | 80 | |
|
84 | 81 | <div class="fieldset"> |
|
85 | <div class="left-label"> | |
|
86 | ${_('Actions')}: | |
|
87 | </div> | |
|
88 | <div class="right-content"> | |
|
89 | <div> | |
|
82 | <div class="left-label-summary"> | |
|
83 | <p class="spacing">${_('Actions')}:</p> | |
|
84 | <div class="right-label-summary"> | |
|
90 | 85 | <div class="code-header" > |
|
91 | 86 | <div class="compare_header"> |
|
92 | ||
|
93 | 87 | <div class="compare-buttons"> |
|
94 | 88 | % if c.compare_home: |
|
95 | 89 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
96 | 90 | |
|
97 | 91 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
98 | 92 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
99 | 93 | <div id="changeset_compare_view_content"> |
|
100 | 94 | <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div> |
|
101 | 95 | </div> |
|
102 | 96 | |
|
103 | 97 | % elif c.preview_mode: |
|
104 | 98 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a> |
|
105 | 99 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
106 | 100 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
107 | 101 | |
|
108 | 102 | % else: |
|
109 | 103 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
110 | 104 | <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a> |
|
111 | 105 | |
|
112 | 106 | ## allow comment only if there are commits to comment on |
|
113 | 107 | % if c.diffset and c.diffset.files and c.commit_ranges: |
|
114 | 108 | <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a> |
|
115 | 109 | % else: |
|
116 | 110 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
117 | 111 | % endif |
|
118 | 112 | % endif |
|
119 | 113 | </div> |
|
120 | 114 | </div> |
|
121 | 115 | </div> |
|
122 | 116 | </div> |
|
123 | </div> | |
|
117 | </div> | |
|
124 | 118 | </div> |
|
125 | 119 | |
|
126 | 120 | ## commit status form |
|
127 | 121 | <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;"> |
|
128 | <div class="left-label"> | |
|
129 | ${_('Commit status')}: | |
|
130 | </div> | |
|
131 | <div class="right-content"> | |
|
132 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
|
133 |
|
|
|
134 |
|
|
|
135 | def revs(_revs): | |
|
136 |
for |
|
|
137 | for cs in _revs: | |
|
138 | tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id} | |
|
139 |
form_inputs |
|
|
140 |
|
|
|
141 |
|
|
|
142 | <div> | |
|
143 | ${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))} | |
|
122 | <div class="left-label-summary"> | |
|
123 | <p class="spacing">${_('Commit status')}:</p> | |
|
124 | <div class="right-label-summary"> | |
|
125 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
|
126 | ## main comment form and it status | |
|
127 | <% | |
|
128 | def revs(_revs): | |
|
129 | form_inputs = [] | |
|
130 | for cs in _revs: | |
|
131 | tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id} | |
|
132 | form_inputs.append(tmpl) | |
|
133 | return form_inputs | |
|
134 | %> | |
|
135 | <div> | |
|
136 | ${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))} | |
|
137 | </div> | |
|
144 | 138 | </div> |
|
145 | 139 | </div> |
|
146 | 140 | </div> |
|
147 | ||
|
141 | <div class="clear-fix"></div> | |
|
148 | 142 | </div> <!-- end summary-detail --> |
|
149 | 143 | </div> <!-- end summary --> |
|
150 | 144 | |
|
151 | 145 | ## use JS script to load it quickly before potentially large diffs render long time |
|
152 | 146 | ## this prevents from situation when large diffs block rendering of select2 fields |
|
153 | 147 | <script type="text/javascript"> |
|
154 | 148 | |
|
155 | 149 | var cache = {}; |
|
156 | 150 | |
|
157 | 151 | var formatSelection = function(repoName){ |
|
158 | 152 | return function(data, container, escapeMarkup) { |
|
159 | 153 | var selection = data ? this.text(data) : ""; |
|
160 | 154 | return escapeMarkup('{0}@{1}'.format(repoName, selection)); |
|
161 | 155 | } |
|
162 | 156 | }; |
|
163 | 157 | |
|
164 | 158 | var feedCompareData = function(query, cachedValue){ |
|
165 | 159 | var data = {results: []}; |
|
166 | 160 | //filter results |
|
167 | 161 | $.each(cachedValue.results, function() { |
|
168 | 162 | var section = this.text; |
|
169 | 163 | var children = []; |
|
170 | 164 | $.each(this.children, function() { |
|
171 | 165 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { |
|
172 | 166 | children.push({ |
|
173 | 167 | 'id': this.id, |
|
174 | 168 | 'text': this.text, |
|
175 | 169 | 'type': this.type |
|
176 | 170 | }) |
|
177 | 171 | } |
|
178 | 172 | }); |
|
179 | 173 | data.results.push({ |
|
180 | 174 | 'text': section, |
|
181 | 175 | 'children': children |
|
182 | 176 | }) |
|
183 | 177 | }); |
|
184 | 178 | //push the typed in changeset |
|
185 | 179 | data.results.push({ |
|
186 | 180 | 'text': _gettext('specify commit'), |
|
187 | 181 | 'children': [{ |
|
188 | 182 | 'id': query.term, |
|
189 | 183 | 'text': query.term, |
|
190 | 184 | 'type': 'rev' |
|
191 | 185 | }] |
|
192 | 186 | }); |
|
193 | 187 | query.callback(data); |
|
194 | 188 | }; |
|
195 | 189 | |
|
196 | 190 | var loadCompareData = function(repoName, query, cache){ |
|
197 | 191 | $.ajax({ |
|
198 | 192 | url: pyroutes.url('repo_refs_data', {'repo_name': repoName}), |
|
199 | 193 | data: {}, |
|
200 | 194 | dataType: 'json', |
|
201 | 195 | type: 'GET', |
|
202 | 196 | success: function(data) { |
|
203 | 197 | cache[repoName] = data; |
|
204 | 198 | query.callback({results: data.results}); |
|
205 | 199 | } |
|
206 | 200 | }) |
|
207 | 201 | }; |
|
208 | 202 | |
|
209 | 203 | var enable_fields = ${"false" if c.preview_mode else "true"}; |
|
210 | 204 | $("#compare_source").select2({ |
|
211 | 205 | placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}", |
|
212 | 206 | containerCssClass: "drop-menu", |
|
213 | 207 | dropdownCssClass: "drop-menu-dropdown", |
|
214 | 208 | formatSelection: formatSelection("${c.source_repo.repo_name}"), |
|
215 | 209 | dropdownAutoWidth: true, |
|
216 | 210 | query: function(query) { |
|
217 | 211 | var repoName = '${c.source_repo.repo_name}'; |
|
218 | 212 | var cachedValue = cache[repoName]; |
|
219 | 213 | |
|
220 | 214 | if (cachedValue){ |
|
221 | 215 | feedCompareData(query, cachedValue); |
|
222 | 216 | } |
|
223 | 217 | else { |
|
224 | 218 | loadCompareData(repoName, query, cache); |
|
225 | 219 | } |
|
226 | 220 | } |
|
227 | 221 | }).select2("enable", enable_fields); |
|
228 | 222 | |
|
229 | 223 | $("#compare_target").select2({ |
|
230 | 224 | placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}", |
|
231 | 225 | dropdownAutoWidth: true, |
|
232 | 226 | containerCssClass: "drop-menu", |
|
233 | 227 | dropdownCssClass: "drop-menu-dropdown", |
|
234 | 228 | formatSelection: formatSelection("${c.target_repo.repo_name}"), |
|
235 | 229 | query: function(query) { |
|
236 | 230 | var repoName = '${c.target_repo.repo_name}'; |
|
237 | 231 | var cachedValue = cache[repoName]; |
|
238 | 232 | |
|
239 | 233 | if (cachedValue){ |
|
240 | 234 | feedCompareData(query, cachedValue); |
|
241 | 235 | } |
|
242 | 236 | else { |
|
243 | 237 | loadCompareData(repoName, query, cache); |
|
244 | 238 | } |
|
245 | 239 | } |
|
246 | 240 | }).select2("enable", enable_fields); |
|
247 | 241 | var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"}; |
|
248 | 242 | var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"}; |
|
249 | 243 | |
|
250 | 244 | $('#compare_revs').on('click', function(e) { |
|
251 | 245 | var source = $('#compare_source').select2('data') || initial_compare_source; |
|
252 | 246 | var target = $('#compare_target').select2('data') || initial_compare_target; |
|
253 | 247 | if (source && target) { |
|
254 | 248 | var url_data = { |
|
255 | 249 | repo_name: "${c.repo_name}", |
|
256 | 250 | source_ref: source.id, |
|
257 | 251 | source_ref_type: source.type, |
|
258 | 252 | target_ref: target.id, |
|
259 | 253 | target_ref_type: target.type |
|
260 | 254 | }; |
|
261 | 255 | window.location = pyroutes.url('repo_compare', url_data); |
|
262 | 256 | } |
|
263 | 257 | }); |
|
264 | 258 | $('#compare_changeset_status_toggle').on('click', function(e) { |
|
265 | 259 | $('#compare_changeset_status').toggle(); |
|
266 | 260 | }); |
|
267 | 261 | |
|
268 | 262 | </script> |
|
269 | 263 | |
|
270 | 264 | ## table diff data |
|
271 | 265 | <div class="table"> |
|
272 | 266 | |
|
273 | 267 | |
|
274 | 268 | % if not c.compare_home: |
|
275 | 269 | <div id="changeset_compare_view_content"> |
|
276 | 270 | <div class="pull-left"> |
|
277 | 271 | <div class="btn-group"> |
|
278 | 272 | <a |
|
279 | 273 | class="btn" |
|
280 | 274 | href="#" |
|
281 | 275 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
282 | 276 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
283 | 277 | </a> |
|
284 | 278 | <a |
|
285 | 279 | class="btn" |
|
286 | 280 | href="#" |
|
287 | 281 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
288 | 282 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
289 | 283 | </a> |
|
290 | 284 | </div> |
|
291 | 285 | </div> |
|
292 | 286 | <div style="padding:0 10px 10px 0px" class="pull-left"></div> |
|
293 | 287 | ## commit compare generated below |
|
294 | 288 | <%include file="compare_commits.mako"/> |
|
295 | 289 | ${cbdiffs.render_diffset_menu(c.diffset)} |
|
296 | 290 | ${cbdiffs.render_diffset(c.diffset)} |
|
297 | 291 | </div> |
|
298 | 292 | % endif |
|
299 | 293 | |
|
300 | 294 | </div> |
|
301 | 295 | </div> |
|
302 | 296 | |
|
303 | 297 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now