Add publisher dashboard routes
This commit is contained in:
parent
96551c2788
commit
e4a5246ab3
31 changed files with 1603 additions and 516 deletions
|
|
@ -1,19 +1,57 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
|
||||
import htpy as h
|
||||
from htpy import Renderable
|
||||
|
||||
from repub.components import app_shell
|
||||
from repub.components import publisher_shell
|
||||
from repub.pages.dashboard import published_feeds_table
|
||||
from repub.pages.runs import live_work_section, relative_time_formatter_script
|
||||
|
||||
|
||||
def publisher_page(*, current_path: str) -> Renderable:
|
||||
return app_shell(
|
||||
def publisher_page(
|
||||
*,
|
||||
current_path: str,
|
||||
source_feeds: tuple[Mapping[str, object], ...] | None = None,
|
||||
running_executions: tuple[Mapping[str, object], ...] | None = None,
|
||||
queued_executions: tuple[Mapping[str, object], ...] | None = None,
|
||||
reader_app_url: str | None = None,
|
||||
) -> Renderable:
|
||||
return publisher_shell(
|
||||
current_path=current_path,
|
||||
content=(
|
||||
h.section[
|
||||
h.h1(class_="text-3xl font-semibold tracking-tight text-slate-950")[
|
||||
"Hello publishers"
|
||||
]
|
||||
h.div(
|
||||
class_="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between"
|
||||
)[
|
||||
h.div[
|
||||
h.p(
|
||||
class_="text-xs font-semibold uppercase tracking-[0.22em] text-amber-600"
|
||||
)["Republisher"],
|
||||
h.h1(
|
||||
class_="mt-1 text-3xl font-semibold tracking-tight text-slate-950"
|
||||
)["Published feeds"],
|
||||
],
|
||||
reader_app_url
|
||||
and h.a(
|
||||
href=reader_app_url,
|
||||
target="_blank",
|
||||
rel="noopener noreferrer",
|
||||
class_="inline-flex shrink-0 items-center justify-center rounded-full bg-amber-400 px-4 py-2.5 text-sm font-semibold text-slate-950 transition hover:bg-amber-300",
|
||||
)["Open AnyNews"],
|
||||
],
|
||||
],
|
||||
published_feeds_table(
|
||||
source_feeds=source_feeds,
|
||||
manage_sources_href=None,
|
||||
show_heading=False,
|
||||
),
|
||||
live_work_section(
|
||||
running_executions=running_executions,
|
||||
queued_executions=queued_executions,
|
||||
show_row_actions=False,
|
||||
),
|
||||
relative_time_formatter_script(),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue