From 80fa8366ac1ab343f8f5a72b2579f9ef8ce9155c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 9 Jun 2023 02:45:27 -0400 Subject: [PATCH] cleanup unused templates --- catalog/search/views.py | 6 +- .../{fetch_failed.html => _fetch_failed.html} | 0 ...fetch_refresh.html => _fetch_refresh.html} | 0 ...item_comments.html => _item_comments.html} | 0 .../{item_reviews.html => _item_reviews.html} | 0 .../{sidebar_item.html => _sidebar_item.html} | 0 catalog/templates/_sidebar_search.html | 43 ++ catalog/templates/fetch_pending.html | 4 +- catalog/templates/item_base.html | 10 +- catalog/templates/item_mark_list.html | 2 +- catalog/templates/item_review_list.html | 2 +- catalog/templates/search_results.html | 4 +- catalog/templates/search_sidebar.html | 45 -- catalog/views.py | 4 +- journal/templates/_list_item.html | 4 +- journal/templates/list_item_album.html | 20 - journal/templates/list_item_edition.html | 53 -- journal/templates/list_item_game.html | 36 -- journal/templates/list_item_movie.html | 42 -- journal/templates/list_item_performance.html | 22 - .../list_item_performanceproduction.html | 1 - journal/templates/list_item_podcast.html | 13 - journal/templates/list_item_tvseason.html | 43 -- journal/templates/list_item_tvshow.html | 42 -- journal/templates/list_item_work.html | 1 - journal/templates/mark.html | 566 +++++++++--------- journal/templates/mark2.html | 315 ---------- journal/templates/review.html | 2 +- journal/templates/review_edit.html | 2 +- journal/views.py | 2 +- .../activity/comment_focus_item.html | 4 +- social/templates/activity/mark_item.html | 4 +- social/templates/activity/review_item.html | 4 +- 33 files changed, 341 insertions(+), 955 deletions(-) rename catalog/templates/{fetch_failed.html => _fetch_failed.html} (100%) rename catalog/templates/{fetch_refresh.html => _fetch_refresh.html} (100%) rename catalog/templates/{item_comments.html => _item_comments.html} (100%) rename catalog/templates/{item_reviews.html => _item_reviews.html} (100%) rename catalog/templates/{sidebar_item.html => _sidebar_item.html} (100%) create mode 100644 catalog/templates/_sidebar_search.html delete mode 100644 catalog/templates/search_sidebar.html delete mode 100644 journal/templates/list_item_album.html delete mode 100644 journal/templates/list_item_edition.html delete mode 100644 journal/templates/list_item_game.html delete mode 100644 journal/templates/list_item_movie.html delete mode 100644 journal/templates/list_item_performance.html delete mode 100644 journal/templates/list_item_performanceproduction.html delete mode 100644 journal/templates/list_item_podcast.html delete mode 100644 journal/templates/list_item_tvseason.html delete mode 100644 journal/templates/list_item_tvshow.html delete mode 100644 journal/templates/list_item_work.html delete mode 100644 journal/templates/mark2.html diff --git a/catalog/search/views.py b/catalog/search/views.py index e4b68da1..51f624d1 100644 --- a/catalog/search/views.py +++ b/catalog/search/views.py @@ -39,17 +39,17 @@ def fetch_refresh(request, job_id): item_url = "-" if item_url: if item_url == "-": - return render(request, "fetch_failed.html") + return render(request, "_fetch_failed.html") else: return HTTPResponseHXRedirect(item_url) else: retry = int(request.GET.get("retry", 0)) + 1 if retry > 10: - return render(request, "fetch_failed.html") + return render(request, "_fetch_failed.html") else: return render( request, - "fetch_refresh.html", + "_fetch_refresh.html", {"job_id": job_id, "retry": retry, "delay": retry * 2}, ) diff --git a/catalog/templates/fetch_failed.html b/catalog/templates/_fetch_failed.html similarity index 100% rename from catalog/templates/fetch_failed.html rename to catalog/templates/_fetch_failed.html diff --git a/catalog/templates/fetch_refresh.html b/catalog/templates/_fetch_refresh.html similarity index 100% rename from catalog/templates/fetch_refresh.html rename to catalog/templates/_fetch_refresh.html diff --git a/catalog/templates/item_comments.html b/catalog/templates/_item_comments.html similarity index 100% rename from catalog/templates/item_comments.html rename to catalog/templates/_item_comments.html diff --git a/catalog/templates/item_reviews.html b/catalog/templates/_item_reviews.html similarity index 100% rename from catalog/templates/item_reviews.html rename to catalog/templates/_item_reviews.html diff --git a/catalog/templates/sidebar_item.html b/catalog/templates/_sidebar_item.html similarity index 100% rename from catalog/templates/sidebar_item.html rename to catalog/templates/_sidebar_item.html diff --git a/catalog/templates/_sidebar_search.html b/catalog/templates/_sidebar_search.html new file mode 100644 index 00000000..9e6417b6 --- /dev/null +++ b/catalog/templates/_sidebar_search.html @@ -0,0 +1,43 @@ +{% load static %} +{% load i18n %} +{% load l10n %} + +
+
{% trans '没有想要的结果?' %}
+

