Internal paged Search prepared

Search for table list is working
This commit is contained in:
Ozzieisaacs
2020-06-08 17:34:03 +02:00
parent 628658972c
commit 4038cb5b85
9 changed files with 82 additions and 48 deletions
+1 -28
View File
@@ -192,34 +192,7 @@
{% endblock %}
{% block modal %}
{% if g.user.role_delete_books() %}
<div class="modal fade" id="deleteModal" role="dialog" aria-labelledby="metaDeleteLabel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-danger text-center">
<span>{{_('Are you really sure?')}}</span>
</div>
<div class="modal-body text-center">
<p>
<span>{{_('This book will be permanently erased from database')}}</span>
<span>{{_('and hard disk')}}</span>
</p>
{% if config.config_kobo_sync %}
<p>
<span>{{_('Important Kobo Note: deleted books will remain on any paired Kobo device.')}}</span>
<span>{{_('Books must first be archived and the device synced before a book can safely be deleted.')}}</span>
</p>
{% endif %}
</div>
<div class="modal-footer">
<a href="{{ url_for('editbook.delete_book', book_id=book.id) }}" id="delete_confirm" class="btn btn-danger">{{_('Delete')}}</a>
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Cancel')}}</button>
</div>
</div>
</div>
</div>
{% endif %}
{{ delete_book(book.id) }}
<div class="modal fade" id="metaModal" tabindex="-1" role="dialog" aria-labelledby="metaModalLabel">
<div class="modal-dialog modal-lg" role="document">
+4 -5
View File
@@ -5,12 +5,7 @@
{% endblock %}
{% block body %}
<h2 class="{{page}}">{{_(title)}}</h2>
<!--
-->
<table class="table table-no-bordered table-striped"
data-toggle="table"
data-side-pagination="server"
data-pagination="true"
data-pagination-detail-h-align=" hidden"
@@ -23,6 +18,7 @@
data-search="true"
data-search-align="left"
data-show-search-button="false"
data-search-on-enter-key="true"
data-checkbox-header="false"
data-maintain-meta-data="true">
<thead>
@@ -47,6 +43,9 @@
</thead>
</table>
{% endblock %}
{% block modal %}
{{ delete_book(0) }}
{% endblock %}
{% block js %}
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-editable.min.js') }}"></script>
+1 -1
View File
@@ -1,4 +1,4 @@
{% from 'modal_restriction.html' import restrict_modal %}
{% from 'modal_dialogs.html' import restrict_modal, delete_book %}
<!DOCTYPE html>
<html lang="{{ g.user.locale }}">
<head>
@@ -37,3 +37,34 @@
</div>
</div>
{% endmacro %}
{% macro delete_book(bookid) %}
{% if g.user.role_delete_books() %}
<div class="modal fade" id="deleteModal" role="dialog" aria-labelledby="metaDeleteLabel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-danger text-center">
<span>{{_('Are you really sure?')}}</span>
</div>
<div class="modal-body text-center">
<p>
<span>{{_('This book will be permanently erased from database')}}</span>
<span>{{_('and hard disk')}}</span>
</p>
{% if config.config_kobo_sync %}
<p>
<span>{{_('Important Kobo Note: deleted books will remain on any paired Kobo device.')}}</span>
<span>{{_('Books must first be archived and the device synced before a book can safely be deleted.')}}</span>
</p>
{% endif %}
</div>
<div class="modal-footer">
<input type="button" class="btn btn-danger" value="{{_('Delete')}}" name="delete_confirm" id="delete_confirm" data-dismiss="modal">
<!--a href="{{ url_for('editbook.delete_book', book_id=bookid) }}" id="delete_confirm" class="btn btn-danger">{{_('Delete')}}</a-->
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Cancel')}}</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endmacro %}
+1 -1
View File
@@ -5,7 +5,7 @@
<h2>{{_('No Results Found')}} {{adv_searchterm}}</h2>
<p>{{_('Search Term:')}} {{adv_searchterm}}</p>
{% else %}
<h2>{{entries|length}} {{_('Results for:')}} {{adv_searchterm}}</h2>
<h2>{{result_count}} {{_('Results for:')}} {{adv_searchterm}}</h2>
{% if g.user.is_authenticated %}
{% if g.user.shelf.all() or g.shelves_access %}
<div id="shelf-actions" class="btn-toolbar" role="toolbar">