add pagination to basic
This commit is contained in:
@@ -1,24 +1,32 @@
|
||||
{% extends "basic_layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<div>
|
||||
{% if entries|length < 1 %}
|
||||
<p>{{_('No Results Found')}}</p>
|
||||
<p>{{_('Search Term:')}} {{adv_searchterm}}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="pagination">
|
||||
<div>
|
||||
{% for entry in entries %}
|
||||
{% if entry.Books.authors %}
|
||||
{% set author = entry.Books.authors[0].name.replace('|',',')|shortentitle(30) %}
|
||||
{% else %}
|
||||
{% set author = '' %}
|
||||
{% endif %}
|
||||
<a href="{{ url_for('basic.show_book', book_id=entry.Books.id) }}">
|
||||
<p title="{{entry.Books.title}}">{{ author }} - {{entry.Books.title|shortentitle}}</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if pagination.has_prev %}
|
||||
<a href="{{ (pagination.page - 1)|url_for_other_page }}">« {{_('Previous')}}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% if pagination.has_next %}
|
||||
<a href="{{ (pagination.page + 1)|url_for_other_page }}">{{_('Next')}} »</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if entries|length < 1 %}
|
||||
<p>{{_('No Results Found')}}</p>
|
||||
{% endif %}
|
||||
|
||||
{% for entry in entries %}
|
||||
{% if entry.Books.authors %}
|
||||
{% set author = entry.Books.authors[0].name.replace('|',',')|shortentitle(30) %}
|
||||
{% else %}
|
||||
{% set author = '' %}
|
||||
{% endif %}
|
||||
<a href="{{ url_for('basic.show_book', book_id=entry.Books.id) }}">
|
||||
<p class="listing" title="{{entry.Books.title}}">{{ author }} - {{entry.Books.title|shortentitle}}</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -71,6 +71,20 @@ nav > a {
|
||||
height: 250px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.listing {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 0;
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user