changeset 4894:7eea0a7fbc7d

pullrequest overview: add delete button to own pull requests In anticipation of the re-use of the pullrequest overview to display 'my pullrequests', add a delete button to all pullrequests owned by the currently logged-in user. An explicit width is added to the column because the column is otherwise unnecessarily large.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Tue, 03 Mar 2015 22:26:19 +0100
parents 0f9a48e0adc3
children 780c1aab1357
files kallithea/templates/pullrequests/pullrequest_data.html
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/pullrequests/pullrequest_data.html	Tue Mar 03 21:44:27 2015 +0100
+++ b/kallithea/templates/pullrequests/pullrequest_data.html	Tue Mar 03 22:26:19 2015 +0100
@@ -21,12 +21,26 @@
     </thead>
 % for pr in pullrequests:
     <tr class="${'pr-closed' if pr.is_closed() else ''}">
-      <td>
+      <td width="60px">
+        ## review status
         %if pr.last_review_status:
           <i class="icon-circle changeset-status-${pr.last_review_status}" title="${_("Someone voted: %s") % pr.last_review_status}"></i>
         %else:
           <i class="icon-circle changeset-status-not_reviewed" title="${_("Nobody voted")}"></i>
         %endif
+
+        ## delete button
+        %if pr.author.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),method='delete', 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')}');">
+            <i class="icon-minus-circled"></i>
+          </button>
+          ${h.end_form()}
+        %endif
       </td>
       <td>
         <a href="${pr.url()}">