Show More
@@ -676,6 +676,58 b' input.filediff-collapse-state {' | |||||
676 | display: block; |
|
676 | display: block; | |
677 | } |
|
677 | } | |
678 | margin: 20px 0; |
|
678 | margin: 20px 0; | |
|
679 | &:nth-child(2) { | |||
|
680 | margin: 0; | |||
|
681 | } | |||
|
682 | } | |||
|
683 | } | |||
|
684 | .cs_files { | |||
|
685 | clear: both; | |||
|
686 | } | |||
|
687 | ||||
|
688 | .diffset-menu { | |||
|
689 | margin-bottom: 20px; | |||
|
690 | } | |||
|
691 | .diffset { | |||
|
692 | margin: 20px auto; | |||
|
693 | .diffset-heading { | |||
|
694 | border: 1px solid @grey5; | |||
|
695 | margin-bottom: -1px; | |||
|
696 | // margin-top: 20px; | |||
|
697 | h2 { | |||
|
698 | margin: 0; | |||
|
699 | line-height: 38px; | |||
|
700 | padding-left: 10px; | |||
|
701 | } | |||
|
702 | .btn { | |||
|
703 | margin: 0; | |||
|
704 | } | |||
|
705 | background: @grey6; | |||
|
706 | display: block; | |||
|
707 | padding: 5px; | |||
|
708 | } | |||
|
709 | .diffset-heading-warning { | |||
|
710 | background: @alert3-inner; | |||
|
711 | border: 1px solid @alert3; | |||
|
712 | } | |||
|
713 | } | |||
|
714 | .pill { | |||
|
715 | display: block; | |||
|
716 | float: left; | |||
|
717 | padding: @pill-padding; | |||
|
718 | } | |||
|
719 | .pill-group { | |||
|
720 | .pill { | |||
|
721 | opacity: .8; | |||
|
722 | &:first-child { | |||
|
723 | border-radius: @border-radius 0 0 @border-radius; | |||
|
724 | } | |||
|
725 | &:last-child { | |||
|
726 | border-radius: 0 @border-radius @border-radius 0; | |||
|
727 | } | |||
|
728 | &:only-child { | |||
|
729 | border-radius: @border-radius; | |||
|
730 | } | |||
679 | } |
|
731 | } | |
680 | } |
|
732 | } | |
681 | .filediff { |
|
733 | .filediff { | |
@@ -740,25 +792,6 b' input.filediff-collapse-state {' | |||||
740 | } |
|
792 | } | |
741 | } |
|
793 | } | |
742 | .pill { |
|
794 | .pill { | |
743 | display: block; |
|
|||
744 | float: left; |
|
|||
745 | padding: @pill-padding; |
|
|||
746 | } |
|
|||
747 | .pill-group { |
|
|||
748 | .pill { |
|
|||
749 | opacity: .8; |
|
|||
750 | &:first-child { |
|
|||
751 | border-radius: @border-radius 0 0 @border-radius; |
|
|||
752 | } |
|
|||
753 | &:last-child { |
|
|||
754 | border-radius: 0 @border-radius @border-radius 0; |
|
|||
755 | } |
|
|||
756 | &:only-child { |
|
|||
757 | border-radius: @border-radius; |
|
|||
758 | } |
|
|||
759 | } |
|
|||
760 | } |
|
|||
761 | .pill { |
|
|||
762 | &[op="name"] { |
|
795 | &[op="name"] { | |
763 | background: none; |
|
796 | background: none; | |
764 | color: @grey2; |
|
797 | color: @grey2; |
@@ -13,6 +13,13 b' a { cursor: pointer; }' | |||||
13 | } |
|
13 | } | |
14 | } |
|
14 | } | |
15 |
|
15 | |||
|
16 | .clearinner:after { /* clears all floating divs inside a block */ | |||
|
17 | content: ""; | |||
|
18 | display: table; | |||
|
19 | clear: both; | |||
|
20 | } | |||
|
21 | ||||
|
22 | ||||
16 | .linebreak { |
|
23 | .linebreak { | |
17 | display: block; |
|
24 | display: block; | |
18 | } |
|
25 | } |
@@ -23,7 +23,7 b' new_args.update(kw)' | |||||
23 | return h.url('', **new_args) |
|
23 | return h.url('', **new_args) | |
24 | %></%def> |
|
24 | %></%def> | |
25 |
|
25 | |||
26 |
<%def name="render_diffset(diffset, commit |
|
26 | <%def name="render_diffset(diffset, commit=None, | |
27 |
|
27 | |||
28 | # collapse all file diff entries when there are more than this amount of files in the diff |
|
28 | # collapse all file diff entries when there are more than this amount of files in the diff | |
29 | collapse_when_files_over=20, |
|
29 | collapse_when_files_over=20, | |
@@ -33,6 +33,7 b" return h.url('', **new_args)" | |||||
33 |
|
33 | |||
34 | # add a ruler at to the output |
|
34 | # add a ruler at to the output | |
35 | ruler_at_chars=0, |
|
35 | ruler_at_chars=0, | |
|
36 | ||||
36 | )"> |
|
37 | )"> | |
37 | <% |
|
38 | <% | |
38 | collapse_all = len(diffset.files) > collapse_when_files_over |
|
39 | collapse_all = len(diffset.files) > collapse_when_files_over | |
@@ -59,44 +60,26 b' collapse_all = len(diffset.files) > coll' | |||||
59 | left: ${ruler_at_chars + 5}ch; |
|
60 | left: ${ruler_at_chars + 5}ch; | |
60 | </style> |
|
61 | </style> | |
61 | %endif |
|
62 | %endif | |
62 | % if diffset.limited_diff: |
|
|||
63 | <div class="alert alert-warning"> |
|
|||
64 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
|||
65 | </div> |
|
|||
66 | % endif |
|
|||
67 |
|
63 | |||
68 | <div class="diffset"> |
|
64 | <div class="diffset"> | |
69 | <div class="diffset-heading"> |
|
65 | <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}"> | |
70 | <div class="pull-right"> |
|
66 | %if commit: | |
71 |
<div class=" |
|
67 | <div class="pull-right"> | |
72 | <a |
|
68 | <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=c.repo_name, revision=commit.raw_id, f_path='')}"> | |
73 | class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip" |
|
69 | ${_('Browse Files')} | |
74 | title="${_('View side by side')}" |
|
|||
75 | href="${h.url_replace(diffmode='sideside')}"> |
|
|||
76 | <span>${_('Side by Side')}</span> |
|
|||
77 | </a> |
|
|||
78 | <a |
|
|||
79 | class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip" |
|
|||
80 | title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}"> |
|
|||
81 | <span>${_('Unified')}</span> |
|
|||
82 | </a> |
|
70 | </a> | |
83 | </div> |
|
71 | </div> | |
84 |
|
|
72 | %endif | |
85 |
< |
|
73 | <h2 class="clearinner"> | |
86 | <div class="btn-group"> |
|
74 | %if commit: | |
87 | <a |
|
75 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> - | |
88 | class="btn" |
|
76 | ${h.age_component(commit.date)} - | |
89 | href="#" |
|
77 | %endif | |
90 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All')}</a> |
|
|||
91 | <a |
|
|||
92 | class="btn" |
|
|||
93 | href="#" |
|
|||
94 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All')}</a> |
|
|||
95 | </div> |
|
|||
96 | </div> |
|
|||
97 | <h2 style="padding: 5px; text-align: center;"> |
|
|||
98 | %if diffset.limited_diff: |
|
78 | %if diffset.limited_diff: | |
99 | ${ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}} |
|
79 | ${_('The requested commit is too big and content was truncated.')} | |
|
80 | ||||
|
81 | ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} | |||
|
82 | <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |||
100 | %else: |
|
83 | %else: | |
101 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', |
|
84 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', | |
102 | '%(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}} |
|
85 | '%(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}} | |
@@ -118,7 +101,7 b' collapse_all = len(diffset.files) > coll' | |||||
118 | <div |
|
101 | <div | |
119 | class="filediff" |
|
102 | class="filediff" | |
120 | data-f-path="${filediff['patch']['filename']}" |
|
103 | data-f-path="${filediff['patch']['filename']}" | |
121 | id="a_${h.FID(commit_id or '', filediff['patch']['filename'])}"> |
|
104 | id="a_${h.FID(commit and commit.raw_id or '', filediff['patch']['filename'])}"> | |
122 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> |
|
105 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> | |
123 | <div class="filediff-collapse-indicator"></div> |
|
106 | <div class="filediff-collapse-indicator"></div> | |
124 | ${diff_ops(filediff)} |
|
107 | ${diff_ops(filediff)} | |
@@ -244,7 +227,7 b' from rhodecode.lib.diffs import NEW_FILE' | |||||
244 | %endif |
|
227 | %endif | |
245 | </span> |
|
228 | </span> | |
246 |
|
229 | |||
247 | <a class="pill filediff-anchor" href="#a_${h.FID(commit_id or '', filediff.patch['filename'])}">¶</a> |
|
230 | <a class="pill filediff-anchor" href="#a_${h.FID(commit and commit.raw_id or '', filediff.patch['filename'])}">¶</a> | |
248 |
|
231 | |||
249 | <span class="pill-group" style="float: right"> |
|
232 | <span class="pill-group" style="float: right"> | |
250 | %if BIN_FILENODE in stats['ops']: |
|
233 | %if BIN_FILENODE in stats['ops']: | |
@@ -402,3 +385,36 b' from rhodecode.lib.diffs import NEW_FILE' | |||||
402 | </tr> |
|
385 | </tr> | |
403 | %endfor |
|
386 | %endfor | |
404 | </%def> |
|
387 | </%def> | |
|
388 | ||||
|
389 | ||||
|
390 | <%def name="render_diffset_menu()"> | |||
|
391 | <div class="diffset-menu clearinner"> | |||
|
392 | <div class="pull-right"> | |||
|
393 | <div class="btn-group"> | |||
|
394 | <a | |||
|
395 | class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip" | |||
|
396 | title="${_('View side by side')}" | |||
|
397 | href="${h.url_replace(diffmode='sideside')}"> | |||
|
398 | <span>${_('Side by Side')}</span> | |||
|
399 | </a> | |||
|
400 | <a | |||
|
401 | class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip" | |||
|
402 | title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}"> | |||
|
403 | <span>${_('Unified')}</span> | |||
|
404 | </a> | |||
|
405 | </div> | |||
|
406 | </div> | |||
|
407 | <div class="pull-left"> | |||
|
408 | <div class="btn-group"> | |||
|
409 | <a | |||
|
410 | class="btn" | |||
|
411 | href="#" | |||
|
412 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All')}</a> | |||
|
413 | <a | |||
|
414 | class="btn" | |||
|
415 | href="#" | |||
|
416 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All')}</a> | |||
|
417 | </div> | |||
|
418 | </div> | |||
|
419 | </div> | |||
|
420 | </%def> No newline at end of file |
@@ -249,6 +249,7 b'' | |||||
249 | <div id="changeset_compare_view_content"> |
|
249 | <div id="changeset_compare_view_content"> | |
250 | ##CS |
|
250 | ##CS | |
251 | <%include file="compare_commits.html"/> |
|
251 | <%include file="compare_commits.html"/> | |
|
252 | ${cbdiffs.render_diffset_menu()} | |||
252 | ${cbdiffs.render_diffset(c.diffset)} |
|
253 | ${cbdiffs.render_diffset(c.diffset)} | |
253 | </div> |
|
254 | </div> | |
254 | %endif |
|
255 | %endif |
General Comments 0
You need to be logged in to leave comments.
Login now