Add Conditionals for prev/next Links

This commit is contained in:
seiichiro 2022-01-11 19:38:10 +01:00
parent 0509d0d69d
commit 5e92c7e108
2 changed files with 8 additions and 0 deletions

View file

@ -37,11 +37,15 @@
{% endif %} {% endif %}
</div> </div>
<div class="page-footer"> <div class="page-footer">
{% if ($page > 1): %}
<a id="link-first" href="/index.php?d={{ $dir }}&p=1&s={{ $slice }}{{ $filter }}">1</a> <a id="link-first" href="/index.php?d={{ $dir }}&p=1&s={{ $slice }}{{ $filter }}">1</a>
<a id="link-prev" href="/index.php?d={{ $dir }}&p={{ $prev_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-left"></i></a> <a id="link-prev" href="/index.php?d={{ $dir }}&p={{ $prev_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-left"></i></a>
{% endif %}
<span class="info">{{ $page }}</span> <span class="info">{{ $page }}</span>
{% if ($page < $last_page): %}
<a id="link-next" href="/index.php?d={{ $dir }}&p={{ $next_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-right"></i></a> <a id="link-next" href="/index.php?d={{ $dir }}&p={{ $next_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-right"></i></a>
<a id="link-last" href="/index.php?d={{ $dir }}&p={{ $last_page }}&s={{ $slice }}{{ $filter }}">{{ $last_page }}</a> <a id="link-last" href="/index.php?d={{ $dir }}&p={{ $last_page }}&s={{ $slice }}{{ $filter }}">{{ $last_page }}</a>
{% endif %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -9,15 +9,19 @@
<div class="single-image"> <div class="single-image">
<img src="{{ $imageurl }}" title="{{ $page }}/{{ $last_page }}" /> <img src="{{ $imageurl }}" title="{{ $page }}/{{ $last_page }}" />
</div> </div>
{% if ($page > 1): %}
<a id="link-prev" class="clickable clickable-left" href="/index.php?d={{ $dir }}&p={{ $prev_page }}&s=1&gs={{ $gallery_slice }}{{ $filter }}"> <a id="link-prev" class="clickable clickable-left" href="/index.php?d={{ $dir }}&p={{ $prev_page }}&s=1&gs={{ $gallery_slice }}{{ $filter }}">
<div></div> <div></div>
</a> </a>
{% endif %}
<a id="link-home" class="clickable clickable-center" href="/index.php?d={{ $dir }}&p={{ $gallery_page }}&s={{ $gallery_slice }}{{ $filter }}"> <a id="link-home" class="clickable clickable-center" href="/index.php?d={{ $dir }}&p={{ $gallery_page }}&s={{ $gallery_slice }}{{ $filter }}">
<div></div> <div></div>
</a> </a>
{% if ($page < $last_page): %}
<a id="link-next" class="clickable clickable-right" href="/index.php?d={{ $dir }}&p={{ $next_page }}&s=1&gs={{ $gallery_slice }}{{ $filter }}"> <a id="link-next" class="clickable clickable-right" href="/index.php?d={{ $dir }}&p={{ $next_page }}&s=1&gs={{ $gallery_slice }}{{ $filter }}">
<div></div> <div></div>
</a> </a>
{% endif %}
</div> </div>
<div class="page-footer"> <div class="page-footer">
{% if(!empty($tags)): %} {% if(!empty($tags)): %}