2020-05-12 14:32:26 +00:00
{% extends "layout.html" %}
2021-04-13 17:26:10 +00:00
{% macro text_table_row(parameter, edit_text, show_text, validate, sort) -%}
< th data-field = "{{ parameter }}" id = "{{ parameter }}"
{% if sort %}data-sortable="true" {% endif %}
2020-06-12 14:15:54 +00:00
data-visible = "{{visiblility.get(parameter)}}"
2020-10-04 17:23:06 +00:00
{% if g.user.role_edit() %}
2020-06-11 19:19:09 +00:00
data-editable-type="text"
data-editable-url="{{ url_for('editbook.edit_list_book', param=parameter)}}"
2020-06-12 14:15:54 +00:00
data-editable-title="{{ edit_text }}"
2020-06-11 19:19:09 +00:00
data-edit="true"
2020-10-04 17:23:06 +00:00
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}" {% endif %}
{% endif %}
2020-06-11 19:19:09 +00:00
>{{ show_text }}< / th >
2020-06-11 06:48:23 +00:00
{%- endmacro %}
2020-06-06 19:21:10 +00:00
{% block header %}
< link href = "{{ url_for('static', filename='css/libs/bootstrap-table.min.css') }}" rel = "stylesheet" >
< link href = "{{ url_for('static', filename='css/libs/bootstrap-editable.css') }}" rel = "stylesheet" >
{% endblock %}
2020-05-12 14:32:26 +00:00
{% block body %}
2020-06-06 19:21:10 +00:00
< h2 class = "{{page}}" > {{_(title)}}< / h2 >
2020-06-12 19:40:09 +00:00
< div class = "col-xs-12 col-sm-6" >
< div class = "row" >
2020-06-20 11:46:12 +00:00
< div class = "btn btn-default disabled" id = "merge_books" data-toggle = "modal" data-target = "#mergeModal" aria-disabled = "true" > {{_('Merge selected books')}}< / div >
2020-06-12 19:40:09 +00:00
< div class = "btn btn-default disabled" id = "delete_selection" aria-disabled = "true" > {{_('Remove Selections')}}< / div >
< / div >
< / div >
< div class = "col-xs-12 col-sm-6" >
< div class = "row" >
< input type = "checkbox" id = "autoupdate_titlesort" name = "autoupdate_titlesort" checked >
< label for = "autoupdate_titlesort" > {{_('Update Title Sort automatically')}}< / label >
< / div >
< div class = "row" >
2021-04-03 12:21:38 +00:00
< input type = "checkbox" id = "autoupdate_authorsort" name = "autoupdate_authorsort" checked >
< label for = "autoupdate_authorsort" > {{_('Update Author Sort automatically')}}< / label >
2020-06-12 19:40:09 +00:00
< / div >
2020-06-12 14:15:54 +00:00
< / div >
2020-06-12 19:40:09 +00:00
2020-06-11 19:36:12 +00:00
< table id = "books-table" class = "table table-no-bordered table-striped"
2020-06-11 19:19:09 +00:00
data-url="{{url_for('web.list_books')}}">
2020-06-06 19:21:10 +00:00
< thead >
< tr >
2020-10-04 17:23:06 +00:00
{% if g.user.role_edit() %}
2020-06-11 06:48:23 +00:00
< th data-field = "state" data-checkbox = "true" data-sortable = "true" > < / th >
2020-10-04 17:23:06 +00:00
{% endif %}
2020-06-06 19:21:10 +00:00
< th data-field = "id" id = "id" data-visible = "false" data-switchable = "false" > < / th >
2021-04-13 17:26:10 +00:00
{{ text_table_row('title', _('Enter Title'),_('Title'), true, true) }}
{{ text_table_row('sort', _('Enter Title Sort'),_('Title Sort'), false, true) }}
{{ text_table_row('author_sort', _('Enter Author Sort'),_('Author Sort'), false, true) }}
2020-06-12 11:45:07 +00:00
{{ text_table_row('authors', _('Enter Authors'),_('Authors'), true) }}
2021-04-13 17:26:10 +00:00
{{ text_table_row('tags', _('Enter Categories'),_('Categories'), false, false) }}
{{ text_table_row('series', _('Enter Series'),_('Series'), false, false) }}
2020-10-04 17:23:06 +00:00
< th data-field = "series_index" id = "series_index" data-visible = "{{visiblility.get('series_index')}}" data-edit-validate = "{{ _('This Field is Required') }}" data-sortable = "true" { % if g . user . role_edit ( ) % } data-editable-type = "number" data-editable-placeholder = "1" data-editable-step = "0.01" data-editable-min = "0" data-editable-url = "{{ url_for('editbook.edit_list_book', param='series_index')}}" data-edit = "true" data-editable-title = "{{_('Enter title')}}" { % endif % } > {{_('Series Index')}}< / th >
2021-04-13 17:26:10 +00:00
{{ text_table_row('languages', _('Enter Languages'),_('Languages'), false, false) }}
2020-06-18 18:39:45 +00:00
<!-- th data - field="pubdate" data - type="date" data - visible="{{visiblility.get('pubdate')}}" data - viewformat="dd.mm.yyyy" id="pubdate" data - sortable="true">{{_('Publishing Date')}}</th -->
2021-04-13 17:26:10 +00:00
{{ text_table_row('publishers', _('Enter Publishers'),_('Publishers'), false, false) }}
2021-04-03 12:21:38 +00:00
{% if g.user.role_delete_books() and g.user.role_edit()%}
2020-06-12 14:15:54 +00:00
< th data-align = "right" data-formatter = "EbookActions" data-switchable = "false" > {{_('Delete')}}< / th >
2020-10-04 17:23:06 +00:00
{% endif %}
2020-06-06 19:21:10 +00:00
< / tr >
< / thead >
< / table >
2020-05-12 14:32:26 +00:00
{% endblock %}
2020-06-08 15:34:03 +00:00
{% block modal %}
2020-12-22 16:50:07 +00:00
{{ delete_book() }}
2020-06-20 11:46:12 +00:00
{% if g.user.role_edit() %}
< div class = "modal fade" id = "mergeModal" role = "dialog" aria-labelledby = "metaMergeLabel" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header bg-danger text-center" >
< span > {{_('Are you really sure?')}}< / span >
< / div >
2020-08-22 08:27:09 +00:00
< div class = "modal-body" >
< p > < / p >
< div class = "text-left" > {{_('Books with Title will be merged from:')}}< / div >
< p > < / p >
< div class = text-left" id = "merge_from" > < / div >
< p > < / p >
< div class = "text-left" > {{_('Into Book with Title:')}}< / div >
< p > < / p >
< div class = text-left" id = "merge_to" > < / div >
2020-06-20 11:46:12 +00:00
< / div >
< div class = "modal-footer" >
< input type = "button" class = "btn btn-danger" value = "{{_('Merge')}}" name = "merge_confirm" id = "merge_confirm" data-dismiss = "modal" >
< button type = "button" class = "btn btn-default" data-dismiss = "modal" > {{_('Cancel')}}< / button >
< / div >
< / div >
< / div >
< / div >
{% endif %}
2020-06-08 15:34:03 +00:00
{% endblock %}
2020-05-12 14:32:26 +00:00
{% block js %}
2020-06-06 19:21:10 +00:00
< 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 >
< script src = "{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-editable.min.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/table.js') }}" > < / script >
2020-05-12 14:32:26 +00:00
{% endblock %}