From 67dd4a72b09306fa410425904797c7be98afdac8 Mon Sep 17 00:00:00 2001 From: Michael Knepher Date: Fri, 26 Jun 2020 12:26:36 -0700 Subject: [PATCH] Add series info to all book "meta" displays --- cps/templates/author.html | 16 ++++++++++++++++ cps/templates/index.html | 2 +- cps/templates/shelfdown.html | 9 ++++++++- cps/web.py | 3 ++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/cps/templates/author.html b/cps/templates/author.html index 0d4369a3..cce173b0 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -70,6 +70,14 @@ {% endif %} {% endfor %}

+ {% if entry.series.__len__() > 0 %} +

+ + {{entry.series[0].name}} + + ({{entry.series_index}}) +

+ {% endif %} {% if entry.ratings.__len__() > 0 %}
{% for number in range((entry.ratings[0].rating/2)|int(2)) %} @@ -114,6 +122,14 @@ {% endif %} {% endfor %}

+ {% if entry.series.__len__() > 0 %} +

+ + {{entry.series[0].name}} + + ({{entry.series_index}}) +

+ {% endif %}
{% for number in range((entry.average_rating)|float|round|int(2)) %} diff --git a/cps/templates/index.html b/cps/templates/index.html index 16f2b461..f39a7181 100644 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -20,7 +20,7 @@ {% if loop.index > g.config_authors_max and g.config_authors_max != 0 %} {% if not loop.first %} & - {% endif %} + {% endif %} {{author.name.replace('|',',')|shortentitle(30)}} {% if loop.last %} (...) diff --git a/cps/templates/shelfdown.html b/cps/templates/shelfdown.html index b2ac947f..0491bbec 100644 --- a/cps/templates/shelfdown.html +++ b/cps/templates/shelfdown.html @@ -43,7 +43,14 @@ {% endif %} {% endfor %}

- + {% if entry.series.__len__() > 0 %} +

+ + {{entry.series[0].name}} + + ({{entry.series_index}}) +

+ {% endif %}
diff --git a/cps/web.py b/cps/web.py index 3c31dee1..3e6d7c63 100644 --- a/cps/web.py +++ b/cps/web.py @@ -841,8 +841,9 @@ def books_table(): @login_required_if_no_ano def author_list(): if current_user.check_visibility(constants.SIDEBAR_AUTHOR): - entries = calibre_db.session.query(db.Authors, func.count('books_authors_link.book').label('count')) \ + entries = calibre_db.session.query(db.Authors, func.count('books_authors_link.book').label('count'), db.Series) \ .join(db.books_authors_link).join(db.Books).filter(calibre_db.common_filters()) \ + .join(db.books_series_link).join(db.Series).filter(calibre_db.common_filters()) \ .group_by(text('books_authors_link.author')).order_by(db.Authors.sort).all() charlist = calibre_db.session.query(func.upper(func.substr(db.Authors.sort, 1, 1)).label('char')) \ .join(db.books_authors_link).join(db.Books).filter(calibre_db.common_filters()) \