fix pagination and header links

main
msquare 3 years ago
parent 8d405b8b7c
commit e0c89e0ffe

@ -25,7 +25,7 @@
<ul class="navbar-nav mb-2 mb-lg-0"> <ul class="navbar-nav mb-2 mb-lg-0">
{% for text,link in config('header_items', {}) %} {% for text,link in config('header_items', {}) %}
<li class="nav-item"> <li class="nav-item">
<a href="{{ link|replace({'%lang%': session_get('locale')|split('_')[0]})|escape('html_attr') }}"> <a class="nav-link" href="{{ link|replace({'%lang%': session_get('locale')|split('_')[0]})|escape('html_attr') }}">
{{ text }} {{ text }}
</a> </a>
</li> </li>

@ -291,8 +291,21 @@
<code>3.1415926535897932384626433832795</code> <code>3.1415926535897932384626433832795</code>
</p> </p>
</div> </div>
<div class="col">
<h4>Pagination</h4>
<ul class="pagination">
<li class="page-item active">
<a class="page-link" href="#">1</a>
</li>
<li class="page-item">
<a class="page-link" href="#">2</a>
</li>
<li class="page-item">
<a class="page-link" href="#">3</a>
</li>
</ul>
</div>
</div> </div>
<h2>Macros</h2> <h2>Macros</h2>
<h3>base.twig</h3> <h3>base.twig</h3>

@ -29,11 +29,11 @@
{% block pagination %} {% block pagination %}
{% if pages|default(0) > 1 %} {% if pages|default(0) > 1 %}
<div class="col-md-12 text-center"> <div class="col-md-12">
<ul class="pagination"> <ul class="pagination justify-content-center">
{% for p in range(1, pages) %} {% for p in range(1, pages) %}
<li{% if p == page %} class="active"{% endif %}> <li class="page-item{% if p == page %} active{% endif %}">
<a href="{{ url('news', p == 1 ? {} : {'page': p}) }}">{{ p }}</a> <a class="page-link" href="{{ url('news', p == 1 ? {} : {'page': p}) }}">{{ p }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

Loading…
Cancel
Save