Changeset - 856be614d9a4
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2011-05-04 19:19:00
marcin@python-works.com
disabled edition of binary files
3 files changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -218,12 +218,16 @@ class FilesController(BaseRepoController
 
    def edit(self, repo_name, revision, f_path):
 
        r_post = request.POST
 

	
 
        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
 

	
 
        if r_post:
 

	
 
            old_content = c.file.content
rhodecode/templates/files/files_annotate.html
Show inline comments
 
@@ -41,15 +41,17 @@
 
				<dd>${h.link_to(_('show source'),
 
						h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}  
 
					/ ${h.link_to(_('show as raw'),
 
						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>
 
			    <dd>
 
			        <div>
 
			        ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
rhodecode/templates/files/files_source.html
Show inline comments
 
@@ -13,14 +13,16 @@
 
			h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
 
		 / ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.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.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>
 
	<dd>
 
		<div>
 
		${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
0 comments (0 inline, 0 general)