Changeset - 0f9a48e0adc3
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 11 years ago 2015-03-03 21:44:27
thomas.de.schampheleire@gmail.com
pullrequest overview: create overview from a function to allow re-use

In anticipation of re-use of the pullrequest overview, create a def to
generate this overview given a list of pullrequests.

This also adds a check if the given list is empty, and a check if there is a
pager before displaying the paging links.
1 file changed with 15 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/pullrequests/pullrequest_data.html
Show inline comments
 
## -*- 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>
 
@@ -12,7 +19,7 @@
 
        <th class="left">${_('To')}</th>
 
      </tr>
 
    </thead>
 
% for pr in c.pullrequests_pager:
 
% for pr in pullrequests:
 
    <tr class="${'pr-closed' if pr.is_closed() else ''}">
 
      <td>
 
        %if pr.last_review_status:
 
@@ -52,8 +59,14 @@
 
  </table>
 
</div>
 

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

	
 
</%def>
 

	
 
${pullrequest_overview(c.pullrequests_pager)}
0 comments (0 inline, 0 general)