Show More
@@ -224,12 +224,16 b' class FilesController(BaseController):' | |||||
224 | elif c.action == 'diff': |
|
224 | elif c.action == 'diff': | |
225 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: |
|
225 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: | |
226 | c.cur_diff = _('Diff is to big to display') |
|
226 | c.cur_diff = _('Diff is to big to display') | |
|
227 | elif node1.is_binary or node2.is_binary: | |||
|
228 | c.cur_diff = _('Binary file') | |||
227 | else: |
|
229 | else: | |
228 | c.cur_diff = diff.as_html() |
|
230 | c.cur_diff = diff.as_html() | |
229 | else: |
|
231 | else: | |
230 | #default option |
|
232 | #default option | |
231 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: |
|
233 | if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: | |
232 | c.cur_diff = _('Diff is to big to display') |
|
234 | c.cur_diff = _('Diff is to big to display') | |
|
235 | elif node1.is_binary or node2.is_binary: | |||
|
236 | c.cur_diff = _('Binary file') | |||
233 | else: |
|
237 | else: | |
234 | c.cur_diff = diff.as_html() |
|
238 | c.cur_diff = diff.as_html() | |
235 |
|
239 |
@@ -63,24 +63,28 b'' | |||||
63 | <div class="commit">"${c.file.message}"</div> |
|
63 | <div class="commit">"${c.file.message}"</div> | |
64 | </div> |
|
64 | </div> | |
65 | <div class="code-body"> |
|
65 | <div class="code-body"> | |
|
66 | %if c.file.is_binary: | |||
|
67 | ${_('Binary file')} | |||
|
68 | %else: | |||
66 | % if c.file.size < c.cut_off_limit: |
|
69 | % if c.file.size < c.cut_off_limit: | |
67 | ${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} |
|
70 | ${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} | |
68 | %else: |
|
71 | %else: | |
69 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), |
|
72 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), | |
70 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path))} |
|
73 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path))} | |
71 |
%endif |
|
74 | %endif | |
|
75 | <script type="text/javascript"> | |||
|
76 | YAHOO.util.Event.onDOMReady(function(){ | |||
|
77 | YAHOO.util.Event.addListener('show_rev','click',function(e){ | |||
|
78 | YAHOO.util.Event.preventDefault(e); | |||
|
79 | var cs = YAHOO.util.Dom.get('diff1').value; | |||
|
80 | var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); | |||
|
81 | window.location = url; | |||
|
82 | }); | |||
|
83 | }); | |||
|
84 | </script> | |||
|
85 | %endif | |||
72 | </div> |
|
86 | </div> | |
73 | </div> |
|
87 | </div> | |
74 | <script type="text/javascript"> |
|
|||
75 | YAHOO.util.Event.onDOMReady(function(){ |
|
|||
76 | YAHOO.util.Event.addListener('show_rev','click',function(e){ |
|
|||
77 | YAHOO.util.Event.preventDefault(e); |
|
|||
78 | var cs = YAHOO.util.Dom.get('diff1').value; |
|
|||
79 | var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); |
|
|||
80 | window.location = url; |
|
|||
81 | }); |
|
|||
82 | }); |
|
|||
83 | </script> |
|
|||
84 | </div> |
|
88 | </div> | |
85 | </div> |
|
89 | </div> | |
86 | </div> |
|
90 | </div> |
@@ -36,6 +36,9 b'' | |||||
36 | <div class="commit">"${c.files_list.last_changeset.message}"</div> |
|
36 | <div class="commit">"${c.files_list.last_changeset.message}"</div> | |
37 | </div> |
|
37 | </div> | |
38 | <div class="code-body"> |
|
38 | <div class="code-body"> | |
|
39 | %if c.files_list.is_binary: | |||
|
40 | ${_('Binary file')} | |||
|
41 | %else: | |||
39 | % if c.files_list.size < c.cut_off_limit: |
|
42 | % if c.files_list.size < c.cut_off_limit: | |
40 | ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
43 | ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
41 | %else: |
|
44 | %else: | |
@@ -71,7 +74,8 b'' | |||||
71 | } |
|
74 | } | |
72 | highlight_lines(h_lines); |
|
75 | highlight_lines(h_lines); | |
73 | } |
|
76 | } | |
74 |
</script> |
|
77 | </script> | |
|
78 | %endif | |||
75 | </div> |
|
79 | </div> | |
76 | </div> |
|
80 | </div> | |
77 |
|
81 |
General Comments 0
You need to be logged in to leave comments.
Login now