# HG changeset patch # User Mads Kiilerich # Date 1498409361 -7200 # 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 -r f46709f6fef5 -r b56aa0ea3531 kallithea/lib/page.py --- a/kallithea/lib/page.py Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/lib/page.py Sun Jun 25 18:49:21 2017 +0200 @@ -23,7 +23,7 @@ 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 @@ #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 -r f46709f6fef5 -r b56aa0ea3531 kallithea/public/css/style.css --- a/kallithea/public/css/style.css Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/public/css/style.css Sun Jun 25 18:49:21 2017 +0200 @@ -677,6 +677,10 @@ 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 -r f46709f6fef5 -r b56aa0ea3531 kallithea/templates/admin/admin_log.html --- a/kallithea/templates/admin/admin_log.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/admin/admin_log.html Sun Jun 25 18:49:21 2017 +0200 @@ -55,9 +55,8 @@ }); - +${c.users_log.pager()} + %else: ${_('No actions yet')} %endif diff -r f46709f6fef5 -r b56aa0ea3531 kallithea/templates/admin/gists/index.html --- a/kallithea/templates/admin/gists/index.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/admin/gists/index.html Sun Jun 25 18:49:21 2017 +0200 @@ -61,10 +61,7 @@
${gist.gist_description}
% endfor - - + ${c.gists_pager.pager(**request.GET.mixed())} %else:
${_('There are no gists yet')}
%endif diff -r f46709f6fef5 -r b56aa0ea3531 kallithea/templates/admin/notifications/notifications_data.html --- a/kallithea/templates/admin/notifications/notifications_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/admin/notifications/notifications_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -16,11 +16,7 @@ %endfor - - - +${c.notifications.pager(controller='admin/notifications', **request.GET.mixed())} %else:
${_('No notifications here yet')}
%endif diff -r f46709f6fef5 -r b56aa0ea3531 kallithea/templates/changelog/changelog.html --- a/kallithea/templates/changelog/changelog.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/changelog/changelog.html Sun Jun 25 18:49:21 2017 +0200 @@ -175,9 +175,7 @@ - + ${c.pagination.pager()}