From 80ada1ed7f831cb27ff6719c6eee4a8534ff6ec3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 20 Feb 2022 12:22:15 -0500 Subject: [PATCH] tweak book result template --- common/templates/partial/list_item_book.html | 29 ++++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/common/templates/partial/list_item_book.html b/common/templates/partial/list_item_book.html index 1b95cc97..863218a6 100644 --- a/common/templates/partial/list_item_book.html +++ b/common/templates/partial/list_item_book.html @@ -48,15 +48,11 @@ {% endif %} - {% if book.pub_year %} - {{ book.pub_year }}{% trans '年' %} - {% if book.pub_month %} - {{book.pub_month }}{% trans '月' %} - {% endif %}/ + {% if book.pub_year %} / + {{ book.pub_year }}{% trans '年' %}{% if book.pub_month %}{{book.pub_month }}{% trans '月' %}{% endif %} {% endif %} - {% if book.author %} - {% trans '作者' %}: + {% if book.author %} / {% for author in book.author %} {% if request.GET.q %} {{ author | highlight:request.GET.q }} @@ -64,11 +60,11 @@ {{ author }} {% endif %} {% if not forloop.last %},{% endif %} - {% endfor %}/ + {% endfor %} {% endif %} - {% if book.translator %} - {% trans '译者' %}: + {% if book.translator %} / + {% trans '翻译' %}: {% for translator in book.translator %} {% if request.GET.q %} {{ translator | highlight:request.GET.q }} @@ -76,10 +72,19 @@ {{ translator }} {% endif %} {% if not forloop.last %},{% endif %} - {% endfor %}/ + {% endfor %} {% endif %} - {% if book.orig_title %} + {% if book.subtitle %} / + {% trans '副标题' %}: + {% if request.GET.q %} + {{ book.subtitle | highlight:request.GET.q }} + {% else %} + {{ book.subtitle }} + {% endif %} + {% endif %} + + {% if book.orig_title %} / {% trans '原名' %}: {% if request.GET.q %} {{ book.orig_title | highlight:request.GET.q }}