2015-08-02 18:59:11 +00:00
|
|
|
|
{% extends "layout.html" %}
|
|
|
|
|
{% block body %}
|
|
|
|
|
<div class="single">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-3 col-lg-3 col-xs-12">
|
|
|
|
|
<div class="cover">
|
|
|
|
|
{% if entry.has_cover is defined %}
|
|
|
|
|
<img src="{{ url_for('get_cover', cover_path=entry.path) }}" />
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2016-04-03 21:33:29 +00:00
|
|
|
|
<div class="col-sm-9 col-lg-9 book-meta">
|
2015-08-02 18:59:11 +00:00
|
|
|
|
<h2>{{entry.title}}</h2>
|
2016-04-15 21:35:18 +00:00
|
|
|
|
<p class="author">
|
|
|
|
|
{% for author in entry.authors %}
|
|
|
|
|
<a href="{{url_for('author', name=author.name) }}">{{author.name}}</a>
|
|
|
|
|
{% if not loop.last %}
|
|
|
|
|
&
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</p>
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{% if entry.ratings.__len__() > 0 %}
|
|
|
|
|
<div class="rating">
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<p>
|
2015-08-02 18:59:11 +00: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-12 23:21:46 +00:00
|
|
|
|
</p>
|
2015-08-02 18:59:11 +00:00
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if entry.series|length > 0 %}
|
|
|
|
|
<p>Book {{entry.series_index}} of <a href="{{url_for('series', name=entry.series[0].name)}}">{{entry.series[0].name}}</a></p>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2015-10-12 23:21:46 +00:00
|
|
|
|
{% if entry.languages.__len__() > 0 %}
|
|
|
|
|
<div class="languages">
|
|
|
|
|
<p>
|
|
|
|
|
<span class="label label-default">language: {{entry.languages[0].lang_code}}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{% if entry.tags|length > 0 %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<p>
|
|
|
|
|
<div class="tags">
|
|
|
|
|
<span class="glyphicon glyphicon-tags"></span>
|
|
|
|
|
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{% for tag in entry.tags %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<a href="{{ url_for('category', name=tag.name) }}" class="btn btn-xs btn-info" role="button">{{tag.name}}</a>
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{%endfor%}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</p>
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{% endif %}
|
2016-04-19 22:20:02 +00:00
|
|
|
|
|
|
|
|
|
{% if cc|length > 0 %}
|
|
|
|
|
<p>
|
|
|
|
|
<div class="custom_columns">
|
|
|
|
|
{% for c in cc %}
|
|
|
|
|
{% if entry['custom_column_' ~ c.id]|length > 0 %}
|
|
|
|
|
{{ c.name }}:
|
|
|
|
|
{% for column in entry['custom_column_' ~ c.id] %}
|
2016-04-21 10:59:49 +00:00
|
|
|
|
{% if c.datatype == 'rating' %}
|
|
|
|
|
{{ '%d' % (column.value / 2) }}
|
|
|
|
|
{% else %}
|
2016-04-21 12:46:19 +00:00
|
|
|
|
{{ column.value }}
|
2016-04-21 10:59:49 +00:00
|
|
|
|
{% endif %}
|
2016-04-19 22:20:02 +00:00
|
|
|
|
{% endfor %}
|
|
|
|
|
<br />
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2015-08-02 18:59:11 +00:00
|
|
|
|
|
|
|
|
|
{% if entry.comments|length > 0 %}
|
|
|
|
|
<h3>Description:</h3>
|
2015-10-11 19:30:43 +00:00
|
|
|
|
{{entry.comments[0].text|safe}}
|
2015-08-02 18:59:11 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if g.user.is_authenticated() %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<div class="more-stuff">
|
|
|
|
|
<div class="btn-toolbar" role="toolbar">
|
|
|
|
|
|
|
|
|
|
<div class="btn-group" role="group" aria-label="Download, send to Kindle, reading">
|
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
|
<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 %}
|
2015-08-02 18:59:11 +00:00
|
|
|
|
<li><a href="{{ url_for('get_download_link', book_id=entry.id, format=format.format|lower) }}">{{format.format}}</a></li>
|
2015-10-12 23:21:46 +00:00
|
|
|
|
{%endfor%}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
{% if g.user.kindle_mail %}
|
2016-03-27 21:36:51 +00:00
|
|
|
|
<a href="{{url_for('send_to_kindle', book_id=entry.id)}}" id="sendbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-send"></span> Send to Kindle</a>
|
2015-10-12 23:21:46 +00:00
|
|
|
|
{% endif %}
|
2016-07-16 08:44:47 +00:00
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
|
<button id="btnGroupDrop2" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
2016-07-16 09:26:40 +00:00
|
|
|
|
<span class="glyphicon glyphicon-eye-open"></span>Read in browser
|
2016-07-16 08:44:47 +00:00
|
|
|
|
<span class="caret"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop2">
|
|
|
|
|
{% for format in entry.data %}
|
|
|
|
|
{%if format.format|lower == 'epub' or format.format|lower == 'txt' or format.format|lower == 'pdf' %}
|
|
|
|
|
<li><a target="_blank" href="{{ url_for('read_book', book_id=entry.id, format=format.format|lower) }}">{{format.format}}</a></li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{%endfor%}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2015-10-12 23:21:46 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</br>
|
|
|
|
|
|
|
|
|
|
{% if g.user.shelf.all() or g.public_shelfes %}
|
|
|
|
|
<div class="btn-toolbar" role="toolbar">
|
|
|
|
|
<div class="btn-group" role="group" aria-label="Add to shelves">
|
|
|
|
|
<button id="btnGroupDrop2" type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
|
<span class="glyphicon glyphicon-list"></span> Add to shelf
|
|
|
|
|
<span class="caret"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop2">
|
|
|
|
|
{% for shelf in g.user.shelf %}
|
|
|
|
|
{% if not shelf.id in books_shelfs and shelf.is_public != 1 %}
|
|
|
|
|
<li><a href="{{ url_for('add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}">{{shelf.name}}</a></li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{%endfor%}
|
|
|
|
|
{% for shelf in g.public_shelfes %}
|
|
|
|
|
{% if not shelf.id in books_shelfs %}
|
|
|
|
|
<li><a href="{{ url_for('add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}">{{shelf.name}}</a></li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{%endfor%}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2015-10-12 01:09:56 +00:00
|
|
|
|
{% if books_shelfs %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<div class="btn-group" role="group" aria-label="Remove from shelves">
|
2015-10-12 01:09:56 +00:00
|
|
|
|
{% for shelf in g.user.shelf %}
|
|
|
|
|
{% if shelf.id in books_shelfs and shelf.is_public != 1 %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<a href="{{ url_for('remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}" class="btn btn-sm btn-default" role="button">
|
|
|
|
|
<span class="glyphicon glyphicon-remove"></span> {{shelf.name}}
|
|
|
|
|
</a>
|
2015-10-12 01:09:56 +00:00
|
|
|
|
{% endif %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
{%endfor%}
|
2015-10-12 01:09:56 +00:00
|
|
|
|
{% for shelf in g.public_shelfes %}
|
|
|
|
|
{% if shelf.id in books_shelfs %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<a href="{{ url_for('remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}" class="btn btn-sm btn-default" role="button">
|
|
|
|
|
<span class="glyphicon glyphicon-remove"></span> {{shelf.name}}
|
|
|
|
|
</a>
|
2015-10-12 01:09:56 +00:00
|
|
|
|
{% endif %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
{%endfor%}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2016-04-27 08:35:23 +00:00
|
|
|
|
{% if g.user.role_edit() %}
|
2015-10-12 23:21:46 +00:00
|
|
|
|
<div class="btn-toolbar" role="toolbar">
|
|
|
|
|
<div class="btn-group" role="group" aria-label="Edit/Delete book">
|
|
|
|
|
<a href="{{ url_for('edit_book', book_id=entry.id) }}" class="btn btn-sm btn-warning" role="button"><span class="glyphicon glyphicon-edit"></span> Edit metadata</a>
|
|
|
|
|
<!-- <a href="{{ url_for('edit_book', book_id=entry.id) }}" class="btn btn-sm btn-danger" role="button"><span class="glyphicon glyphicon-trash"></span> Delete</a> -->
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2015-08-02 18:59:11 +00:00
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|