Fix: use title if available instead of description

This commit is contained in:
Aroy-Art 2024-06-26 15:32:44 +02:00
parent cbc9fd7db7
commit 7716359e0b
Signed by: Aroy
GPG key ID: DB9689E9391DD156

View file

@ -70,11 +70,21 @@
{% endif %} {% endif %}
<a href='{% url "sites:submission" submission.submission_hash %}' class="stretched-link"></a> <a href='{% url "sites:submission" submission.submission_hash %}' class="stretched-link"></a>
<div class="overlay p-2 text-center"> <div class="overlay p-2 text-center">
{% if submission.content_object.title %}
{% if submission.content_object.title|length > 64 %}
<p title="{{ submission.content_object.title }}">{{ submission.content_object.title|slice:"0:64"|add:"..." }}</p>
{% else %}
<p title="{{ submission.content_object.title }}">{{ submission.content_object.title }}</p>
{% endif %}
{% else %}
{% if submission.content_object.description|length > 64 %} {% if submission.content_object.description|length > 64 %}
<p>{{ submission.content_object.description|html_to_text|slice:"0:64"|add:"..." }}</p> <p>{{ submission.content_object.description|html_to_text|slice:"0:64"|add:"..." }}</p>
{% else %} {% else %}
<p>{{ submission.content_object.description|html_to_text }}</p> <p>{{ submission.content_object.description|html_to_text }}</p>
{% endif %} {% endif %}
{% endif %}
<a href="{% url 'sites:artist_profile' submission.author.user_hash %}" class="z-2"> <a href="{% url 'sites:artist_profile' submission.author.user_hash %}" class="z-2">
{% if submission.category.name == "furaffinity" %} {% if submission.category.name == "furaffinity" %}
{{ submission.content_object.artist.artist }} {{ submission.content_object.artist.artist }}