diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -16,6 +16,7 @@ <%def name="main()"> +<% editable = not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.author.user_id == c.authuser.user_id) %> ${self.repo_context_bar('showpullrequest')}
@@ -35,7 +36,7 @@ ${self.repo_context_bar('showpullrequest
- %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.authuser.user_id): + %if editable:
${_("Edit")}
@@ -46,7 +47,7 @@ ${self.repo_context_bar('showpullrequest
- %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.authuser.user_id): + %if editable: - %if c.available and not c.pull_request.is_closed(): + %if editable and c.available:
${h.submit('copy_update',_('Create Pull Request Update'),class_="btn btn-small")}
@@ -220,7 +221,7 @@ ${self.repo_context_bar('showpullrequest
gravatar
${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})
- %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.user_id == c.authuser.user_id): + %if editable:
@@ -230,9 +231,8 @@ ${self.repo_context_bar('showpullrequest %endfor
- %if not c.pull_request.is_closed(): + %if editable:
- %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.author.user_id == c.authuser.user_id:
${h.text('user', class_='yui-ac-input',placeholder=_('Type name of reviewer to add'))}
@@ -240,7 +240,6 @@ ${self.repo_context_bar('showpullrequest
${_('Save Changes')}
- %endif
%endif
@@ -359,7 +358,7 @@ ${self.repo_context_bar('showpullrequest if (window.location.hash != "") { window.location.href = window.location.href; } - }) + });