@ -47,55 +47,83 @@
< ul class = "list-unstyled more-stuff" >
< ul class = "list-unstyled more-stuff" >
{% if g.user.kindle_mail %}
< li > < a href = "{{url_for('send_to_kindle', book_id=entry.id)}}" > < div class = "btn btn-info" > < span class = "glyphicon glyphicon-send" > < / span > Send to Kindle< / div > < / a > < / li >
{% endif %}
<!-- <li>
< span class = "glyphicon glyphicon-cloud-download" > < / span >
{% for format in entry.data %}
< a href = "{{ url_for('get_download_link', book_id=entry.id, format=format.format|lower) }}" > {{format.format}}< / a > ,
{%endfor%}
< / li > -->
< li >
< div class = "btn-group" >
< button type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" >
< span class = "glyphicon glyphicon-download" > < / span > Download < span class = "caret" > < / span >
< / button >
< ul class = "dropdown-menu" role = "menu" >
{% for format in entry.data %}
< li > < a href = "{{ url_for('get_download_link', book_id=entry.id, format=format.format|lower) }}" > {{format.format}}< / a > < / li >
{%endfor%}
< / ul >
< / div >
< / li >
< li > < a target = "_blank" href = "{{url_for('read_book', book_id=entry.id)}}" > < div class = "btn btn-primary" > < span class = "glyphicon glyphicon-eye-open" > < / span > Read online< / div > < / a > < / li >
{% if g.user.shelf.all() or g.public_shelfes %}
{% if g.user.shelf.all() or g.public_shelfes %}
< li >
< li >
< div class = "btn-group" >
< div class = "btn-group" >
< button type = "button" class = "btn btn-default dropdown-toggle" data-toggle = "dropdown" >
< button type = "button" class = "btn btn- sm btn- default dropdown-toggle" data-toggle = "dropdown" >
< span class = "glyphicon glyphicon-list" > < / span > add this book to a shelf < span class = "caret" > < / span >
< span class = "glyphicon glyphicon-list" > < / span > Add to shelf < span class = "caret" > < / span >
< / button >
< / button >
< ul class = "dropdown-menu" role = "menu" >
< ul class = "dropdown-menu" role = "menu" >
{% for shelf in g.user.shelf %}
{% 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 >
< li > < a href = "{{ url_for('add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}" > {{shelf.name}}< / a > < / li >
{% endif %}
{% endfor %}
{% endfor %}
{% for shelf in g.public_shelfes %}
{% 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 >
< li > < a href = "{{ url_for('add_to_shelf', book_id=entry.id, shelf_id=shelf.id) }}" > {{shelf.name}}< / a > < / li >
{% endif %}
{% endfor %}
{% endfor %}
< / ul >
< / ul >
< / div >
< / div >
< / li >
< / li >
{% endif %}
{% endif %}
{% if g.user.kindle_mail %}
< li > < a href = "{{url_for('send_to_kindle', book_id=entry.id)}}" > < div class = "btn btn-default" > < span class = "glyphicon glyphicon-send" > < / span > Send ebook to kindle< / div > < / a > < / li >
{% endif %}
{% if books_shelfs %}
<!-- <li>
< span class = "glyphicon glyphicon-cloud-download" > < / span >
{% for format in entry.data %}
< a href = "{{ url_for('get_download_link', book_id=entry.id, format=format.format|lower) }}" > {{format.format}}< / a > ,
{%endfor%}
< / li > -->
< li >
< li >
< div class = "btn-group" >
< div class = "btn-group" >
< button type = "button" class = "btn btn-s uccess dropdown-toggle" data-toggle = "dropdown" >
< button type = "button" class = "btn btn-sm btn-default dropdown-toggle" data-toggle = "dropdown" >
< span class = "glyphicon glyphicon- download"> < / span > download this ebook < span class = "caret" > < / span >
< span class = "glyphicon glyphicon-list" > < / span > Remove from shelf < span class = "caret" > < / span >
< / button >
< / button >
< ul class = "dropdown-menu" role = "menu" >
< ul class = "dropdown-menu" role = "menu" >
{% for format in entry.data %}
{% for shelf in g.user.shelf %}
< li > < a href = "{{ url_for('get_download_link', book_id=entry.id, format=format.format|lower) }}" > {{format.format}}< / a > < / li >
{% if shelf.id in books_shelfs and shelf.is_public != 1 %}
< li > < a href = "{{ url_for('remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}" > {{shelf.name}}< / a > < / li >
{% endif %}
{% endfor %}
{% for shelf in g.public_shelfes %}
{% if shelf.id in books_shelfs %}
< li > < a href = "{{ url_for('remove_from_shelf', book_id=entry.id, shelf_id=shelf.id) }}" > {{shelf.name}}< / a > < / li >
{% endif %}
{% endfor %}
{% endfor %}
< / ul >
< / ul >
< / div >
< / div >
< / li >
< / li >
{% endif %}
< li > < a target = "_blank" href = "{{url_for('read_book', book_id=entry.id)}}" > < div class = "btn btn-default" > < span class = "glyphicon glyphicon-eye-open" > < / span > read this book online< / div > < / a > < / li >
{% if g.user.role %}
{% if g.user.role %}
< li > < a href = "{{ url_for('edit_book', book_id=entry.id) }}" > < div class = "btn btn- warning"> < span class = "glyphicon glyphicon-edit" > < / span > Edit book< / div > < / a > < / li >
< li > < a href = "{{ url_for('edit_book', book_id=entry.id) }}" > < div class = "btn btn- xs btn- warning"> < span class = "glyphicon glyphicon-edit" > < / span > Edit book< / div > < / a > < / li >
< li > < a href = "{{ url_for('edit_book', book_id=entry.id) }}" > < div class = "btn btn- danger"> < span class = "glyphicon glyphicon-trash" > < / span > Delete book< / div > < / a > < / li >
< li > < a href = "{{ url_for('edit_book', book_id=entry.id) }}" > < div class = "btn btn- xs btn- danger"> < span class = "glyphicon glyphicon-trash" > < / span > Delete book< / div > < / a > < / li >
{% endif %}
{% endif %}
{% endif %}
{% endif %}
< / ul >
< / ul >