#4 Account: more features to manage gists - fix

This commit is contained in:
Simon Vieille 2016-06-19 08:52:16 +02:00
parent f89e84585a
commit 430f364456
3 changed files with 6 additions and 11 deletions

View file

@ -81,7 +81,7 @@ form:
type:
label: 'Language: %value%'
choice:
all: 'Tous'
all: 'All'
html: 'HTML'
xml: 'XML'
css: 'CSS'

View file

@ -69,9 +69,6 @@ class MyController extends Controller
}
}
$nextPage = min($page + 1, $gists->getLastPage());
$previousPage = max($page - 1, 1);
return $this->render(
'My/my.html.twig',
array(
@ -80,8 +77,6 @@ class MyController extends Controller
'deleteForm' => $deleteForm->createView(),
'filterForm' => $filterForm->createView(),
'deleted' => !empty($deleted),
'nextPage' => $nextPage,
'previousPage' => $previousPage,
)
);
}

View file

@ -97,7 +97,7 @@
<ul class="pagination">
<li>
{% set params = app.request.attributes.get('_route_params')|merge({page: 1}) %}
<a href="{{ path('my', params) }}" aria-label="Previous">
<a href="{{ path('my', params) }}">
<span aria-hidden="true">
<span class="glyphicon glyphicon-step-backward"></span>
</span>
@ -105,7 +105,7 @@
</li>
<li>
{% set params = app.request.attributes.get('_route_params')|merge({page: previousPage}) %}
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.previousPage}) %}
<a href="{{ path('my', params) }}">
<span aria-hidden="true">
<span class="glyphicon glyphicon glyphicon-chevron-left"></span>
@ -121,8 +121,8 @@
{% endfor %}
<li>
{% set params = app.request.attributes.get('_route_params')|merge({page: nextPage}) %}
<a href="{{ path('my', params) }}" aria-label="Previous">
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.nextPage}) %}
<a href="{{ path('my', params) }}">
<span aria-hidden="true">
<span class="glyphicon glyphicon glyphicon-chevron-right"></span>
</span>
@ -130,7 +130,7 @@
</li>
<li>
{% set params = app.request.attributes.get('_route_params')|merge({page: 1}) %}
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.lastPage}) %}
<a href="{{ path('my', params) }}">
<span aria-hidden="true">
<span class="glyphicon glyphicon-step-forward"></span>