Show a News empty state on Home instead of hiding the card
Previously the whole "Club news" card just vanished when there was nothing to show, dropping the "All news" link along with it. Now it always renders -- either the real teaser or a "No news yet" card, still linking through to mobile:news_list either way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
@@ -126,12 +126,12 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if news_items %}
|
||||
<div>
|
||||
<div class="mb-2.5 flex items-baseline justify-between">
|
||||
<span class="font-display text-xs font-extrabold text-muted uppercase tracking-wide">{% trans "Club news" %}</span>
|
||||
<a class="text-xs font-semibold text-club" href="{% url "mobile:news_list" %}">{% trans "All news" %}</a>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-2.5 flex items-baseline justify-between">
|
||||
<span class="font-display text-xs font-extrabold text-muted uppercase tracking-wide">{% trans "Club news" %}</span>
|
||||
<a class="text-xs font-semibold text-club" href="{% url "mobile:news_list" %}">{% trans "All news" %}</a>
|
||||
</div>
|
||||
{% if news_items %}
|
||||
{% with lead=news_items.0 %}
|
||||
<a class="m-card block overflow-hidden" href="{% url "mobile:news_detail" lead.slug %}">
|
||||
<div class="flex h-[104px] items-center justify-center bg-line text-xs text-dim">{% trans "News photo" %}</div>
|
||||
@@ -156,10 +156,14 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="m-card p-6 text-center">
|
||||
<p class="text-sm text-muted">{% trans "No news yet." %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if not hero_attendance and not needs_answer and not dues_rows and not news_items %}
|
||||
{% if not hero_attendance and not needs_answer and not dues_rows %}
|
||||
<div class="m-card p-6 text-center">
|
||||
<p class="text-sm text-muted">{% trans "Nothing to show right now." %}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user