feat: publish UI rewrite — tabs, calendar widget, multi-week and single-article support

Made-with: Cursor
This commit is contained in:
cottongin
2026-04-06 17:06:52 -04:00
parent 807ab8610d
commit 5ca7156723
3 changed files with 399 additions and 86 deletions

View File

@@ -64,6 +64,7 @@ def build_epub(
article_ids: list[int],
cover_path: str,
output_dir: str,
issue_type: str = "weekly",
) -> str:
os.makedirs(output_dir, exist_ok=True)
@@ -74,10 +75,20 @@ def build_epub(
.all()
)
title = (
f"Plymouth Independent \u2014 "
f"Week of {week_start.strftime('%b %d')}\u2013{week_end.strftime('%b %d, %Y')}"
)
if issue_type == "single_article" and len(articles) == 1:
title = f"Plymouth Independent \u2014 {articles[0].title}"
elif issue_type == "multi_week":
w1 = week_start.isocalendar()[1]
w2 = week_end.isocalendar()[1]
title = (
f"Plymouth Independent \u2014 "
f"Weeks {w1}\u2013{w2}, {week_start.strftime('%b %d')}\u2013{week_end.strftime('%b %d, %Y')}"
)
else:
title = (
f"Plymouth Independent \u2014 "
f"Week of {week_start.strftime('%b %d')}\u2013{week_end.strftime('%b %d, %Y')}"
)
book = epub.EpubBook()
book.set_identifier(f"pi-{week_start.isoformat()}")