# HG changeset patch # User Mads Kiilerich # Date 2017-06-25 18:49:21 # Node ID b56aa0ea353157f75dd23147bcd1b1c2270fdb71 # Parent f46709f6fef50adff8340e6c40fb55a9e3e8efdc 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.) diff --git a/kallithea/lib/page.py b/kallithea/lib/page.py --- a/kallithea/lib/page.py +++ b/kallithea/lib/page.py @@ -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('' % (_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='', page_param='page', partial_param='partial', show_if_single_page=False, separator=' ', onclick=None, symbol_first='<<', symbol_last='>>', symbol_previous='<', symbol_next='>', 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 @@ -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; diff --git a/kallithea/templates/admin/admin_log.html b/kallithea/templates/admin/admin_log.html --- a/kallithea/templates/admin/admin_log.html +++ b/kallithea/templates/admin/admin_log.html @@ -55,9 +55,8 @@ }); - +${c.users_log.pager()} + %else: ${_('No actions yet')} %endif diff --git a/kallithea/templates/admin/gists/index.html b/kallithea/templates/admin/gists/index.html --- a/kallithea/templates/admin/gists/index.html +++ b/kallithea/templates/admin/gists/index.html @@ -61,10 +61,7 @@
${gist.gist_description}
% endfor - - + ${c.gists_pager.pager(**request.GET.mixed())} %else:
${_('There are no gists yet')}
%endif diff --git a/kallithea/templates/admin/notifications/notifications_data.html b/kallithea/templates/admin/notifications/notifications_data.html --- a/kallithea/templates/admin/notifications/notifications_data.html +++ b/kallithea/templates/admin/notifications/notifications_data.html @@ -16,11 +16,7 @@ %endfor - - - +${c.notifications.pager(controller='admin/notifications', **request.GET.mixed())} %else:
${_('No notifications here yet')}
%endif diff --git a/kallithea/templates/changelog/changelog.html b/kallithea/templates/changelog/changelog.html --- a/kallithea/templates/changelog/changelog.html +++ b/kallithea/templates/changelog/changelog.html @@ -175,9 +175,7 @@ ${self.repo_context_bar('changelog', c.f - + ${c.pagination.pager()}