# HG changeset patch # User Marcin Kuzminski # Date 2012-09-01 21:33:31 # Node ID 74364824c1e199fc4bb5d83a6435a755b990e78d # Parent 52617fb79010eec4c6eb95c43f7f0af1ba95f164 Hide add/delete pull request members when you don't have permission for it diff --git a/rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html b/rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html --- a/rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html +++ b/rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html @@ -4,16 +4,18 @@ %if c.my_pull_requests: %for pull_request in c.my_pull_requests:
  • -
    - - ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))} - -
    -
    - ${h.form(url('pullrequest_delete', repo_name=pull_request.other_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete')} - ${h.submit('remove_%s' % pull_request.pull_request_id,'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} - ${h.end_form()} -
    +
    +
    + + ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))} + +
    +
    + ${h.form(url('pullrequest_delete', repo_name=pull_request.other_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete')} + ${h.submit('remove_%s' % pull_request.pull_request_id,'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} + ${h.end_form()} +
    +
  • %endfor %else: @@ -26,9 +28,11 @@ %if c.my_pull_requests: %for pull_request in c.participate_in_pull_requests:
  • - - ${_('Pull request #%s opened by %s on %s') % (pull_request.pull_request_id, pull_request.author.full_name, h.fmt_date(pull_request.created_on))} - +
    + + ${_('Pull request #%s opened by %s on %s') % (pull_request.pull_request_id, pull_request.author.full_name, h.fmt_date(pull_request.created_on))} + +
  • %endfor %else: diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -93,7 +93,7 @@
    gravatar
    ${member.full_name} (${_('owner')})
    - %if not c.pull_request.is_closed(): + %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id): %endif @@ -103,6 +103,7 @@ %if not c.pull_request.is_closed():
    + %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id:
    ${h.text('user', class_='yui-ac-input')} ${_('Add reviewer to this pull request.')} @@ -111,6 +112,7 @@
    ${_('save')}
    + %endif
    %endif