# HG changeset patch # User Mads Kiilerich # Date 1470963888 -7200 # Node ID 471e85b3e76695e2d57384b7215ca2ed0fac9560 # Parent 91b38dc6d8916171c250a036dd389fea8ccf376d files: use revision in Edit and Delete links Branch names can contain '/' and can't generally be encoded in URLs. diff -r 91b38dc6d891 -r 471e85b3e766 kallithea/templates/files/files_source.html --- a/kallithea/templates/files/files_source.html Wed Aug 03 16:07:39 2016 +0200 +++ b/kallithea/templates/files/files_source.html Fri Aug 12 03:04:48 2016 +0200 @@ -34,12 +34,12 @@ ${h.link_to(_('Show as Raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id,f_path=c.f_path),class_="btn btn-mini")} ${h.link_to(_('Download as Raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id,f_path=c.f_path),class_="btn btn-mini")} % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): - %if c.on_branch_head and c.changeset.branch and not c.file.is_binary: - ${h.link_to(_('Edit on Branch:%s') % c.changeset.branch, h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.branch,f_path=c.f_path, anchor='edit'),class_="btn btn-mini")} - ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.branch,f_path=c.f_path, anchor='edit'),class_="btn btn-mini btn-danger")} - %elif c.on_branch_head and c.changeset.branch and c.file.is_binary: + %if c.on_branch_head and not c.file.is_binary: + ${h.link_to(_('Edit on Branch: %s') % c.changeset.branch, h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-mini")} + ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-mini btn-danger")} + %elif c.on_branch_head and c.file.is_binary: ${h.link_to(_('Edit'), '#', class_="btn btn-mini disabled tooltip", title=_('Editing binary files not allowed'))} - ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.branch,f_path=c.f_path, anchor='edit'),class_="btn btn-mini btn-danger")} + ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path, anchor='edit'),class_="btn btn-mini btn-danger")} %else: ${h.link_to(_('Edit'), '#', class_="btn btn-mini disabled tooltip", title=_('Editing files allowed only when on branch head revision'))} ${h.link_to(_('Delete'), '#', class_="btn btn-mini btn-danger disabled tooltip", title=_('Deleting files allowed only when on branch head revision'))}