dont show dates with placeholder values in home page

This commit is contained in:
FuzzyGrim
2025-03-09 15:14:47 +01:00
parent 08eb568aca
commit 2088e44c4a
3 changed files with 6 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ You can try the app at [yamtrack.fuzzygrim.com](https://yamtrack.fuzzygrim.com)
| Homepage | Calendar |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| <img src="https://cdn.fuzzygrim.com/file/fuzzygrim/yamtrack/homepage.png" alt="Homepage" /> | <img src="https://cdn.fuzzygrim.com/file/fuzzygrim/yamtrack/calendar.png" alt="calendar" /> |
| <img src="https://cdn.fuzzygrim.com/file/fuzzygrim/yamtrack/homepage.png?v2" alt="Homepage" /> | <img src="https://cdn.fuzzygrim.com/file/fuzzygrim/yamtrack/calendar.png" alt="calendar" /> |
| Media List Grid | Media List Table |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |

View File

@@ -1,4 +1,5 @@
import logging
from datetime import date
from django.apps import apps
from django.contrib import messages
@@ -35,6 +36,7 @@ def home(request):
)
context = {
"media_list": list_by_type.get(media_type_to_load, []),
"max_date": date.max,
}
return render(request, "app/components/home_grid.html", context)
@@ -43,6 +45,7 @@ def home(request):
context = {
"list_by_type": list_by_type,
"current_sort": sort_by,
"max_date": date.max,
}
return render(request, "app/home.html", context)

View File

@@ -9,7 +9,7 @@
data-src="{{ media.item.image }}"
src="{{ IMG_NONE }}">
{% if media.next_episode_date %}
{% if media.next_episode_date and media.next_episode_date != max_date %}
<div class="absolute top-2 left-1/2 -translate-x-1/2 flex items-center gap-1.5 bg-black/80 px-2.5 py-1.5 rounded-md shadow-md whitespace-nowrap">
<svg xmlns="http://www.w3.org/2000/svg"
width="24"
@@ -24,8 +24,7 @@
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
<span class="text-xs font-medium text-white drop-shadow-sm">
{% if media.next_episode_number %}Ep. {{ media.next_episode_number }} •{% endif %}
{{ media.next_episode_date|naturalday }}</span>
Ep. {{ media.next_episode_number }} • {{ media.next_episode_date|naturalday }}</span>
</div>
{% endif %}