Add txt reader

add txt file reader,and add select for read the book
This commit is contained in:
wuqi
2016-07-16 16:44:47 +08:00
parent 9a8d795eff
commit 350f4e21e6
5 changed files with 236 additions and 41 deletions
+17 -2
View File
@@ -104,8 +104,23 @@
{% if g.user.kindle_mail %}
<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>
{% endif %}
{% for format in entry.data if format.format|lower == 'epub' or format.format|lower == 'pdf' %}
<a target="_blank" href="{{url_for('read_book', book_id=entry.id)}}" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-eye-open"></span> Read in browser</a>
{% for format in entry.data %}
{%if format.format|lower == 'epub' or format.format|lower == 'txt' or format.format|lower == 'pdf' %}
<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">
<span class="glyphicon glyphicon-download"></span>Read in browser
<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>
{% break %}
{% endif %}
{%endfor%}