2017-07-06 18:21:35 +02:00
{% extends is_xhr|yesno("fragment.html", "layout.html") %}
2015-08-02 20:59:11 +02:00
{% block body %}
< div class = "single" >
< div class = "row" >
2017-03-14 19:48:17 +01:00
< div class = "col-sm-3 col-lg-3 col-xs-5" >
2015-08-02 20:59:11 +02:00
< div class = "cover" >
2019-07-13 20:45:48 +02:00
< img src = "{{ url_for('web.get_cover', book_id=entry.id) }}" alt = "{{ entry.title }}" / >
2015-08-02 20:59:11 +02:00
< / div >
< / div >
2016-04-03 23:33:29 +02:00
< div class = "col-sm-9 col-lg-9 book-meta" >
2017-07-08 11:01:40 +02:00
< div class = "btn-toolbar" role = "toolbar" >
< div class = "btn-group" role = "group" aria-label = "Download, send to Kindle, reading" >
{% if g.user.role_download() %}
2018-02-04 08:05:08 +01:00
{% if entry.data|length %}
2017-07-08 11:01:40 +02:00
< div class = "btn-group" role = "group" >
2018-07-15 18:50:35 +02:00
{% if entry.data|length < 2 % }
2019-02-23 18:28:25 +01:00
< button id = "Download" type = "button" class = "btn btn-primary" >
2018-02-04 08:05:08 +01:00
{{_('Download')}} :
< / button >
{% for format in entry.data %}
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('web.download_link', book_id=entry.id, book_format=format.format|lower, anyname=entry.id|string+'.'+format.format|lower) }}" id = "btnGroupDrop1{{format.format|lower}}" class = "btn btn-primary" role = "button" >
2018-02-04 08:05:08 +01:00
< span class = "glyphicon glyphicon-download" > < / span > {{format.format}} ({{ format.uncompressed_size|filesizeformat }})
< / a >
{% endfor %}
{% else %}
< button id = "btnGroupDrop1" type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
< span class = "glyphicon glyphicon-download" > < / span > {{_('Download')}}
< span class = "caret" > < / span >
< / button >
< ul class = "dropdown-menu" aria-labelledby = "btnGroupDrop1" >
{% for format in entry.data %}
2019-07-13 20:45:48 +02:00
< li > < a href = "{{ url_for('web.download_link', book_id=entry.id, book_format=format.format|lower, anyname=entry.id|string+'.'+format.format|lower) }}" > {{format.format}} ({{ format.uncompressed_size|filesizeformat }})< / a > < / li >
2018-02-04 08:05:08 +01:00
{% endfor %}
< / ul >
{% endif %}
2017-07-08 11:01:40 +02:00
< / div >
2018-02-04 08:05:08 +01:00
{% endif %}
2017-07-08 11:01:40 +02:00
{% endif %}
2019-04-14 16:37:57 +02:00
{% if g.user.kindle_mail and kindle_list %}
2018-11-18 17:09:13 +01:00
{% if kindle_list.__len__() == 1 %}
2019-07-13 20:45:48 +02:00
< a href = "{{url_for('web.send_to_kindle', book_id=entry.id, book_format=kindle_list[0]['format'], convert=kindle_list[0]['convert'])}}" id = "sendbtn" data-text = "{{_('Send to Kindle')}}" class = "btn btn-primary" role = "button" > < span class = "glyphicon glyphicon-send" > < / span > {{kindle_list[0]['text']}}< / a >
2018-11-18 17:09:13 +01:00
{% else %}
< div class = "btn-group" role = "group" >
2019-01-18 19:43:26 +01:00
< button id = "sendbtn2" type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
2018-11-18 17:09:13 +01:00
< span class = "glyphicon glyphicon-send" > < / span > {{_('Send to Kindle')}}
< span class = "caret" > < / span >
< / button >
< ul class = "dropdown-menu" aria-labelledby = "send-to-kindle" >
{% for format in kindle_list %}
2019-07-13 20:45:48 +02:00
< li > < a href = "{{url_for('web.send_to_kindle', book_id=entry.id, book_format=format['format'], convert=format['convert'])}}" > {{format['text']}}< / a > < / li >
2018-11-18 17:09:13 +01:00
{%endfor%}
< / ul >
< / div >
{% endif %}
2017-07-08 11:01:40 +02:00
{% endif %}
2019-07-13 20:45:48 +02:00
{% if reader_list and g.user.role_viewer() %}
2017-07-08 11:01:40 +02:00
< div class = "btn-group" role = "group" >
2017-07-29 05:02:53 +02:00
< button id = "read-in-browser" type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
2017-07-08 11:01:40 +02:00
< span class = "glyphicon glyphicon-eye-open" > < / span > {{_('Read in browser')}}
< span class = "caret" > < / span >
< / button >
2018-02-04 08:05:08 +01:00
< ul class = "dropdown-menu" aria-labelledby = "read-in-browser" >
2018-11-25 11:25:20 +01:00
{% for format in reader_list %}
2019-07-13 20:45:48 +02:00
< li > < a target = "_blank" href = "{{ url_for('web.read_book', book_id=entry.id, book_format=format) }}" > {{format}}< / a > < / li >
2018-02-04 08:05:08 +01:00
{%endfor%}
< / ul >
2017-07-08 11:01:40 +02:00
< / div >
2019-07-13 20:45:48 +02:00
{% endif %}
{% if audioentries|length > 0 %}
< div class = "btn-group" role = "group" >
< button id = "listen-in-browser" type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
< span class = "glyphicon glyphicon-music" > < / span > {{_('Listen in browser')}}
< span class = "caret" > < / span >
< / button >
< ul class = "dropdown-menu" aria-labelledby = "read-in-browser" >
{% for format in reader_list %}
< li > < a target = "_blank" href = "{{ url_for('web.read_book', book_id=entry.id, book_format=format) }}" > {{format}}< / a > < / li >
{%endfor%}
< / ul >
< ul class = "dropdown-menu" aria-labelledby = "listen-in-browser" >
{% for format in entry.data %}
{% if format.format|lower in audioentries %}
< li > < a target = "_blank" href = "{{ url_for('web.read_book', book_id=entry.id, book_format=format.format|lower) }}" > {{format.format}}< / a > < / li >
{% endif %}
{% endfor %}
< / ul >
< / div >
{% endif %}
2017-07-08 11:01:40 +02:00
< / div >
< / div >
2018-10-03 21:18:08 +02:00
< h2 id = "title" > {{entry.title|shortentitle(40)}}< / h2 >
2016-04-15 23:35:18 +02:00
< p class = "author" >
{% for author in entry.authors %}
2019-07-13 20:45:48 +02:00
< a href = "{{url_for('web.books_list', data='author', sort='new', book_id=author.id ) }}" > {{author.name.replace('|',',')}}< / a >
2016-04-15 23:35:18 +02:00
{% if not loop.last %}
&
{% endif %}
{% endfor %}
< / p >
2015-08-02 20:59:11 +02:00
{% if entry.ratings.__len__() > 0 %}
< div class = "rating" >
2015-10-13 01:21:46 +02:00
< p >
2015-08-02 20:59:11 +02:00
{% for number in range((entry.ratings[0].rating/2)|int(2)) %}
< span class = "glyphicon glyphicon-star good" > < / span >
{% if loop.last and loop.index < 5 % }
{% for numer in range(5 - loop.index) %}
< span class = "glyphicon glyphicon-star" > < / span >
{% endfor %}
{% endif %}
{% endfor %}
2015-10-13 01:21:46 +02:00
< / p >
2015-08-02 20:59:11 +02:00
< / div >
{% endif %}
{% if entry.series|length > 0 %}
2019-07-13 20:45:48 +02:00
< p > {{_('Book')}} {{entry.series_index}} {{_('of')}} < a href = "{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}" > {{entry.series[0].name}}< / a > < / p >
2015-08-02 20:59:11 +02:00
{% endif %}
2015-10-13 01:21:46 +02:00
{% if entry.languages.__len__() > 0 %}
< div class = "languages" >
< p >
2019-01-14 20:27:53 +01:00
< span class = "label label-default" > {{_('language')}}: {% for language in entry.languages %}{{language.language_name}}{% if not loop.last %}, {% endif %}{% endfor %}< / span >
2015-10-13 01:21:46 +02:00
< / p >
< / div >
{% endif %}
2016-12-27 10:36:06 +01:00
{% if entry.identifiers|length > 0 %}
< div class = "identifiers" >
2017-02-22 20:59:48 +01:00
< p >
2016-12-27 10:36:06 +01:00
< span class = "glyphicon glyphicon-link" > < / span >
{% for identifier in entry.identifiers %}
< a href = "{{identifier}}" target = "_blank" class = "btn btn-xs btn-success" role = "button" > {{identifier.formatType()}}< / a >
{%endfor%}
< / p >
2017-07-09 12:41:09 +02:00
< / div >
2016-12-27 10:36:06 +01:00
{% endif %}
2015-08-02 20:59:11 +02:00
{% if entry.tags|length > 0 %}
2017-07-09 12:41:09 +02:00
2015-10-13 01:21:46 +02:00
< div class = "tags" >
2017-07-09 12:41:09 +02:00
< p >
2015-10-13 01:21:46 +02:00
< span class = "glyphicon glyphicon-tags" > < / span >
2017-04-12 09:53:32 +02:00
2015-08-02 20:59:11 +02:00
{% for tag in entry.tags %}
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('web.books_list', data='category', sort='new', book_id=tag.id) }}" class = "btn btn-xs btn-info" role = "button" > {{tag.name}}< / a >
2015-08-02 20:59:11 +02:00
{%endfor%}
2015-10-13 01:21:46 +02:00
< / p >
2017-07-09 12:41:09 +02:00
< / div >
2015-08-02 20:59:11 +02:00
{% endif %}
2018-09-30 18:30:24 +02:00
2017-02-22 20:59:48 +01:00
{% if entry.publishers|length > 0 %}
< div class = "publishers" >
2018-09-30 18:30:24 +02:00
< p >
< span > {{_('Publisher')}}:
2019-07-13 20:45:48 +02:00
< a href = "{{url_for('web.books_list', data='publisher', sort='new', book_id=entry.publishers[0].id ) }}" > {{entry.publishers[0].name}}< / a >
2018-09-30 18:30:24 +02:00
< / span >
< / p >
2017-02-22 20:59:48 +01:00
< / div >
{% endif %}
2018-09-30 18:30:24 +02:00
2017-02-15 18:09:17 +01:00
{% if entry.pubdate[:10] != '0101-01-01' %}
2019-01-08 07:10:10 +01:00
< div class = "publishing-date" >
2017-02-15 18:09:17 +01:00
< p > {{_('Publishing date')}}: {{entry.pubdate|formatdate}} < / p >
2019-01-08 07:10:10 +01:00
< / div >
2017-02-03 13:44:13 +01:00
{% endif %}
2016-04-20 00:20:02 +02:00
{% if cc|length > 0 %}
2017-07-09 12:41:09 +02:00
2019-05-30 09:19:37 +02:00
2016-04-20 00:20:02 +02:00
{% for c in cc %}
2019-05-30 09:19:37 +02:00
< div class = "real_custom_columns" >
2016-04-20 00:20:02 +02:00
{% if entry['custom_column_' ~ c.id]|length > 0 %}
2017-04-12 09:53:32 +02:00
{{ c.name }}:
2016-04-20 00:20:02 +02:00
{% for column in entry['custom_column_' ~ c.id] %}
2016-04-21 12:59:49 +02:00
{% if c.datatype == 'rating' %}
{{ '%d' % (column.value / 2) }}
{% else %}
2016-11-09 19:24:33 +01:00
{% if c.datatype == 'bool' %}
{% if column.value == true %}
< span class = "glyphicon glyphicon-ok" > < / span >
{% else %}
< span class = "glyphicon glyphicon-remove" > < / span >
{% endif %}
{% else %}
{{ column.value }}
{% endif %}
2016-04-21 12:59:49 +02:00
{% endif %}
2016-04-20 00:20:02 +02:00
{% endfor %}
{% endif %}
2017-07-09 12:41:09 +02:00
< / div >
2019-05-30 09:19:37 +02:00
{% endfor %}
2017-04-12 09:53:32 +02:00
{% endif %}
2017-10-10 16:18:28 +02:00
{% if not g.user.is_anonymous %}
2017-07-09 12:41:09 +02:00
2017-07-06 19:33:47 +02:00
< div class = "custom_columns" >
2017-07-09 12:41:09 +02:00
< p >
2019-07-13 20:45:48 +02:00
< form id = "have_read_form" action = "{{ url_for('web.toggle_read', book_id=entry.id)}}" method = "POST" >
2017-07-06 19:33:47 +02:00
< label class = "block-label" >
2019-02-23 18:28:25 +01:00
< input id = "have_read_cb" data-checked = "{{_('Mark As Unread')}}" data-unchecked = "{{_('Mark As Read')}}" type = "checkbox" { % if have_read % } checked { % endif % } >
2017-07-06 19:33:47 +02:00
< span > {{_('Read')}}< / span >
< / label >
2017-02-19 21:08:22 +01:00
< / form >
2017-07-09 12:41:09 +02:00
< / p >
2017-02-19 21:08:22 +01:00
< / div >
2017-03-03 00:56:07 +01:00
{% endif %}
2017-04-12 09:53:32 +02:00
2015-08-02 20:59:11 +02:00
2017-02-03 13:44:13 +01:00
{% if entry.comments|length > 0 and entry.comments[0].text|length > 0%}
2018-09-23 19:15:50 +02:00
< div class = "comments" >
2019-05-30 09:19:37 +02:00
< h3 id = "decription" > {{_('Description:')}}< / h3 >
2018-09-23 19:15:50 +02:00
{{entry.comments[0].text|safe}}
< / div >
2015-08-02 20:59:11 +02:00
{% endif %}
2017-01-12 20:43:36 +01:00
2017-07-09 12:41:09 +02:00
< div class = "more-stuff" >
2017-01-12 20:43:36 +01:00
{% if g.user.is_authenticated %}
2015-10-13 01:21:46 +02:00
{% if g.user.shelf.all() or g.public_shelfes %}
2017-07-22 20:24:47 +02:00
< div id = "shelf-actions" class = "btn-toolbar" role = "toolbar" >
2015-10-13 01:21:46 +02:00
< div class = "btn-group" role = "group" aria-label = "Add to shelves" >
2017-07-29 05:02:53 +02:00
< button id = "add-to-shelf" type = "button" class = "btn btn-primary btn-sm dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
2017-07-22 05:42:01 +02:00
< span class = "glyphicon glyphicon-list" > < / span > {{_('Add to shelf')}}
< span class = "caret" > < / span >
< / button >
2017-07-29 05:02:53 +02:00
< ul id = "add-to-shelves" class = "dropdown-menu" aria-labelledby = "add-to-shelf" >
2017-07-22 05:42:01 +02:00
{% for shelf in g.user.shelf %}
{% if not shelf.id in books_shelfs and shelf.is_public != 1 %}
< li >
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('shelf.add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
data-remove-href="{{ url_for('shelf.remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
2017-07-22 05:42:01 +02:00
data-shelf-action="add"
>
{{shelf.name}}
2015-10-13 01:21:46 +02:00
< / a >
2017-07-22 05:42:01 +02:00
< / li >
{% endif %}
{%endfor%}
{% for shelf in g.public_shelfes %}
{% if not shelf.id in books_shelfs %}
< li >
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('shelf.add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
data-remove-href="{{ url_for('shelf.remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
2017-07-22 05:42:01 +02:00
data-shelf-action="add"
>
{{shelf.name}}
2015-10-13 01:21:46 +02:00
< / a >
2017-07-22 05:42:01 +02:00
< / li >
{% endif %}
{%endfor%}
< / ul >
< / div >
< div id = "remove-from-shelves" class = "btn-group" role = "group" aria-label = "Remove from shelves" >
{% if books_shelfs %}
{% for shelf in g.user.shelf %}
{% if shelf.id in books_shelfs and shelf.is_public != 1 %}
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('shelf.remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
data-add-href="{{ url_for('shelf.add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
2017-07-22 05:42:01 +02:00
class="btn btn-sm btn-default" role="button" data-shelf-action="remove"
>
< span class = "glyphicon glyphicon-remove" > < / span > {{shelf.name}}
< / a >
{% endif %}
{%endfor%}
{% for shelf in g.public_shelfes %}
{% if shelf.id in books_shelfs %}
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('shelf.remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
data-add-href="{{ url_for('shelf.add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}"
2017-07-22 05:42:01 +02:00
class="btn btn-sm btn-default" role="button" data-shelf-action="remove"
>
< span class = "glyphicon glyphicon-remove" > < / span > {{shelf.name}}
< / a >
{% endif %}
{%endfor%}
{% endif %}
2015-10-13 01:21:46 +02:00
< / div >
2017-07-22 05:42:01 +02:00
< div id = "shelf-action-errors" class = "pull-left" role = "alert" > < / div >
2015-10-13 01:21:46 +02:00
< / div >
{% endif %}
2017-07-09 12:41:09 +02:00
2017-01-12 20:43:36 +01:00
{% endif %}
2016-04-27 10:35:23 +02:00
{% if g.user.role_edit() %}
2015-10-13 01:21:46 +02:00
< div class = "btn-toolbar" role = "toolbar" >
< div class = "btn-group" role = "group" aria-label = "Edit/Delete book" >
2019-07-13 20:45:48 +02:00
< a href = "{{ url_for('editbook.edit_book', book_id=entry.id) }}" class = "btn btn-sm btn-warning" id = "edit_book" role = "button" > < span class = "glyphicon glyphicon-edit" > < / span > {{_('Edit metadata')}}< / a >
2017-07-09 12:41:09 +02:00
< / div >
2015-10-13 01:21:46 +02:00
< / div >
{% endif %}
2017-07-09 12:41:09 +02:00
< / div >
2015-08-02 20:59:11 +02:00
< / div >
< / div >
2017-07-22 05:42:01 +02:00
< / div >
2015-08-02 20:59:11 +02:00
{% endblock %}
2017-02-19 21:08:22 +01:00
{% block js %}
2017-08-13 07:24:56 +02:00
< script type = "text/template" id = "template-shelf-add" >
< li >
< a href = "<%= add %>" data-remove-href = "<%= remove %>" data-shelf-action = "add" >
< %= content %>
< / a >
< / li >
< / script >
< script type = "text/template" id = "template-shelf-remove" >
< a href = "<%= remove %>" data-add-href = "<%= add %>" class = "btn btn-sm btn-default" data-shelf-action = "remove" >
< span class = "glyphicon glyphicon-remove" > < / span > < %= content %>
< / a >
< / script >
2017-07-22 05:42:01 +02:00
< script src = "{{ url_for('static', filename='js/details.js') }}" > < / script >
2017-02-19 21:08:22 +01:00
{% endblock %}