diff rhodecode/templates/changeset/changeset_range.html @ 1176:014c9a58a0d9 beta

fixes for issues #137 and #116 safe_unicode is now default for handling file names
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 24 Mar 2011 16:35:53 +0100
parents e7d7f05217c1
children d4ced3a7ee2a
line wrap: on
line diff
--- a/rhodecode/templates/changeset/changeset_range.html	Wed Mar 23 20:58:12 2011 +0100
+++ b/rhodecode/templates/changeset/changeset_range.html	Thu Mar 24 16:35:53 2011 +0100
@@ -54,7 +54,7 @@
 	               %for cs in c.cs_ranges:
 	                   <div class="cur_cs">r${cs}</div>
 	                %for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]:
-	                    <div class="cs_${change}">${h.link_to(filenode.path.decode('utf-8','replace'),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path.decode('utf-8','replace')))))}</div>
+	                    <div class="cs_${change}">${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,h.safe_unicode(filenode.path)))))}</div>
 	                %endfor
 	               %endfor 
 	        </div>         
@@ -66,19 +66,19 @@
 		%if change !='removed':
 		<div style="clear:both;height:10px"></div>
 		<div class="diffblock">
-			<div id="${h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path.decode('utf-8','replace')))}" class="code-header">
+			<div id="${h.repo_name_slug('C%s-%s' % (cs.short_id,h.safe_unicode(filenode.path)))}" class="code-header">
 				<div class="changeset_header">
 					<span class="changeset_file">
-						${h.link_to_if(change!='removed',filenode.path.decode('utf-8','replace'),h.url('files_home',repo_name=c.repo_name,
-						revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8','replace')))}
+						${h.link_to_if(change!='removed',h.safe_unicode(filenode.path,h.url('files_home',repo_name=c.repo_name,
+						revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))}
 					</span>
 					%if 1:
 					&raquo; <span>${h.link_to(_('diff'),
-					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='diff'))}</span>
+					h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</span>
 					&raquo; <span>${h.link_to(_('raw diff'),
-					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='raw'))}</span>
+					h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</span>
 					&raquo; <span>${h.link_to(_('download diff'),
-					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='download'))}</span>
+					h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</span>
 					%endif
 				</div>
 			</div>