2020-05-12 07:32:26 -07:00
{% extends "layout.html" %}
2021-04-13 10:26:10 -07: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 07:15:54 -07:00
data-visible = "{{visiblility.get(parameter)}}"
2021-08-28 06:47:57 -07:00
data-escape="true"
2020-10-04 10:23:06 -07:00
{% if g.user.role_edit() %}
2020-06-11 12:19:09 -07:00
data-editable-type="text"
data-editable-url="{{ url_for('editbook.edit_list_book', param=parameter)}}"
2020-06-12 07:15:54 -07:00
data-editable-title="{{ edit_text }}"
2020-06-11 12:19:09 -07:00
data-edit="true"
2020-10-04 10:23:06 -07:00
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}" {% endif %}
{% endif %}
2020-06-11 12:19:09 -07:00
>{{ show_text }}< / th >
2020-06-10 23:48:23 -07:00
{%- endmacro %}
2021-10-19 10:10:40 -07:00
{% macro book_checkbox_row(parameter, array_field, show_text, element, value, sort) -%}
<!-- th data - name="{{parameter}}" data - field="{{parameter}}"
{% if sort %}data-sortable="true" {% endif %}
data-visible="{{visiblility.get(parameter)}}"
data-formatter="checkboxFormatter">
{{show_text}}
< / th-- >
{%- endmacro %}
2020-06-06 12:21:10 -07: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" >
2021-10-19 10:10:40 -07:00
< link href = "{{ url_for('static', filename='css/libs/bootstrap-wysihtml5-0.0.3.css') }}" rel = "stylesheet" >
2020-06-06 12:21:10 -07:00
{% endblock %}
2020-05-12 07:32:26 -07:00
{% block body %}
2020-06-06 12:21:10 -07:00
< h2 class = "{{page}}" > {{_(title)}}< / h2 >
2021-10-04 08:50:32 -07:00
< input type = "hidden" name = "csrf_token" value = "{{ csrf_token() }}" >
2020-06-12 12:40:09 -07:00
< div class = "col-xs-12 col-sm-6" >
2021-05-28 09:22:29 -07:00
< div class = "row form-group" >
2021-08-01 11:23:04 -07:00
< div class = "btn btn-default disabled" id = "merge_books" aria-disabled = "true" > {{_('Merge selected books')}}< / div >
2020-06-12 12:40:09 -07:00
< div class = "btn btn-default disabled" id = "delete_selection" aria-disabled = "true" > {{_('Remove Selections')}}< / div >
< / div >
2021-05-28 09:22:29 -07:00
< div class = "row form-group" >
< div class = "btn btn-default disabled" id = "table_xchange" > < span class = "glyphicon glyphicon-arrow-up" > < / span > < span class = "glyphicon glyphicon-arrow-down" > < / span > {{_('Exchange author and title')}}< / div >
< / div >
2020-06-12 12:40:09 -07:00
< / div >
2021-05-28 09:22:29 -07:00
< div class = "filterheader col-xs-12 col-sm-6" >
< div class = "row form-group" >
2020-06-12 12:40:09 -07:00
< input type = "checkbox" id = "autoupdate_titlesort" name = "autoupdate_titlesort" checked >
< label for = "autoupdate_titlesort" > {{_('Update Title Sort automatically')}}< / label >
< / div >
2021-05-28 09:22:29 -07:00
< div class = "row form-group" >
2021-04-03 05:21:38 -07:00
< input type = "checkbox" id = "autoupdate_authorsort" name = "autoupdate_authorsort" checked >
< label for = "autoupdate_authorsort" > {{_('Update Author Sort automatically')}}< / label >
2020-06-12 12:40:09 -07:00
< / div >
2020-06-12 07:15:54 -07:00
< / div >
2020-06-12 12:40:09 -07:00
2020-06-11 12:36:12 -07:00
< table id = "books-table" class = "table table-no-bordered table-striped"
2021-09-30 05:09:02 -07:00
data-url="{{url_for('web.list_books')}}" data-locale="{{ g.user.locale }}">
2020-06-06 12:21:10 -07:00
< thead >
< tr >
2020-10-04 10:23:06 -07:00
{% if g.user.role_edit() %}
2020-06-10 23:48:23 -07:00
< th data-field = "state" data-checkbox = "true" data-sortable = "true" > < / th >
2020-10-04 10:23:06 -07:00
{% endif %}
2020-06-06 12:21:10 -07:00
< th data-field = "id" id = "id" data-visible = "false" data-switchable = "false" > < / th >
2021-04-13 10:26:10 -07: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) }}
2021-04-17 01:27:30 -07:00
{{ text_table_row('authors', _('Enter Authors'),_('Authors'), true, true) }}
{{ text_table_row('tags', _('Enter Categories'),_('Categories'), false, true) }}
{{ text_table_row('series', _('Enter Series'),_('Series'), false, true) }}
2021-05-16 00:37:45 -07: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-17 01:27:30 -07:00
{{ text_table_row('languages', _('Enter Languages'),_('Languages'), false, true) }}
2020-06-18 11:39:45 -07: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-17 01:27:30 -07:00
{{ text_table_row('publishers', _('Enter Publishers'),_('Publishers'), false, true) }}
2021-10-19 10:10:40 -07:00
< th data-field = "comments" id = "comments" data-escape = "true" data-editable-mode = "popup" data-visible = "{{visiblility.get('comments')}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "wysihtml5" data-editable-url = "{{ url_for('editbook.edit_list_book', param='comments')}}" data-edit = "true" data-editable-title = "{{_('Enter comments')}}" { % endif % } > {{_('Comments')}}< / th >
<!-- data - editable - formatter="comment_display" -->
2021-10-16 11:46:16 -07:00
{% for c in cc %}
{% if c.datatype == "int" %}
< th data-field = "custom_column_{{ c.id|string }}" id = "custom_column_{{ c.id|string }}" data-visible = "{{visiblility.get('custom_column_'+ c.id|string)}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "number" data-editable-placeholder = "1" data-editable-step = "1" data-editable-url = "{{ url_for('editbook.edit_list_book', param='custom_column_'+ c.id|string)}}" data-edit = "true" data-editable-title = "{{_('Enter ') + c.name}}" { % endif % } > {{c.name}}< / th >
{% elif c.datatype == "rating" %}
2021-10-30 06:50:17 -07:00
< th data-field = "custom_column_{{ c.id|string }}" id = "custom_column_{{ c.id|string }}" data-formatter = "ratingFormatter" data-visible = "{{visiblility.get('custom_column_'+ c.id|string)}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "number" data-editable-placeholder = "1" data-editable-step = "0.5" data-editable-step = "1" data-editable-min = "1" data-editable-max = "5" data-editable-url = "{{ url_for('editbook.edit_list_book', param='custom_column_'+ c.id|string)}}" data-edit = "true" data-editable-title = "{{_('Enter ') + c.name}}" { % endif % } > {{c.name}}< / th >
2021-10-16 11:46:16 -07:00
{% elif c.datatype == "float" %}
< th data-field = "custom_column_{{ c.id|string }}" id = "custom_column_{{ c.id|string }}" data-visible = "{{visiblility.get('custom_column_'+ c.id|string)}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "number" data-editable-placeholder = "1" data-editable-step = "0.01" data-editable-url = "{{ url_for('editbook.edit_list_book', param='custom_column_'+ c.id|string)}}" data-edit = "true" data-editable-title = "{{_('Enter ') + c.name}}" { % endif % } > {{c.name}}< / th >
2021-10-17 05:05:18 -07:00
{% elif c.datatype == "enumeration" %}
< th data-field = "custom_column_{{ c.id|string }}" id = "custom_column_{{ c.id|string }}" data-visible = "{{visiblility.get('custom_column_'+ c.id|string)}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "select" data-editable-source = {{ url_for ( ' editbook . table_get_custom_enum ' , c_id = c.id) } } data-editable-url = "{{ url_for('editbook.edit_list_book', param='custom_column_'+ c.id|string)}}" data-edit = "true" data-editable-title = "{{_('Enter ') + c.name}}" { % endif % } > {{c.name}}< / th >
2021-10-19 10:10:40 -07:00
{% elif c.datatype in ["datetime"] %}
2021-10-17 05:11:52 -07:00
<!-- missing -->
2021-10-17 05:29:13 -07:00
{% elif c.datatype == "text" %}
2021-10-17 05:11:52 -07:00
{{ text_table_row('custom_column_' + c.id|string, _('Enter ') + c.name, c.name, false, false) }}
2021-10-19 10:10:40 -07:00
{% elif c.datatype == "comments" %}
< th data-field = "custom_column_{{ c.id|string }}" id = "custom_column_{{ c.id|string }}" data-escape = "true" data-editable-mode = "popup" data-visible = "{{visiblility.get('custom_column_'+ c.id|string)}}" data-sortable = "false" { % if g . user . role_edit ( ) % } data-editable-type = "wysihtml5" data-editable-url = "{{ url_for('editbook.edit_list_book', param='custom_column_'+ c.id|string)}}" data-edit = "true" data-editable-title = "{{_('Enter ') + c.name}}" { % endif % } > {{c.name}}< / th >
{% elif c.datatype == "bool" %}
{{ book_checkbox_row('custom_column_' + c.id|string, _('Enter ') + c.name, c.name, visiblility, all_roles, false)}}
2021-10-16 11:46:16 -07:00
{% else %}
<!-- {{ text_table_row('custom_column_' + c.id|string, _('Enter ') + c.name, c.name, false, false) }} -->
{% endif %}
{% endfor %}
2021-04-03 05:21:38 -07:00
{% if g.user.role_delete_books() and g.user.role_edit()%}
2020-06-12 07:15:54 -07:00
< th data-align = "right" data-formatter = "EbookActions" data-switchable = "false" > {{_('Delete')}}< / th >
2020-10-04 10:23:06 -07:00
{% endif %}
2020-06-06 12:21:10 -07:00
< / tr >
< / thead >
< / table >
2020-05-12 07:32:26 -07:00
{% endblock %}
2020-06-08 08:34:03 -07:00
{% block modal %}
2020-12-22 08:50:07 -08:00
{{ delete_book() }}
2020-06-20 04:46:12 -07: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 01:27:09 -07:00
< div class = "modal-body" >
< p > < / p >
< div class = "text-left" > {{_('Books with Title will be merged from:')}}< / div >
< p > < / p >
2021-05-29 08:30:06 -07:00
< div class = "text-left" id = "merge_from" > < / div >
2020-08-22 01:27:09 -07:00
< p > < / p >
< div class = "text-left" > {{_('Into Book with Title:')}}< / div >
< p > < / p >
2021-05-29 08:30:06 -07:00
< div class = "text-left" id = "merge_to" > < / div >
2020-06-20 04:46:12 -07:00
< / div >
< div class = "modal-footer" >
2021-12-27 11:02:42 -08:00
< input id = "merge_confirm" type = "button" class = "btn btn-danger" value = "{{_('Merge')}}" name = "merge_confirm" id = "merge_confirm" data-dismiss = "modal" >
< button id = "merge_abort" type = "button" class = "btn btn-default" data-dismiss = "modal" > {{_('Cancel')}}< / button >
2020-06-20 04:46:12 -07:00
< / div >
< / div >
< / div >
< / div >
{% endif %}
2020-06-08 08:34:03 -07:00
{% endblock %}
2020-05-12 07:32:26 -07:00
{% block js %}
2020-06-06 12:21:10 -07:00
< script src = "{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}" > < / script >
2021-09-30 05:09:02 -07:00
< script src = "{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-locale-all.min.js') }}" > < / script >
2020-06-06 12:21:10 -07:00
< 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 >
2021-05-28 09:48:46 -07:00
{% if not g.user.locale == 'en' %}
< script src = "{{ url_for('static', filename='js/libs/bootstrap-table/locale/bootstrap-table-' + g.user.locale + '.min.js') }}" charset = "UTF-8" > < / script >
{% endif %}
2021-10-19 10:10:40 -07:00
< script src = "{{ url_for('static', filename='js/libs/wysihtml5-0.3.0.min.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/libs/bootstrap-wysihtml5-0.0.3.min.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/libs/wysihtml5-0.0.3.js') }}" > < / script >
2020-06-06 12:21:10 -07:00
< script src = "{{ url_for('static', filename='js/table.js') }}" > < / script >
2020-05-12 07:32:26 -07:00
{% endblock %}