[PATCH 5 of 6] pullrequest overview: remove custom handling of 'my pullrequests'

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Mar 3 16:40:32 EST 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1425415733 -3600
#      Tue Mar 03 21:48:53 2015 +0100
# Node ID 02c4f6d5f95731f75ddbf196b79100da8d80d46c
# Parent  f2607e13f8d763c6bdea3ce4da13cd33e7797120
pullrequest overview: remove custom handling of 'my pullrequests'

Re-use the same displaying code for the 'my pullrequests' overview as for
the repository pullrequests overview. Remove the now unused CSS styling as
well.

This removes the 'delete' button on the author's pullrequests. One could
argue whether the pullrequest overview is the right place for this button,
while it does not appear on the pull request page itself.

diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -4617,13 +4617,12 @@
 *****/
 .pullrequests_section_head {
     padding: 10px 10px 10px 0px;
+    margin: 0 20px;
     font-size: 16px;
     font-weight: bold;
 }
 
-div.pr-details-title.closed,
-#pullrequests_container li.closed div div
- {
+div.pr-details-title.closed {
     color: #555;
     background: #eee;
 }
@@ -4640,9 +4639,6 @@
 div.pr-desc {
     margin: 0px 20px;
 }
-div.pr-closed {
-    background-color: #eee;
-}
 tr.pr-closed td {
     background-color: #eee !important;
     color: #555 !important;
diff --git a/kallithea/templates/pullrequests/pullrequest_show_my.html b/kallithea/templates/pullrequests/pullrequest_show_my.html
--- a/kallithea/templates/pullrequests/pullrequest_show_my.html
+++ b/kallithea/templates/pullrequests/pullrequest_show_my.html
@@ -30,9 +30,7 @@
         </div>
     </div>
 
-    <div id="pullrequests_container" class="table">
-        <%include file='pullrequest_show_my_data.html'/>
-    </div>
+    <%include file='pullrequest_show_my_data.html'/>
 
 </div>
 </%def>
diff --git a/kallithea/templates/pullrequests/pullrequest_show_my_data.html b/kallithea/templates/pullrequests/pullrequest_show_my_data.html
--- a/kallithea/templates/pullrequests/pullrequest_show_my_data.html
+++ b/kallithea/templates/pullrequests/pullrequest_show_my_data.html
@@ -1,69 +1,7 @@
+<%namespace name="pullrequests" file="/pullrequests/pullrequest_data.html"/>
+
 <div class="pullrequests_section_head">${_('Pull Requests Created by Me')}</div>
-<ul>
-  %if c.my_pull_requests:
-    %for pull_request in c.my_pull_requests:
-      <li class="${'closed' if pull_request.is_closed() else ''}">
-        <div style="height: 12px">
-            %if pull_request.last_review_status:
-              <i class="icon-circle changeset-status-${pull_request.last_review_status}" title="${_("Someone voted: %s") % pull_request.last_review_status}"></i>
-            %else:
-              <i class="icon-circle changeset-status-not_reviewed" title="${_("Nobody voted")}"></i>
-            %endif
-            <a href="${pull_request.url()}">
-              ${pull_request.title or _("(no title)")}
-            </a>
-            ${_('created on %s from') % (h.fmt_date(pull_request.created_on))}
-            <% org_ref_name=pull_request.org_ref.rsplit(':', 2)[-2] %>
-            <a href="${h.url('summary_home', repo_name=pull_request.org_repo.repo_name, anchor=org_ref_name)}">
-              ${pull_request.org_repo.repo_name}#${org_ref_name}
-            </a>
-            %if pull_request.is_closed():
-              (${_('Closed')})
-            %endif
-            ${h.form(url('pullrequest_delete', repo_name=pull_request.other_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete', style="display:inline-block")}
-            <button class="action_button"
-                    id="remove_${pull_request.pull_request_id}"
-                    name="remove_${pull_request.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()}
-        </div>
-      </li>
-    %endfor
-  %else:
-    <li><span class="empty_data">${_('Nothing here yet')}</span></li>
-  %endif
-</ul>
+${pullrequests.pullrequest_overview(c.my_pull_requests)}
 
 <div class="pullrequests_section_head" style="clear:both">${_('Pull Requests I Participate In')}</div>
-<ul>
-  %if c.participate_in_pull_requests:
-    %for pull_request in c.participate_in_pull_requests:
-      <li class="${'closed' if pull_request.is_closed() else ''}">
-        <div style="height: 12px">
-            %if pull_request.last_review_status:
-              <i class="icon-circle changeset-status-${pull_request.last_review_status}" title="${_("Someone voted: %s") % pull_request.last_review_status}"></i>
-            %else:
-              <i class="icon-circle changeset-status-not_reviewed" title="${_("Nobody voted")}"></i>
-            %endif
-            <a href="${pull_request.url()}">
-              ${pull_request.title or _("(no title)")}
-            </a>
-            ${_('from')}
-            <% org_ref_name=pull_request.org_ref.rsplit(':', 2)[-2] %>
-            <a href="${h.url('summary_home', repo_name=pull_request.org_repo.repo_name, anchor=org_ref_name)}">
-              ${pull_request.org_repo.repo_name}#${org_ref_name}
-            </a>
-            ${_('created on %s') % (h.fmt_date(pull_request.created_on))}
-            %if pull_request.is_closed():
-              (${_('Closed')})
-            %endif
-        </div>
-      </li>
-    %endfor
-  %else:
-    <li><span class="empty_data">${_('Nothing here yet')}</span></li>
-  %endif
-</ul>
+${pullrequests.pullrequest_overview(c.participate_in_pull_requests)}


More information about the kallithea-general mailing list