Show More
@@ -1,80 +1,91 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 | <%def name="js_extra()"> |
|
5 | <%def name="js_extra()"> | |
6 | <script type="text/javascript" src="${h.url('/js/jquery.1.10.1.min.js')}"></script> |
|
6 | <script type="text/javascript" src="${h.url('/js/jquery.1.10.1.min.js')}"></script> | |
7 | <script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script> |
|
7 | <script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script> | |
8 | <script type="text/javascript" src="${h.url('/js/mergerly.js')}"></script> |
|
8 | <script type="text/javascript" src="${h.url('/js/mergerly.js')}"></script> | |
9 | </%def> |
|
9 | </%def> | |
10 | <%def name="css_extra()"> |
|
10 | <%def name="css_extra()"> | |
11 | <link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/> |
|
11 | <link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/> | |
12 | <link rel="stylesheet" type="text/css" href="${h.url('/css/mergerly.css')}"/> |
|
12 | <link rel="stylesheet" type="text/css" href="${h.url('/css/mergerly.css')}"/> | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%def name="title()"> |
|
15 | <%def name="title()"> | |
16 | ${_('%s File side-by-side diff') % c.repo_name} · ${c.rhodecode_name} |
|
16 | ${_('%s File side-by-side diff') % c.repo_name} · ${c.rhodecode_name} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%def name="breadcrumbs_links()"> |
|
19 | <%def name="breadcrumbs_links()"> | |
20 | ${_('File diff')} r${c.changeset_1.revision}:${h.short_id(c.changeset_1.raw_id)} → r${c.changeset_2.revision}:${h.short_id(c.changeset_2.raw_id)} |
|
20 | ${_('File diff')} r${c.changeset_1.revision}:${h.short_id(c.changeset_1.raw_id)} → r${c.changeset_2.revision}:${h.short_id(c.changeset_2.raw_id)} | |
21 | </%def> |
|
21 | </%def> | |
22 |
|
22 | |||
23 | <%def name="page_nav()"> |
|
23 | <%def name="page_nav()"> | |
24 | ${self.menu('repositories')} |
|
24 | ${self.menu('repositories')} | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%def name="main()"> |
|
27 | <%def name="main()"> | |
28 | ${self.repo_context_bar('changelog')} |
|
28 | ${self.repo_context_bar('changelog')} | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | <div class="diff-container" style="overflow-x: hidden"> |
|
35 | <div class="diff-container" style="overflow-x: hidden"> | |
36 | <div class="diffblock comm" style="margin:3px; padding:1px"> |
|
36 | <div class="diffblock comm" style="margin:3px; padding:1px"> | |
37 | <div class="code-header"> |
|
37 | <div class="code-header"> | |
38 | <div class="changeset_header"> |
|
38 | <div class="changeset_header"> | |
39 | <div class="changeset_file"> |
|
39 | <div class="changeset_file"> | |
40 | ${h.link_to(h.safe_unicode(c.node1.path),h.url('files_home',repo_name=c.repo_name, |
|
40 | ${h.link_to(h.safe_unicode(c.node1.path),h.url('files_home',repo_name=c.repo_name, | |
41 | revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))} |
|
41 | revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))} | |
42 | </div> |
|
42 | </div> | |
43 | <div class="diff-actions"> |
|
43 | <div class="diff-actions"> | |
44 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full diff for this file'))}"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a> |
|
44 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full diff for this file'))}"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a> | |
45 | <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}"><img class="icon" src="${h.url('/images/icons/application_double.png')}"/></a> |
|
45 | <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}"><img class="icon" src="${h.url('/images/icons/application_double.png')}"/></a> | |
46 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a> |
|
46 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a> | |
47 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"><img class="icon" src="${h.url('/images/icons/page_save.png')}"/></a> |
|
47 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"><img class="icon" src="${h.url('/images/icons/page_save.png')}"/></a> | |
48 | ##${c.ignorews_url(request.GET, h.FID(c.cs2,path))} |
|
48 | ${h.checkbox('ignorews', label=_('ignore white space'))} | |
49 | ##${c.context_url(request.GET, h.FID(c.cs2,path))} |
|
49 | ${h.checkbox('edit_mode', label=_('turn on edit mode'))} | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 | </div> |
|
52 | </div> | |
53 | <div id="compare"></div> |
|
53 | <div id="compare"></div> | |
54 | </div> |
|
54 | </div> | |
55 | </div> |
|
55 | </div> | |
56 |
|
56 | |||
57 | <script> |
|
57 | <script> | |
58 | var orig1 = '${(c.orig1)|n}'; |
|
58 | var orig1 = '${(c.orig1)|n}'; | |
59 | var orig2 = '${(c.orig2)|n}'; |
|
59 | var orig2 = '${(c.orig2)|n}'; | |
60 |
|
60 | |||
61 | $(document).ready(function () { |
|
61 | $(document).ready(function () { | |
62 | $('#compare').mergely({ |
|
62 | $('#compare').mergely({ | |
63 | width: 'auto', |
|
63 | width: 'auto', | |
64 | height: '600', |
|
64 | height: '600', | |
65 | fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, |
|
65 | fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, | |
66 | bgcolor: '#fff', |
|
66 | bgcolor: '#fff', | |
67 | viewport: true, |
|
67 | viewport: true, | |
68 | cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true}, |
|
68 | cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true}, | |
69 | lhs: function(setValue) { |
|
69 | lhs: function(setValue) { | |
70 | setValue(orig1); |
|
70 | setValue(orig1); | |
71 | }, |
|
71 | }, | |
72 | rhs: function(setValue) { |
|
72 | rhs: function(setValue) { | |
73 | setValue(orig2); |
|
73 | setValue(orig2); | |
74 | }, |
|
74 | }, | |
75 | }); |
|
75 | }); | |
|
76 | $('#ignorews').change(function(e){ | |||
|
77 | var val = e.currentTarget.checked; | |||
|
78 | $('#compare').mergely('options', {ignorews: val}); | |||
|
79 | $('#compare').mergely('update'); | |||
|
80 | }) | |||
|
81 | $('#edit_mode').change(function(e){ | |||
|
82 | var val = !e.currentTarget.checked; | |||
|
83 | $('#compare').mergely('cm', 'lhs').setOption('readOnly', val); | |||
|
84 | $('#compare').mergely('cm', 'rhs').setOption('readOnly', val); | |||
|
85 | $('#compare').mergely('update'); | |||
|
86 | }) | |||
76 | }); |
|
87 | }); | |
77 | </script> |
|
88 | </script> | |
78 |
|
89 | |||
79 | </div> |
|
90 | </div> | |
80 | </%def> |
|
91 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now