Mercurial > kallithea
changeset 6725:b56aa0ea3531
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.)
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 25 Jun 2017 18:49:21 +0200 |
parents | f46709f6fef5 |
children | 0d5be2668d7d |
files | kallithea/lib/page.py kallithea/public/css/style.css kallithea/templates/admin/admin_log.html kallithea/templates/admin/gists/index.html kallithea/templates/admin/notifications/notifications_data.html kallithea/templates/changelog/changelog.html kallithea/templates/changelog/changelog_summary_data.html kallithea/templates/followers/followers_data.html kallithea/templates/forks/forks_data.html kallithea/templates/journal/journal_data.html kallithea/templates/pullrequests/pullrequest_data.html kallithea/templates/search/search_commit.html kallithea/templates/search/search_content.html kallithea/templates/search/search_path.html |
diffstat | 14 files changed, 20 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- 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('<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='>',
--- 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;
--- 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 @@ }); </script> -<ul class="pagination"> - ${c.users_log.pager()} -</ul> +${c.users_log.pager()} + %else: ${_('No actions yet')} %endif
--- 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 @@ <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
--- 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 @@ </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
--- 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 @@ </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">
--- a/kallithea/templates/changelog/changelog_summary_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/changelog/changelog_summary_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -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):
--- a/kallithea/templates/followers/followers_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/followers/followers_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -12,6 +12,4 @@ </div> % endfor -<ul class="pagination"> - ${c.followers_pager.pager()} -</ul> +${c.followers_pager.pager()}
--- a/kallithea/templates/forks/forks_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/forks/forks_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -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
--- a/kallithea/templates/journal/journal_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/journal/journal_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -36,10 +36,7 @@ </div> %endfor %endfor - - <ul class="pagination"> - ${c.journal_pager.pager()} - </ul> + ${c.journal_pager.pager()} %else: <div> ${_('No entries yet')}
--- a/kallithea/templates/pullrequests/pullrequest_data.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_data.html Sun Jun 25 18:49:21 2017 +0200 @@ -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>
--- a/kallithea/templates/search/search_commit.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/search/search_commit.html Sun Jun 25 18:49:21 2017 +0200 @@ -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
--- a/kallithea/templates/search/search_content.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/search/search_content.html Sun Jun 25 18:49:21 2017 +0200 @@ -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
--- a/kallithea/templates/search/search_path.html Sun Jun 25 18:49:04 2017 +0200 +++ b/kallithea/templates/search/search_path.html Sun Jun 25 18:49:21 2017 +0200 @@ -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