|
| 1 | +{% import 'image.html' as image %} |
| 2 | +{% extends "layout.html" %} |
| 3 | +{% block body %} |
| 4 | +{% if current_user.show_detail_random() and page != "discover" %} |
| 5 | +<div class="discover random-books"> |
| 6 | + <h2 class="random-books">{{_('Discover (Random Books)')}}</h2> |
| 7 | + <div class="row display-flex"> |
| 8 | + {% for entry in random %} |
| 9 | + <div class="col-sm-3 col-lg-2 col-xs-6 book session" id="books_rand"> |
| 10 | + <div class="cover"> |
| 11 | + <a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" {% if simple==false %}data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"{% endif %}> |
| 12 | + <span class="img" title="{{ entry.Books.title }}"> |
| 13 | + {{ image.book_cover(entry.Books) }} |
| 14 | + {% if entry[2] == True %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} |
| 15 | + </span> |
| 16 | + </a> |
| 17 | + </div> |
| 18 | + <div class="meta"> |
| 19 | + <a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" {% if simple==false %}data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"{% endif %}> |
| 20 | + <p title="{{entry.Books.title}}" class="title">{{entry.Books.title|shortentitle}}</p> |
| 21 | + </a> |
| 22 | + <p class="author"> |
| 23 | + {% for author in entry.Books.authors %} |
| 24 | + {% if loop.index > g.config_authors_max and g.config_authors_max != 0 %} |
| 25 | + {% if not loop.first %} |
| 26 | + <span class="author-hidden-divider">&</span> |
| 27 | + {% endif %} |
| 28 | + <a class="author-name author-hidden" href="{{url_for('web.books_list', data='author', sort_param='stored', book_id=author.id) }}">{{author.name.replace('|',',')|shortentitle(30)}}</a> |
| 29 | + {% if loop.last %} |
| 30 | + <a href="#" class="author-expand" data-authors-max="{{g.config_authors_max}}" data-collapse-caption="({{_('reduce')}})">(...)</a> |
| 31 | + {% endif %} |
| 32 | + {% else %} |
| 33 | + {% if not loop.first %} |
| 34 | + <span>&</span> |
| 35 | + {% endif %} |
| 36 | + <a class="author-name" href="{{url_for('web.books_list', data='author', sort_param='stored', book_id=author.id) }}">{{author.name.replace('|',',')|shortentitle(30)}}</a> |
| 37 | + {% endif %} |
| 38 | + {% endfor %} |
| 39 | + </p> |
| 40 | + {% if entry.Books.series.__len__() > 0 %} |
| 41 | + <p class="series"> |
| 42 | + <a href="{{url_for('web.books_list', data='series', sort_param='stored', book_id=entry.Books.series[0].id )}}"> |
| 43 | + {{entry.Books.series[0].name}} |
| 44 | + </a> |
| 45 | + ({{entry.Books.series_index|formatfloat(2)}}) |
| 46 | + </p> |
| 47 | + {% endif %} |
| 48 | + {% if entry.Books.ratings.__len__() > 0 %} |
| 49 | + <div class="rating"> |
| 50 | + {% for number in range((entry.Books.ratings[0].rating/2)|int(2)) %} |
| 51 | + <span class="glyphicon glyphicon-star good"></span> |
| 52 | + {% if loop.last and loop.index < 5 %} |
| 53 | + {% for numer in range(5 - loop.index) %} |
| 54 | + <span class="glyphicon glyphicon-star-empty"></span> |
| 55 | + {% endfor %} |
| 56 | + {% endif %} |
| 57 | + {% endfor %} |
| 58 | + </div> |
| 59 | + {% endif %} |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + {% endfor %} |
| 63 | + </div> |
| 64 | +</div> |
| 65 | +{% endif %} |
| 66 | +<div class="discover load-more"> |
| 67 | + <h2 class="{{title}}">{{title}}</h2> |
| 68 | + {% if page != 'discover' %} |
| 69 | + <div class="filterheader hidden-xs"> |
| 70 | + {% if page == 'hot' %} |
| 71 | + <a data-toggle="tooltip" title="{{_('Sort ascending according to download count')}}" id="hot_asc" class="btn btn-primary{% if order == "hotasc" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='hotasc')}}"><span class="glyphicon glyphicon-sort-by-order"></span></a> |
| 72 | + <a data-toggle="tooltip" title="{{_('Sort descending according to download count')}}" id="hot_desc" class="btn btn-primary{% if order == "hotdesc" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='hotdesc')}}"><span class="glyphicon glyphicon-sort-by-order-alt"></span></a> |
| 73 | + {% else %} |
| 74 | + <a data-toggle="tooltip" title="{{_('Sort according to book date, newest first')}}" id="new" class="btn btn-primary{% if order == "new" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='new')}}"><span class="glyphicon glyphicon-book"></span> <span class="glyphicon glyphicon-calendar"></span><span class="glyphicon glyphicon-sort-by-order"></span></a> |
| 75 | + <a data-toggle="tooltip" title="{{_('Sort according to book date, oldest first')}}" id="old" class="btn btn-primary{% if order == "old" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='old')}}"><span class="glyphicon glyphicon-book"></span> <span class="glyphicon glyphicon-calendar"></span><span class="glyphicon glyphicon-sort-by-order-alt"></span></a> |
| 76 | + <a data-toggle="tooltip" title="{{_('Sort title in alphabetical order')}}" id="asc" class="btn btn-primary{% if order == "abc" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='abc')}}"><span class="glyphicon glyphicon-font"></span><span class="glyphicon glyphicon-sort-by-alphabet"></span></a> |
| 77 | + <a data-toggle="tooltip" title="{{_('Sort title in reverse alphabetical order')}}" id="desc" class="btn btn-primary{% if order == "zyx" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='zyx')}}"><span class="glyphicon glyphicon-font"></span><span class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a> |
| 78 | + <a data-toggle="tooltip" title="{{_('Sort authors in alphabetical order')}}" id="auth_az" class="btn btn-primary{% if order == "authaz" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='authaz')}}"><span class="glyphicon glyphicon-user"></span><span class="glyphicon glyphicon-sort-by-alphabet"></span></a> |
| 79 | + <a data-toggle="tooltip" title="{{_('Sort authors in reverse alphabetical order')}}" id="auth_za" class="btn btn-primary{% if order == "authza" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='authza')}}"><span class="glyphicon glyphicon-user"></span><span class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a> |
| 80 | + <a data-toggle="tooltip" title="{{_('Sort according to publishing date, newest first')}}" id="pub_new" class="btn btn-primary{% if order == "pubnew" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='pubnew')}}"><span class="glyphicon glyphicon-calendar"></span><span class="glyphicon glyphicon-sort-by-order"></span></a> |
| 81 | + <a data-toggle="tooltip" title="{{_('Sort according to publishing date, oldest first')}}" id="pub_old" class="btn btn-primary{% if order == "pubold" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='pubold')}}"><span class="glyphicon glyphicon-calendar"></span><span class="glyphicon glyphicon-sort-by-order-alt"></span></a> |
| 82 | + {% if page == 'series' %} |
| 83 | + <a data-toggle="tooltip" title="{{_('Sort ascending according to series index')}}" id="series_asc" class="btn btn-primary{% if order == "seriesasc" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='seriesasc')}}"><span class="glyphicon glyphicon-sort-by-order"></span></a> |
| 84 | + <a data-toggle="tooltip" title="{{_('Sort descending according to series index')}}" id="series_desc" class="btn btn-primary{% if order == "seriesdesc" %} active{% endif%}" href="{{url_for('web.books_list', data=page, book_id=id, sort_param='seriesdesc')}}"><span class="glyphicon glyphicon-sort-by-order-alt"></span></a> |
| 85 | + {% endif %} |
| 86 | + {% endif %} |
| 87 | + </div> |
| 88 | + {% endif %} |
| 89 | + <div class="row display-flex"> |
| 90 | + {% if entries[0] %} |
| 91 | + {% for entry in entries %} |
| 92 | + <div class="col-sm-3 col-lg-2 col-xs-6 book session" id="books"> |
| 93 | + <div class="cover"> |
| 94 | + <a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" {% if simple==false %}data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"{% endif %}> |
| 95 | + <span class="img" title="{{ entry.Books.title }}"> |
| 96 | + {{ image.book_cover(entry.Books) }} |
| 97 | + {% if entry[2] == True %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} |
| 98 | + </span> |
| 99 | + </a> |
| 100 | + </div> |
| 101 | + <div class="meta"> |
| 102 | + <a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" {% if simple==false %}data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"{% endif %}> |
| 103 | + <p title="{{ entry.Books.title }}" class="title">{{entry.Books.title|shortentitle}}</p> |
| 104 | + </a> |
| 105 | + <p class="author"> |
| 106 | + {% for author in entry.Books.authors %} |
| 107 | + {% if loop.index > g.config_authors_max and g.config_authors_max != 0 %} |
| 108 | + {% if not loop.first %} |
| 109 | + <span class="author-hidden-divider">&</span> |
| 110 | + {% endif %} |
| 111 | + <a class="author-name author-hidden" href="{{url_for('web.books_list', data='author', book_id=author.id, sort_param='stored') }}">{{author.name.replace('|',',')|shortentitle(30)}}</a> |
| 112 | + {% if loop.last %} |
| 113 | + <a href="#" class="author-expand" data-authors-max="{{g.config_authors_max}}" data-collapse-caption="({{_('reduce')}})">(...)</a> |
| 114 | + {% endif %} |
| 115 | + {% else %} |
| 116 | + {% if not loop.first %} |
| 117 | + <span>&</span> |
| 118 | + {% endif %} |
| 119 | + <a class="author-name" href="{{url_for('web.books_list', data='author', book_id=author.id, sort_param='stored') }}">{{author.name.replace('|',',')|shortentitle(30)}}</a> |
| 120 | + {% endif %} |
| 121 | + {% endfor %} |
| 122 | + {% if entry.Books.data|music %} |
| 123 | + <span class="glyphicon glyphicon-music"></span> |
| 124 | + {% endif %} |
| 125 | + </p> |
| 126 | + {% if entry.Books.series.__len__() > 0 %} |
| 127 | + <p class="series"> |
| 128 | + {% if page != "series" %} |
| 129 | + <a href="{{url_for('web.books_list', data='series', sort_param='stored', book_id=entry.Books.series[0].id )}}"> |
| 130 | + {{entry.Books.series[0].name}} |
| 131 | + </a> |
| 132 | + {% else %} |
| 133 | + <span>{{entry.Books.series[0].name}}</span> |
| 134 | + {% endif %} |
| 135 | + ({{entry.Books.series_index|formatfloat(2)}}) |
| 136 | + </p> |
| 137 | + {% endif %} |
| 138 | + {% if entry.Books.ratings.__len__() > 0 %} |
| 139 | + <div class="rating"> |
| 140 | + {% for number in range((entry.Books.ratings[0].rating/2)|int(2)) %} |
| 141 | + <span class="glyphicon glyphicon-star good"></span> |
| 142 | + {% if loop.last and loop.index < 5 %} |
| 143 | + {% for numer in range(5 - loop.index) %} |
| 144 | + <span class="glyphicon glyphicon-star-empty"></span> |
| 145 | + {% endfor %} |
| 146 | + {% endif %} |
| 147 | + {% endfor %} |
| 148 | + </div> |
| 149 | + {% endif %} |
| 150 | + </div> |
| 151 | + </div> |
| 152 | + {% endfor %} |
| 153 | + {% endif %} |
| 154 | + </div> |
| 155 | +</div> |
| 156 | +{% endblock %} |
0 commit comments