##// END OF EJS Templates
fixed binary file issues
marcink -
r1043:6ec53c16 beta
parent child Browse files
Show More
@@ -224,12 +224,16 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,14 +63,15
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
72 </div>
73 </div>
74 <script type="text/javascript">
75 <script type="text/javascript">
75 YAHOO.util.Event.onDOMReady(function(){
76 YAHOO.util.Event.onDOMReady(function(){
76 YAHOO.util.Event.addListener('show_rev','click',function(e){
77 YAHOO.util.Event.addListener('show_rev','click',function(e){
@@ -81,6 +82,9
81 });
82 });
82 });
83 });
83 </script>
84 </script>
85 %endif
86 </div>
87 </div>
84 </div>
88 </div>
85 </div>
89 </div>
86 </div>
90 </div>
@@ -36,6 +36,9
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:
@@ -72,6 +75,7
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