changeset 1313:856be614d9a4 beta

disabled edition of binary files
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 04 May 2011 19:19:00 +0200
parents 70a5a9a57864
children 4947f5d61fac
files rhodecode/controllers/files.py rhodecode/templates/files/files_annotate.html rhodecode/templates/files/files_source.html
diffstat 3 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/files.py	Wed May 04 19:06:56 2011 +0200
+++ b/rhodecode/controllers/files.py	Wed May 04 19:19:00 2011 +0200
@@ -221,6 +221,10 @@
         c.cs = self.__get_cs_or_redirect(revision, repo_name)
         c.file = self.__get_filenode_or_redirect(repo_name, c.cs, f_path)
 
+        if c.file.is_binary:
+            return redirect(url('files_home', repo_name=c.repo_name,
+                         revision=c.cs.raw_id, f_path=f_path))
+
         c.file_history = self._get_node_history(c.cs, f_path)
         c.f_path = f_path
 
--- a/rhodecode/templates/files/files_annotate.html	Wed May 04 19:06:56 2011 +0200
+++ b/rhodecode/templates/files/files_annotate.html	Wed May 04 19:19:00 2011 +0200
@@ -44,9 +44,11 @@
 						h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
 					/ ${h.link_to(_('download as raw'),
 						h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
-                    % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):                    
+                    % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
+                     % if not c.file.is_binary:                   
                     / ${h.link_to(_('edit'),
                         h.url('files_edit_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
+                     % endif 
                     % endif						
 				</dd>
 			    <dt>${_('History')}</dt>
--- a/rhodecode/templates/files/files_source.html	Wed May 04 19:06:56 2011 +0200
+++ b/rhodecode/templates/files/files_source.html	Wed May 04 19:19:00 2011 +0200
@@ -16,8 +16,10 @@
 		 / ${h.link_to(_('download as raw'),
 			h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
         % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):			
+         % if not c.files_list.is_binary:
          / ${h.link_to(_('edit'),
             h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
+         % endif
         % endif			
 	</dd>
 	<dt>${_('History')}</dt>