+ 如果在 + {% for site in sites %} + {{ site }} + {% if not forloop.last %}/{% endif %} + {% endfor %} + 找到了条目,可以在搜索栏中输入完整链接提交。 +

+

当然也可以手工创建条目:

+ +
diff --git a/catalog/templates/fetch_pending.html b/catalog/templates/fetch_pending.html index e4ebdcf0..ab670404 100644 --- a/catalog/templates/fetch_pending.html +++ b/catalog/templates/fetch_pending.html @@ -29,7 +29,9 @@ - {% include "search_sidebar.html" %} + {% include 'partial/_footer.html' %} diff --git a/catalog/templates/item_base.html b/catalog/templates/item_base.html index 40912543..417e0851 100644 --- a/catalog/templates/item_base.html +++ b/catalog/templates/item_base.html @@ -58,7 +58,7 @@ {% if v %} {% endif %} @@ -86,7 +86,7 @@
{% include "partial/_footer.html" %} diff --git a/catalog/templates/item_review_list.html b/catalog/templates/item_review_list.html index f5241658..073bab3b 100644 --- a/catalog/templates/item_review_list.html +++ b/catalog/templates/item_review_list.html @@ -79,7 +79,7 @@ {% include "partial/_footer.html" %} diff --git a/catalog/templates/search_results.html b/catalog/templates/search_results.html index f3200e5f..68d86460 100644 --- a/catalog/templates/search_results.html +++ b/catalog/templates/search_results.html @@ -126,7 +126,9 @@ - {% include "search_sidebar.html" %} + {% include 'partial/_footer.html' %} diff --git a/catalog/templates/search_sidebar.html b/catalog/templates/search_sidebar.html deleted file mode 100644 index 5185545c..00000000 --- a/catalog/templates/search_sidebar.html +++ /dev/null @@ -1,45 +0,0 @@ -{% load static %} -{% load i18n %} -{% load l10n %} - - diff --git a/catalog/views.py b/catalog/views.py index f6d9e3ca..95ef31f3 100644 --- a/catalog/views.py +++ b/catalog/views.py @@ -379,7 +379,7 @@ def comments(request, item_path, item_uuid): queryset = queryset.filter(created_time__lte=before_time) return render( request, - "item_comments.html", + "_item_comments.html", { "item": item, "comments": queryset[:11], @@ -400,7 +400,7 @@ def reviews(request, item_path, item_uuid): queryset = queryset.filter(created_time__lte=before_time) return render( request, - "item_reviews.html", + "_item_reviews.html", { "item": item, "reviews": queryset[:11], diff --git a/journal/templates/_list_item.html b/journal/templates/_list_item.html index 7a3bba76..12729309 100644 --- a/journal/templates/_list_item.html +++ b/journal/templates/_list_item.html @@ -22,7 +22,7 @@ {% if not action.taken %} @@ -30,7 +30,7 @@ {% else %} diff --git a/journal/templates/list_item_album.html b/journal/templates/list_item_album.html deleted file mode 100644 index 473718f8..00000000 --- a/journal/templates/list_item_album.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.artist %} - {% trans '艺术家' %}: - {% for artist in item.artist %} - {{ artist }} - {% if not forloop.last %}{% endif %} - {% endfor %} - {% endif %} - {% if item.genre %} - / {% trans '流派' %}: - {{ item.genre }} - {% endif %} - {% if item.release_date %} - / {% trans '发行日期' %}: - {{ item.release_date }} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_edition.html b/journal/templates/list_item_edition.html deleted file mode 100644 index a645e04e..00000000 --- a/journal/templates/list_item_edition.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.pub_year %} - / - {{ item.pub_year }}{% trans '年' %} - {% if item.pub_month %} - {{ item.pub_month }}{% trans '月' %} - {% endif %} - {% endif %} - {% if item.author %} - / - {% for author in item.author %} - {% if request.GET.q %} - {{ author | highlight:request.GET.q }} - {% else %} - {{ author }} - {% endif %} - {% if not forloop.last %},{% endif %} - {% endfor %} - {% endif %} - {% if item.translator %} - / - {% trans '翻译' %}: - {% for translator in item.translator %} - {% if request.GET.q %} - {{ translator | highlight:request.GET.q }} - {% else %} - {{ translator }} - {% endif %} - {% if not forloop.last %},{% endif %} - {% endfor %} - {% endif %} - {% if item.subtitle %} - / - {% trans '副标题' %}: - {% if request.GET.q %} - {{ item.subtitle | highlight:request.GET.q }} - {% else %} - {{ item.subtitle }} - {% endif %} - {% endif %} - {% if item.orig_title %} - / - {% trans '原名' %}: - {% if request.GET.q %} - {{ item.orig_title | highlight:request.GET.q }} - {% else %} - {{ item.orig_title }} - {% endif %} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_game.html b/journal/templates/list_item_game.html deleted file mode 100644 index 8f77dbdf..00000000 --- a/journal/templates/list_item_game.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.other_title %} - {% trans '别名' %}: - {% for other_title in item.other_title %} - {{ other_title }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} - {% if item.developer %} - {% trans '开发商' %}: - {% for developer in item.developer %} - {{ developer }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} - {% if item.genre %} - {% trans '类型' %}: - {% for genre in item.genre %} - {{ genre }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} - {% if item.platform %} - {% trans '平台' %}: - {% for platform in item.platform %} - {{ platform }} - {% if not forloop.last %}{% endif %} - {% endfor %} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_movie.html b/journal/templates/list_item_movie.html deleted file mode 100644 index 78466761..00000000 --- a/journal/templates/list_item_movie.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.director %} - {% trans '导演' %}: - {% for director in item.director %} - {% if request.GET.q %} - {{ director | highlight:request.GET.q }} - {% else %} - {{ director }} - {% endif %} - {% if not forloop.last %},{% endif %} - {% endfor %} - / - {% endif %} - {% if item.genre %} - {% trans '类型' %}: - {% for genre in item.genre %} - {{ genre }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} -{% endblock %} -{% block info_full %} - {% if item.actor %} - {% trans '主演' %}: - {% for actor in item.actor %} - 5 %}style="display: none;"{% endif %}> - {% if request.GET.q %} - {{ actor | highlight:request.GET.q }} - {% else %} - {{ actor }} - {% endif %} - - {% if forloop.counter <= 5 %} - {% if not forloop.counter == 5 and not forloop.last %}{% endif %} - {% endif %} - {% endfor %} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_performance.html b/journal/templates/list_item_performance.html deleted file mode 100644 index 86f4774d..00000000 --- a/journal/templates/list_item_performance.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block brief %} -
{% include '_people.html' with people=item.genre _role='类型' max=5 %}
-
-
{% include '_people.html' with people=item.troupe _role='剧团' max=5 %}
-
{% include '_people.html' with people=item.location _role='剧院' max=5 %}
-
- {% if item.opening_date %}{{ item.opening_date }}{% endif %} -
-{% endblock %} -{% block full %} -
{% include '_people.html' with people=item.other_title role='又名' max=2 %}
-
{% include '_people.html' with people=item.director role='导演' max=2 %}
-
{% include '_people.html' with people=item.playwright role='编剧' max=2 %}
-
{% include '_people.html' with people=item.actor role='演员' max=5 %}
-
{% include '_people.html' with people=item.performer role='表演者' max=5 %}
-
{% include '_people.html' with people=item.composer role='作曲' max=2 %}
-
{% include '_people.html' with people=item.choreographer role='编舞' max=2 %}
-
{% include '_people.html' with people=item.crew role='演职人员' max=2 %}
-{% endblock %} diff --git a/journal/templates/list_item_performanceproduction.html b/journal/templates/list_item_performanceproduction.html deleted file mode 100644 index 985df1d7..00000000 --- a/journal/templates/list_item_performanceproduction.html +++ /dev/null @@ -1 +0,0 @@ -{% extends "list_item_base.html" %} diff --git a/journal/templates/list_item_podcast.html b/journal/templates/list_item_podcast.html deleted file mode 100644 index 939dd9cb..00000000 --- a/journal/templates/list_item_podcast.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.genre %} - {% trans '类型' %}: - {{ item.genre|join:" / " }} - {% endif %} - {% if item.genre %} - {% trans '主播' %}: - {{ item.hosts|join:" / " }} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_tvseason.html b/journal/templates/list_item_tvseason.html deleted file mode 100644 index 8e48a19b..00000000 --- a/journal/templates/list_item_tvseason.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.director %} - {% trans '导演' %}: - {% for director in item.director %} - {% if request.GET.q %} - {{ director | highlight:request.GET.q }} - {% else %} - {{ director }} - {% endif %} - {% if not forloop.last %},{% endif %} - {% endfor %} - / - {% endif %} - {% if item.genre %} - {% trans '类型' %}: - {% for genre in item.genre %} - {{ genre }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} -{% endblock %} -{% block info_full %} - {% if item.actor %} - {% trans '主演' %}: - {% for actor in item.actor %} - 5 %}style="display: none;"{% endif %}> - {% if request.GET.q %} - {{ actor | highlight:request.GET.q }} - {% else %} - {{ actor }} - {% endif %} - - {% if forloop.counter <= 5 %} - {% if not forloop.counter == 5 and not forloop.last %}{% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% if item.show %}{% endif %} -{% endblock %} diff --git a/journal/templates/list_item_tvshow.html b/journal/templates/list_item_tvshow.html deleted file mode 100644 index 78466761..00000000 --- a/journal/templates/list_item_tvshow.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "list_item_base.html" %} -{% load i18n %} -{% load highlight %} -{% block info %} - {% if item.director %} - {% trans '导演' %}: - {% for director in item.director %} - {% if request.GET.q %} - {{ director | highlight:request.GET.q }} - {% else %} - {{ director }} - {% endif %} - {% if not forloop.last %},{% endif %} - {% endfor %} - / - {% endif %} - {% if item.genre %} - {% trans '类型' %}: - {% for genre in item.genre %} - {{ genre }} - {% if not forloop.last %}{% endif %} - {% endfor %} - / - {% endif %} -{% endblock %} -{% block info_full %} - {% if item.actor %} - {% trans '主演' %}: - {% for actor in item.actor %} - 5 %}style="display: none;"{% endif %}> - {% if request.GET.q %} - {{ actor | highlight:request.GET.q }} - {% else %} - {{ actor }} - {% endif %} - - {% if forloop.counter <= 5 %} - {% if not forloop.counter == 5 and not forloop.last %}{% endif %} - {% endif %} - {% endfor %} - {% endif %} -{% endblock %} diff --git a/journal/templates/list_item_work.html b/journal/templates/list_item_work.html deleted file mode 100644 index c9f2992f..00000000 --- a/journal/templates/list_item_work.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/journal/templates/mark.html b/journal/templates/mark.html index a676de6b..951007be 100644 --- a/journal/templates/mark.html +++ b/journal/templates/mark.html @@ -8,336 +8,308 @@ {% load truncate %} {% load highlight %} {% load thumb %} -