Merge pull request #3459 from Simounet/fix/pagination

Pagination improved
This commit is contained in:
Jérémy Benoist 2017-12-05 10:03:32 +01:00 committed by GitHub
commit aeab8b342e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 21 deletions

View file

@ -8,6 +8,7 @@ main {
} }
ul.row { ul.row {
margin: 0.4rem 0 0;
padding: 0 0.75rem; padding: 0 0.75rem;
} }
} }

View file

@ -12,12 +12,10 @@
} }
.results { .results {
height: 1em; display: flex;
padding: 1rem 1rem 0;
.nb-results, flex-wrap: wrap;
.pagination { justify-content: space-between;
margin: 15px 15px 0;
}
.nb-results { .nb-results {
display: inline-flex; display: inline-flex;
@ -29,10 +27,11 @@
} }
.pagination { .pagination {
float: right;
ul { ul {
margin: 0 !important; display: flex;
margin: 0;
flex-wrap: wrap;
justify-content: space-around;
.prev.disabled, .prev.disabled,
.next.disabled { .next.disabled {
@ -44,10 +43,12 @@
padding: 0; padding: 0;
} }
span,
a { a {
padding: 0 10px; padding: 0 10px;
height: 30px; height: 30px;
display: block; display: block;
line-height: 30px;
} }
.disabled { .disabled {

View file

@ -8,6 +8,10 @@
footer { footer {
padding-left: 240px; padding-left: 240px;
} }
.pagination {
margin-left: auto;
}
} }
@media only screen and (max-width: 992px) { @media only screen and (max-width: 992px) {
@ -18,10 +22,6 @@
padding-left: 0; padding-left: 0;
} }
.pagination {
width: auto;
}
.nav-panels .action { .nav-panels .action {
padding-right: 0.75rem; padding-right: 0.75rem;
} }
@ -62,10 +62,14 @@
display: none; display: none;
} }
.pagination li.prev, .pagination li {
.pagination li.next { margin-bottom: 0.5rem;
&.prev,
&.next {
width: auto; width: auto;
} }
}
.drag-target + .drag-target { .drag-target + .drag-target {
height: 50%; height: 50%;

View file

@ -21,8 +21,8 @@
{% block content %} {% block content %}
{% set listMode = app.user.config.listMode %} {% set listMode = app.user.config.listMode %}
{% set currentRoute = app.request.attributes.get('_route') %} {% set currentRoute = app.request.attributes.get('_route') %}
<div class="results clearfix"> <div class="results">
<div class="nb-results left"> <div class="nb-results">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
<a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a> <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
{% if app.user.config.rssToken %} {% if app.user.config.rssToken %}
@ -34,7 +34,6 @@
{% endif %} {% endif %}
</div> </div>
<br />
<ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}"> <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}">
{% for entry in entries %} {% for entry in entries %}
<li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12"> <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
@ -52,7 +51,9 @@
</ul> </ul>
{% if entries.getNbPages > 1 %} {% if entries.getNbPages > 1 %}
<div class="results">
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
</div>
{% endif %} {% endif %}
<!-- Export --> <!-- Export -->

File diff suppressed because one or more lines are too long