Add a news app: coach_manager authoring, team tagging, photos, editor release flow

News and NewsPhoto (team-tagged instead of categorised, one photo taggable
as main via a partial unique constraint), gated per club/services/access.py:
any current-season coach_manager, EDITOR, or ADMIN can draft and edit a news
item; only EDITOR/ADMIN can publish it, or edit it once it's live. Publishing
takes a date so it can be scheduled ahead of time rather than only right now.

Authoring/release only for now -- no member-facing reading page or public API
yet, the visibility field (internal/external/both) is there for when those land.
This commit is contained in:
2026-08-03 18:46:37 +02:00
parent ce35348b31
commit 3e0c63ec36
20 changed files with 985 additions and 19 deletions

23
news/admin.py Normal file
View File

@@ -0,0 +1,23 @@
from django.contrib import admin
from .models import News, NewsPhoto
class NewsPhotoInline(admin.TabularInline):
model = NewsPhoto
extra = 0
@admin.register(News)
class NewsAdmin(admin.ModelAdmin):
list_display = ["title", "club", "status", "visibility", "created_by"]
list_filter = ["club", "status", "visibility"]
search_fields = ["title"]
raw_id_fields = ["created_by"]
inlines = [NewsPhotoInline]
@admin.register(NewsPhoto)
class NewsPhotoAdmin(admin.ModelAdmin):
list_display = ["news_item", "is_main", "ordering"]
list_filter = ["is_main"]