feat: improve Wagtail admin editor experience for articles
- Add published_date field to ArticlePage with auto-populate from first_published_at on first publish, plus data migration backfill - Surface go_live_at/expire_at scheduling fields in editor panels - Reorganise ArticlePage editor with TabbedInterface (Content, Metadata, Publishing, SEO tabs) - Add Articles PageListingViewSet to admin menu with custom columns (author, category, published date, status) and category/author filters - Add Articles summary dashboard panel showing drafts, scheduled, and recently published articles - Update all front-end queries and RSS feeds to use published_date - Add 10 unit tests and 4 E2E tests for new admin features Closes #39 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18
apps/blog/migrations/0003_add_published_date.py
Normal file
18
apps/blog/migrations/0003_add_published_date.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.11 on 2026-03-03 13:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0002_category_articlepage_category'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='articlepage',
|
||||
name='published_date',
|
||||
field=models.DateTimeField(blank=True, help_text='Display date for this article. Auto-set on first publish if left blank.', null=True),
|
||||
),
|
||||
]
|
||||
24
apps/blog/migrations/0004_backfill_published_date.py
Normal file
24
apps/blog/migrations/0004_backfill_published_date.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Generated by Django 5.2.11 on 2026-03-03 13:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def backfill_published_date(apps, schema_editor):
|
||||
schema_editor.execute(
|
||||
"UPDATE blog_articlepage SET published_date = p.first_published_at "
|
||||
"FROM wagtailcore_page p "
|
||||
"WHERE blog_articlepage.page_ptr_id = p.id "
|
||||
"AND blog_articlepage.published_date IS NULL "
|
||||
"AND p.first_published_at IS NOT NULL"
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0003_add_published_date'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(backfill_published_date, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user