From 15aa49e16313004d89f0149206869ce62f7cebe7 Mon Sep 17 00:00:00 2001 From: Virgil Grigoras Date: Mon, 25 Feb 2019 19:27:59 +0100 Subject: [PATCH] shorten authors in author / discover / index / search and shelf --- cps/templates/author.html | 34 +++++++++++++++++++++++----------- cps/templates/discover.html | 16 +++++++++++++--- cps/templates/index.html | 32 ++++++++++++++++++++++++++------ cps/templates/search.html | 16 +++++++++++++--- cps/templates/shelf.html | 16 +++++++++++++--- 5 files changed, 88 insertions(+), 26 deletions(-) diff --git a/cps/templates/author.html b/cps/templates/author.html index 2ebe8c4e..4fe231bb 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -41,10 +41,20 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')}} - {% if not loop.last %} - & - {% endif %} + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% endif %} {% endfor %}

{% if entry.ratings.__len__() > 0 %} @@ -80,13 +90,15 @@

{{entry.title|shortentitle}}

- {% for author in entry.authors %} - - {{author.name.replace('|',',')}} - - {% if not loop.last %} - & - {% endif %} + {% for author in entry.authors %} + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {{author.name.replace('|',',')}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {{author.name.replace('|',',')}} + {% endif %} {% endfor %}

diff --git a/cps/templates/discover.html b/cps/templates/discover.html index e8e848e7..624b2d07 100644 --- a/cps/templates/discover.html +++ b/cps/templates/discover.html @@ -19,9 +19,19 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')|shortentitle(30)}} - {% if not loop.last %} - & + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}

diff --git a/cps/templates/index.html b/cps/templates/index.html index 4c2b6375..5674aeed 100755 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -22,9 +22,19 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')|shortentitle(30)}} - {% if not loop.last %} - & + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}

@@ -67,9 +77,19 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')|shortentitle(30)}} - {% if not loop.last %} - & + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}

diff --git a/cps/templates/search.html b/cps/templates/search.html index d8fde51a..41f643c7 100644 --- a/cps/templates/search.html +++ b/cps/templates/search.html @@ -46,9 +46,19 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')}} - {% if not loop.last %} - & + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}

diff --git a/cps/templates/shelf.html b/cps/templates/shelf.html index f48889dd..fa89a61a 100644 --- a/cps/templates/shelf.html +++ b/cps/templates/shelf.html @@ -28,9 +28,19 @@

{% for author in entry.authors %} - {{author.name.replace('|',',')}} - {% if not loop.last %} - & + {% if loop.index > config_authors_max and config_authors_max != 0 %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} + {% if loop.last %} + (...) + {% endif %} + {% else %} + {% if not loop.first %} + & + {% endif %} + {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}