From b63185a42eddd2a688633f68d16b1207a881f4d0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 20 May 2023 14:17:02 -0400 Subject: [PATCH] fix item card --- catalog/templates/_item_card.html | 92 +--------------------- catalog/templates/_item_card_metadata.html | 85 ++++++++++++++++++++ catalog/templates/item_base.html | 8 +- catalog/templates/item_mark_list.html | 15 +++- catalog/templates/item_review_list.html | 10 ++- catalog/templates/sidebar_item.html | 15 +--- catalog/views.py | 1 + common/static/scss/_layout.scss | 10 ++- 8 files changed, 119 insertions(+), 117 deletions(-) create mode 100644 catalog/templates/_item_card_metadata.html diff --git a/catalog/templates/_item_card.html b/catalog/templates/_item_card.html index 5351f935..fabcecc2 100644 --- a/catalog/templates/_item_card.html +++ b/catalog/templates/_item_card.html @@ -1,6 +1,4 @@ -{% load humanize %} {% load i18n %} -{% load highlight %} {% if item.get_embed_link %}
@@ -28,94 +26,6 @@ cover
-
-
-
- - {% if request.GET.q %} - {{ item.title | strip_season | highlight:request.GET.q }} - {% else %} - {{ item.title | strip_season }} - {% endif %} - - - {% if item.season_number %}第{{ item.season_number|apnumber }}季{% endif %} - {% if item.year %}({{ item.year }}){% endif %} - {% if not hide_category %}[{{ item.category.label }}]{% endif %} - - {% for res in item.external_resources.all %} - {{ res.site_name.label }} - {% endfor %} - - -
- {% comment %} - - {% for res in item.external_resources.all %} - {{ res.site_name.label }} - {% endfor %} - - {% endcomment %} -
- - {% if item.subtitle %}{{ item.subtitle }}{% endif %} - {% if item.orig_title %} - {{ item.orig_title }} - {% if item.season_number %}Season {{ item.season_number }}{% endif %} - {% endif %} - -
-
-
- -
- {% if item.actor %} - {% include '_people.html' with people=item.actor role='主演' max=2 %} -
- {% endif %} - {% if item.other_title %} - {% include '_people.html' with people=item.other_title role='又名' max=2 %} -
- {% endif %} - {% if request.GET.q %} - {{ item.brief | linebreaksbr | highlight:request.GET.q }} - {% else %} - {{ item.brief | linebreaksbr }} - {% endif %} -
- {% if show_tags %} -
- {% for tag in item.tags %} - {% if forloop.counter <= 5 %} - - {{ tag }} - - {% endif %} - {% endfor %} -
- {% endif %} -
-
+
{% include "_item_card_metadata.html" %}
{% endif %} diff --git a/catalog/templates/_item_card_metadata.html b/catalog/templates/_item_card_metadata.html new file mode 100644 index 00000000..28463e22 --- /dev/null +++ b/catalog/templates/_item_card_metadata.html @@ -0,0 +1,85 @@ +{% load highlight %} +{% load humanize %} +{% load i18n %} +
+
+ + {% if request.GET.q %} + {{ item.title | strip_season | highlight:request.GET.q }} + {% else %} + {{ item.title | strip_season }} + {% endif %} + + + {% if item.season_number %}第{{ item.season_number|apnumber }}季{% endif %} + {% if item.year %}({{ item.year }}){% endif %} + {% if not hide_category %}[{{ item.category.label }}]{% endif %} + + {% for res in item.external_resources.all %} + {{ res.site_name.label }} + {% endfor %} + + +
+
+ + {% if item.subtitle %}{{ item.subtitle }}{% endif %} + {% if item.orig_title %} + {{ item.orig_title }} + {% if item.season_number %}Season {{ item.season_number }}{% endif %} + {% endif %} + +
+
+
+ +
+ {% if item.actor %} + {% include '_people.html' with people=item.actor role='主演' max=2 %} +
+ {% endif %} + {% if item.other_title %} + {% include '_people.html' with people=item.other_title role='又名' max=2 %} +
+ {% endif %} + {% if not hide_brief %} + {% if request.GET.q %} + {{ item.brief | linebreaksbr | highlight:request.GET.q }} + {% else %} + {{ item.brief | linebreaksbr }} + {% endif %} + {% endif %} +
+ {% if show_tags %} +
+ {% for tag in item.tags %} + {% if forloop.counter <= 5 %} + + {{ tag }} + + {% endif %} + {% endfor %} +
+ {% endif %} +
diff --git a/catalog/templates/item_base.html b/catalog/templates/item_base.html index 1a73ffd3..c3086a7c 100644 --- a/catalog/templates/item_base.html +++ b/catalog/templates/item_base.html @@ -344,10 +344,8 @@ 短评 {% if request.user.is_authenticated %} - | {% trans '全部标记' %} - | 关注的人的标记 + | {% trans '全部标记' %} + | 关注的人的标记 {% endif %} @@ -369,7 +367,7 @@ {% comment %} {% if request.user.is_authenticated %} - | {% trans '全部评论' %} + | {% trans '全部评论' %} {% endif %} {% endcomment %} diff --git a/catalog/templates/item_mark_list.html b/catalog/templates/item_mark_list.html index a6948519..7e6c8be3 100644 --- a/catalog/templates/item_mark_list.html +++ b/catalog/templates/item_mark_list.html @@ -9,7 +9,7 @@ {% load user_actions %} {% load duration %} - + @@ -21,7 +21,14 @@
- {{ item.title }}{% trans ' 的标记' %} + {% if followeing_only %} + {% trans '全部标记' %} + | {% trans '好友标记' %} + {% else %} + {% trans '全部标记' %} + | {% trans '好友标记' %} + {% endif %} + | {% trans '全部评论' %}
{% for member in marks %} {% with member.mark as mark %} @@ -77,7 +84,9 @@ {% endif %}
-
{% include "sidebar_item.html" %}
+
{% include "partial/_footer.html" %} diff --git a/catalog/templates/item_review_list.html b/catalog/templates/item_review_list.html index 6d9a92eb..0cc76e8e 100644 --- a/catalog/templates/item_review_list.html +++ b/catalog/templates/item_review_list.html @@ -9,7 +9,7 @@ {% load user_actions %} {% load duration %} - + @@ -21,7 +21,9 @@
- {{ item.title }}{% trans ' 的评论' %} + {% trans '全部标记' %} + | {% trans '好友标记' %} + | {% trans '全部评论' %}
{% for review in reviews %}
@@ -76,7 +78,9 @@ {% endif %}
-
{% include "sidebar_item.html" %}
+
{% include "partial/_footer.html" %} diff --git a/catalog/templates/sidebar_item.html b/catalog/templates/sidebar_item.html index 973c5e2f..60330f33 100644 --- a/catalog/templates/sidebar_item.html +++ b/catalog/templates/sidebar_item.html @@ -9,19 +9,6 @@ diff --git a/catalog/views.py b/catalog/views.py index 94169dad..18451648 100644 --- a/catalog/views.py +++ b/catalog/views.py @@ -294,6 +294,7 @@ def mark_list(request, item_path, item_uuid, following_only=False): { "marks": marks, "item": item, + "followeing_only": following_only, }, ) diff --git a/common/static/scss/_layout.scss b/common/static/scss/_layout.scss index cc812871..a8248da1 100644 --- a/common/static/scss/_layout.scss +++ b/common/static/scss/_layout.scss @@ -108,7 +108,11 @@ >div { order: 1; - // margin: var(--pico-spacing); + margin: var(--pico-spacing); + } + + >div:has(article) { + margin: 0; } >aside { @@ -136,6 +140,10 @@ } } + >aside.top { + order: -1; + } + ul { padding: 0; }