Merge the News page's title into the shared navy header too

Same header_extra treatment Calendar and Me just got -- a "News" title
in the app-header instead of no page heading at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
2026-08-21 16:16:16 +02:00
parent 65801a7843
commit 1bf3a9d37a
2 changed files with 15 additions and 1 deletions

View File

@@ -6,9 +6,16 @@
member-visible (internal or both) news item, newest first, full-width member-visible (internal or both) news item, newest first, full-width
like Calendar's own agenda rows (see NewsListView's docstring for why like Calendar's own agenda rows (see NewsListView's docstring for why
this isn't filtered to just this account's teams the way Home's own this isn't filtered to just this account's teams the way Home's own
teaser is). teaser is). The "News" title lives in header_extra, merged into the
shared navy app-header the same way Calendar's/Me's own titles are.
{% endcomment %} {% endcomment %}
{% block header_extra %}
<div class="mt-3">
<span class="font-display text-2xl font-extrabold text-white uppercase">{% trans "News" %}</span>
</div>
{% endblock header_extra %}
{% block content %} {% block content %}
<div class="-mx-4"> <div class="-mx-4">
{% if page.object_list %} {% if page.object_list %}

View File

@@ -929,6 +929,13 @@ class NewsListViewTests(TestCase):
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
def test_header_shows_a_news_title_merged_into_the_shared_header(self):
self.client.force_login(self.user)
response = self._get()
self.assertContains(response, '<span class="font-display text-2xl font-extrabold text-white uppercase">News</span>')
def test_lists_every_internal_or_both_item_regardless_of_team(self): def test_lists_every_internal_or_both_item_regardless_of_team(self):
team_item = News.objects.create(club=self.club, title="Team news", body="Body.", status=News.Status.PUBLISHED, published_at=timezone.now()) team_item = News.objects.create(club=self.club, title="Team news", body="Body.", status=News.Status.PUBLISHED, published_at=timezone.now())
team = Team.objects.create(club=self.club, name="U16", short_name="U16") team = Team.objects.create(club=self.club, name="U16", short_name="U16")