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 @property
def brief_description(self): def brief_description(self):
return self.brief[:155] return self.display_description[:155]
@classmethod @classmethod
def get_by_url(cls, url_or_b62: str, resolve_merge=False) -> "Self | None": def get_by_url(cls, url_or_b62: str, resolve_merge=False) -> "Self | None":

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,6 +24,8 @@
{% include '_people.html' with people=item.performer role='performer' max=2 %} {% include '_people.html' with people=item.performer role='performer' max=2 %}
</div> </div>
<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> </div>
{% endblock full %} {% endblock full %}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -32,7 +32,7 @@
{{ ep.display_title }} {{ ep.display_title }}
<small style="color:lightgrey;">{{ ep.pub_date|date }}</small> <small style="color:lightgrey;">{{ ep.pub_date|date }}</small>
</h6> </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> </p>
{% if forloop.last %} {% if forloop.last %}
<button class="outline" <button class="outline"