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