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