Changeset - 74364824c1e1
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-09-01 21:33:31
marcin@python-works.com
Hide add/delete pull request members when you don't have permission for it
2 files changed with 20 insertions and 14 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html
Show inline comments
 
@@ -4,16 +4,18 @@
 
    %if c.my_pull_requests:
 
      %for pull_request in c.my_pull_requests:
 
      <li>
 
      <div style="float:left">
 
      <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
      ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
 
      </a>
 
      </div>
 
      <div style="float:left;margin-top: -5px">
 
        ${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()}
 
     </div>      
 
        <div style="height: 12px">
 
          <div style="float:left">
 
          <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
          ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
 
          </a>
 
          </div>
 
          <div style="float:left;margin-top: -5px">
 
            ${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()}
 
          </div>
 
        </div>
 
      </li>
 
      %endfor
 
   %else:
 
@@ -26,9 +28,11 @@
 
    %if c.my_pull_requests:
 
      %for pull_request in c.participate_in_pull_requests:
 
      <li>
 
      <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
      ${_('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))}
 
      </a>
 
        <div style="height: 12px">
 
        <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
        ${_('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))}
 
        </a>
 
      </div>
 
      </li>
 
      %endfor
 
    %else:
rhodecode/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -93,7 +93,7 @@
 
                  <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
 
                  <div style="float:left">${member.full_name} (${_('owner')})</div>
 
                  <input type="hidden" value="${member.user_id}" name="review_members" />
 
                  %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):
 
                  <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span>
 
                  %endif
 
                </div>
 
@@ -103,6 +103,7 @@
 
          </div>
 
          %if not c.pull_request.is_closed():
 
          <div class='ac'>
 
            %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id:
 
            <div class="reviewer_ac">
 
               ${h.text('user', class_='yui-ac-input')}
 
               <span class="help-block">${_('Add reviewer to this pull request.')}</span>
 
@@ -111,6 +112,7 @@
 
            <div style="padding:0px 10px">
 
             <span id="update_pull_request" class="ui-btn xsmall">${_('save')}</span>
 
            </div>
 
            %endif
 
          </div>
 
          %endif
 
        </div>
0 comments (0 inline, 0 general)