view kallithea/templates/pullrequests/pullrequest_data.html @ 6091:e8136195daf0

routing: use POST to 'pullrequest_delete' instead of DELETE
author Mads Kiilerich <madski@unity3d.com>
date Thu, 04 Aug 2016 14:23:36 +0200
parents b027fc1a0e85
children e99a33d7d7f5
line wrap: on
line source

## -*- coding: utf-8 -*-

<%def name="pullrequest_overview(pullrequests)">

%if not len(pullrequests):
    <div class="normal-indent empty_data">${_('No entries')}</div>
    <% return %>
%endif

<div class="table">
  <table>
    <thead>
      <tr>
        <th class="left">${_('Vote')}</th>
        <th class="left">${_('Title')}</th>
        <th class="left">${_('Owner')}</th>
        <th class="left">${_('Age')}</th>
        <th class="left">${_('From')}</th>
        <th class="left">${_('To')}</th>
        <th class="right" style="padding-right:5px">${_('Delete')}</th>
      </tr>
    </thead>
% for pr in pullrequests:
    <tr class="${'pr-closed' if pr.is_closed() else ''}">
      <td width="80px">
        <% status = pr.user_review_status(c.authuser.user_id) %>
        %if status:
          <i class="icon-circle changeset-status-${status}" title="${_("You voted: %s") % h.changeset_status_lbl(status)}"></i>
        %else:
          <i class="icon-circle changeset-status-not_reviewed" title="${_("You didn't vote")}"></i>
        %endif
      </td>
      <td>
        <a href="${pr.url()}">
        ${pr.title or _("(no title)")}
        %if pr.is_closed():
          <span class="pr-closed-tag">${_('Closed')}</span>
        %endif
        </a>
      </td>
      <td>
        ${pr.owner.full_name_and_username}
      </td>
      <td>
        <span class="tooltip" title="${h.fmt_date(pr.created_on)}">
          ${h.age(pr.created_on)}
        </span>
      </td>
      <td>
        <% org_ref_name=pr.org_ref.rsplit(':', 2)[-2] %>
        <a href="${h.url('summary_home', repo_name=pr.org_repo.repo_name, anchor=org_ref_name)}">
          ${pr.org_repo.repo_name}#${org_ref_name}
        </a>
      </td>
      <td>
        <% other_ref_name=pr.other_ref.rsplit(':', 2)[-2] %>
        <a href="${h.url('summary_home', repo_name=pr.other_repo.repo_name, anchor=other_ref_name)}">
          ${pr.other_repo.repo_name}#${other_ref_name}
        </a>
      </td>
      <td style="text-align:right">
        %if pr.owner.user_id == c.authuser.user_id:
          ${h.form(url('pullrequest_delete', repo_name=pr.other_repo.repo_name, pull_request_id=pr.pull_request_id), style="display:inline-block")}
          <button class="action_button"
                  id="remove_${pr.pull_request_id}"
                  name="remove_${pr.pull_request_id}"
                  title="${_('Delete Pull Request')}"
                  onclick="return confirm('${_('Confirm to delete this pull request')}')
                      && ((${len(pr.comments)} == 0) ||
                          confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}'))
                      ">
            <i class="icon-minus-circled"></i>
          </button>
          ${h.end_form()}
        %endif
      </td>
    </tr>
% endfor
  </table>
</div>

%if hasattr(pullrequests, 'pager'):
<div class="notification-paginator">
  <div class="pagination-wh pagination-left">
  ${pullrequests.pager('$link_previous ~2~ $link_next', **request.GET.mixed())}
  </div>
</div>
%endif

</%def>