Mercurial > kallithea
changeset 6120:471e85b3e766
files: use revision in Edit and Delete links
Branch names can contain '/' and can't generally be encoded in URLs.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 12 Aug 2016 03:04:48 +0200 |
parents | 91b38dc6d891 |
children | 6c02cd3efdd6 |
files | kallithea/templates/files/files_source.html |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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'))}