display item desc by locale

This commit is contained in:
Your Name 2024-07-14 10:45:27 -04:00 committed by Henri Dickson
parent b254b0c4ee
commit d48a18b3f4
17 changed files with 24 additions and 22 deletions

View file

@ -636,7 +636,7 @@ class Item(PolymorphicModel):
@property
def brief_description(self):
return self.brief[:155]
return self.display_description[:155]
@classmethod
def get_by_url(cls, url_or_b62: str, resolve_merge=False) -> "Self | None":

View file

@ -128,8 +128,8 @@ class DiscoverGenerator(BaseJob):
).count()
trends.append(
{
"title": i.title,
"description": i.brief,
"title": i.display_title,
"description": i.display_description,
"url": i.absolute_url,
"image": i.cover_image_url or "",
"provider_name": str(i.category.label),

View file

@ -36,7 +36,7 @@ class SearchResultItem:
self.source_url = source_url
self.display_title = title
self.subtitle = subtitle
self.brief = brief
self.display_description = brief
self.cover_image_url = cover_url
@property

View file

@ -19,7 +19,7 @@
</div>
<div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
</div>
{% endblock full %}

View file

@ -41,7 +41,7 @@
<div class="full">
{% block full %}
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}
</div>

View file

@ -32,6 +32,6 @@
{% endblock brief %}
{% block full %}
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -18,6 +18,6 @@
{% include '_people.html' with people=item.publisher role='publisher' max=2 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -13,6 +13,6 @@
{% block full %}
<div class="multi-fields">{% include '_people.html' with people=item.additional_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -24,6 +24,6 @@
{% include '_people.html' with people=item.performer role='performer' max=5 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -24,6 +24,8 @@
{% include '_people.html' with people=item.performer role='performer' max=2 %}
</div>
<div>
{% if not hide_brief %}{{ item.brief | default:item.parent_item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}
{{ item.display_description | default:item.parent_item.display_description | linebreaksbr }}
{% endif %}
</div>
{% endblock full %}

View file

@ -11,6 +11,6 @@
{% endblock brief %}
{% block full %}
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -12,6 +12,6 @@
{% endblock brief %}
{% block full %}
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -13,6 +13,6 @@
{% block full %}
<div class="multi-fields">{% include '_people.html' with people=item.additional_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -12,6 +12,6 @@
{% block full %}
<div class="multi-fields">{% include '_people.html' with people=item.additional_title role='other title' max=2 %}</div>
<div>
{% if not hide_brief %}{{ item.brief | linebreaksbr }}{% endif %}
{% if not hide_brief %}{{ item.display_description | linebreaksbr }}{% endif %}
</div>
{% endblock full %}

View file

@ -18,7 +18,7 @@
<meta property="og:url" content="{{ item.absolute_url }}">
{% if item.has_cover %}<meta property="og:image" content="{{ item.cover_image_url }}">{% endif %}
<meta property="og:site_name" content="{{ site_name }}">
<meta property="og:description" content="{{ item.brief }}">
<meta property="og:description" content="{{ item.brief_description }}">
{% if item.is_deleted or item.merged_to_item %}<meta name="robots" content="noindex">{% endif %}
<title>{{ site_name }} - {% trans item.category.label %} | {{ item.display_title }}</title>
{% include "common_libs.html" %}
@ -228,10 +228,10 @@
<div id="item-detail" class="middle">
<section id="item-content">
<h5>{% trans 'overview' %}</h5>
{% if item.brief %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.brief | linebreaksbr }}</p>
{% elif item.parent_item.brief %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.parent_item.brief | linebreaksbr }}</p>
{% if item.display_description %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.display_description | linebreaksbr }}</p>
{% elif item.parent_item.display_description %}
<p class="tldr" _="on click toggle .tldr on me">{{ item.parent_item.display_description | linebreaksbr }}</p>
{% else %}
<p class="empty">{% trans 'nothing so far.' %}</p>
{% endif %}

View file

@ -38,7 +38,7 @@
window.podcastData = {
"title": "{{ item.display_title | escapejs }}",
"subtitle": "",
"description": "{{ item.brief | escapejs }}",
"description": "{{ item.display_description | escapejs }}",
"cover": "{{ item.cover.url | escapejs }}",
"feeds": [{"type": "audio", "format": "mp3", "url": "{{ item.feed_url | escapejs }}", "variant": "high"}]
}

View file

@ -32,7 +32,7 @@
{{ ep.display_title }}
<small style="color:lightgrey;">{{ ep.pub_date|date }}</small>
</h6>
<small class="tldr-2 muted" _="on click toggle .tldr-2">{{ ep.brief | linebreaksbr }}</small>
<small class="tldr-2 muted" _="on click toggle .tldr-2">{{ ep.display_description | linebreaksbr }}</small>
</p>
{% if forloop.last %}
<button class="outline"