2015-08-02 18:59:11 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
2016-11-09 18:24:33 +00:00
|
|
|
{% if g.user.show_random_books() %}
|
2015-08-02 18:59:11 +00:00
|
|
|
<div class="discover">
|
2016-11-09 18:24:33 +00:00
|
|
|
<h2>{{_('Discover (Random Books)')}}</h2>
|
2015-08-02 18:59:11 +00:00
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
{% for entry in random %}
|
|
|
|
<div class="col-sm-3 col-lg-2 col-xs-6 book">
|
|
|
|
<div class="cover">
|
|
|
|
<a href="{{ url_for('show_book', id=entry.id) }}">
|
2017-01-21 16:04:36 +00:00
|
|
|
{% if entry.has_cover %}
|
|
|
|
<img src="{{ url_for('get_cover', cover_path=entry.path.replace('\\','/')) }}" />
|
|
|
|
{% else %}
|
|
|
|
<img src="{{ url_for('static', filename='generic_cover.jpg') }}" />
|
|
|
|
{% endif %}
|
2015-08-02 18:59:11 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="meta">
|
2016-04-03 21:33:29 +00:00
|
|
|
<p class="title">{{entry.title|shortentitle}}</p>
|
2015-08-02 18:59:11 +00:00
|
|
|
<p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p>
|
|
|
|
{% if entry.ratings.__len__() > 0 %}
|
|
|
|
<div class="rating">
|
|
|
|
{% 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 %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-26 15:12:29 +00:00
|
|
|
{% endif %}
|
2015-08-02 18:59:11 +00:00
|
|
|
<div class="discover load-more">
|
|
|
|
<h2>{{title}}</h2>
|
|
|
|
<div class="row">
|
|
|
|
{% for entry in entries %}
|
|
|
|
<div class="col-sm-3 col-lg-2 col-xs-6 book">
|
|
|
|
<div class="cover">
|
|
|
|
<a href="{{ url_for('show_book', id=entry.id) }}">
|
2017-01-21 16:04:36 +00:00
|
|
|
{% if entry.has_cover %}
|
|
|
|
<img src="{{ url_for('get_cover', cover_path=entry.path.replace('\\','/')) }}" />
|
|
|
|
{% else %}
|
|
|
|
<img src="{{ url_for('static', filename='generic_cover.jpg') }}" />
|
|
|
|
{% endif %}
|
2015-08-02 18:59:11 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="meta">
|
2016-04-03 21:33:29 +00:00
|
|
|
<p class="title">{{entry.title|shortentitle}}</p>
|
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">
|
|
|
|
{% 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 %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|