Changeset - b56aa0ea3531
[Not reviewed]
default
0 14 0
Mads Kiilerich - 8 years ago 2017-06-25 18:49:21
mads@kiilerich.com
pagination: avoid superfluous margins - especially when pages are short and pagination isn't shown

Change our webhelpers paginator wrapper to emit full UL (or nothing) instead of
just ILs.

(Browsers still render extra space below the paginator - that is an artifact of
how Bootstrap use inline on the ILs.)
14 files changed with 20 insertions and 42 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/page.py
Show inline comments
 
@@ -23,7 +23,7 @@ from webhelpers.paginate import Page as 
 

	
 
class Page(_Page):
 
    """
 
    Custom pager to match rendering style with YUI paginator
 
    Custom pager to match rendering style with YUI paginator emitting Bootstrap paginators
 
    """
 

	
 
    def __init__(self, *args, **kwargs):
 
@@ -114,7 +114,7 @@ class Page(_Page):
 
        #nav_items.append(literal('<link rel="prefetch" href="%s?page=%s">' % (_page_link, str(int(self.page)+1))))
 
        return self.separator.join(nav_items)
 

	
 
    def pager(self, format='$link_previous ~2~ $link_next', page_param='page', partial_param='partial',
 
    def pager(self, format='<ul class="pagination">$link_previous ~2~ $link_next</ul>', page_param='page', partial_param='partial',
 
        show_if_single_page=False, separator=' ', onclick=None,
 
        symbol_first='<<', symbol_last='>>',
 
        symbol_previous='<', symbol_next='>',
kallithea/public/css/style.css
Show inline comments
 
@@ -677,6 +677,10 @@ div.panel.panel-default div.panel-headin
 
    padding: 0;
 
}
 

	
 
#content div.panel ul.pagination {
 
    margin: 10px 0 0 0;
 
}
 

	
 
#content div.panel ul.pagination > li > a,
 
#content div.panel ul.pagination > li > span {
 
    background: #ebebeb url("../images/pager.png") repeat-x;
kallithea/templates/admin/admin_log.html
Show inline comments
 
@@ -55,9 +55,8 @@
 
  });
 
</script>
 

	
 
<ul class="pagination">
 
    ${c.users_log.pager()}
 
</ul>
 
${c.users_log.pager()}
 

	
 
%else:
 
    ${_('No actions yet')}
 
%endif
kallithea/templates/admin/gists/index.html
Show inline comments
 
@@ -61,10 +61,7 @@
 
            <div class="text-muted">${gist.gist_description}</div>
 
          </div>
 
        % endfor
 

	
 
        <ul class="pagination">
 
            ${c.gists_pager.pager(**request.GET.mixed())}
 
        </ul>
 
        ${c.gists_pager.pager(**request.GET.mixed())}
 
      %else:
 
        <div>${_('There are no gists yet')}</div>
 
      %endif
kallithea/templates/admin/notifications/notifications_data.html
Show inline comments
 
@@ -16,11 +16,7 @@
 
  </div>
 
%endfor
 
</div>
 

	
 
<ul class="pagination">
 
    ${c.notifications.pager(controller='admin/notifications', **request.GET.mixed())}
 
</ul>
 

	
 
${c.notifications.pager(controller='admin/notifications', **request.GET.mixed())}
 
%else:
 
    <div>${_('No notifications here yet')}</div>
 
%endif
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -175,9 +175,7 @@ ${self.repo_context_bar('changelog', c.f
 

	
 
                </div>
 

	
 
                <ul class="pagination">
 
                    ${c.pagination.pager()}
 
                </ul>
 
                ${c.pagination.pager()}
 

	
 
        <script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script>
 
        <script type="text/javascript">
kallithea/templates/changelog/changelog_summary_data.html
Show inline comments
 
@@ -71,9 +71,8 @@
 

	
 
</table>
 

	
 
<ul class="pagination">
 
    ${c.repo_changesets.pager()}
 
</ul>
 
${c.repo_changesets.pager()}
 

	
 
%else:
 

	
 
%if h.HasRepoPermissionLevel('write')(c.repo_name):
kallithea/templates/followers/followers_data.html
Show inline comments
 
@@ -12,6 +12,4 @@
 
    </div>
 
% endfor
 

	
 
<ul class="pagination">
 
    ${c.followers_pager.pager()}
 
</ul>
 
${c.followers_pager.pager()}
kallithea/templates/forks/forks_data.html
Show inline comments
 
@@ -19,9 +19,7 @@
 
            </div>
 
        </div>
 
    % endfor
 
    <ul class="pagination">
 
        ${c.forks_pager.pager()}
 
    </ul>
 
    ${c.forks_pager.pager()}
 
% else:
 
    ${_('There are no forks yet')}
 
% endif
kallithea/templates/journal/journal_data.html
Show inline comments
 
@@ -36,10 +36,7 @@
 
            </div>
 
        %endfor
 
    %endfor
 

	
 
    <ul class="pagination">
 
        ${c.journal_pager.pager()}
 
    </ul>
 
    ${c.journal_pager.pager()}
 
%else:
 
  <div>
 
      ${_('No entries yet')}
kallithea/templates/pullrequests/pullrequest_data.html
Show inline comments
 
@@ -80,9 +80,7 @@
 
</div>
 

	
 
%if hasattr(pullrequests, 'pager'):
 
    <ul class="pagination">
 
        ${pullrequests.pager(**request.GET.mixed())}
 
    </ul>
 
    ${pullrequests.pager(**request.GET.mixed())}
 
%endif
 

	
 
</%def>
kallithea/templates/search/search_commit.html
Show inline comments
 
@@ -32,7 +32,5 @@
 
    %endif
 
%endfor
 
%if c.cur_query and c.formated_results:
 
    <ul class="pagination">
 
        ${c.formated_results.pager()}
 
    </ul>
 
    ${c.formated_results.pager()}
 
%endif
kallithea/templates/search/search_content.html
Show inline comments
 
@@ -20,7 +20,5 @@
 
    %endif
 
%endfor
 
%if c.cur_query and c.formated_results:
 
    <ul class="pagination">
 
        ${c.formated_results.pager()}
 
    </ul>
 
    ${c.formated_results.pager()}
 
%endif
kallithea/templates/search/search_path.html
Show inline comments
 
@@ -17,7 +17,5 @@
 
    %endif
 
%endfor
 
%if c.cur_query and c.formated_results:
 
    <ul class="pagination">
 
        ${c.formated_results.pager()}
 
    </ul>
 
    ${c.formated_results.pager()}
 
%endif
0 comments (0 inline, 0 general)