diff --git a/muckraker/models.py b/muckraker/models.py index 95c2be7..cabe6fb 100644 --- a/muckraker/models.py +++ b/muckraker/models.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, field_validator from typing import Optional, Literal MAX_BODY_LEN = 6000 @@ -14,10 +14,17 @@ class IssueHeading(BaseModel): class IssueConfig(BaseModel): - bg: Optional[Literal["bashcorpo_v5", "bashcorpo_v5_pale"]] = None + bg: Optional[Literal["none", "bashcorpo_v5", "bashcorpo_v5_pale"]] = None size: Optional[Literal["a4", "a5", "demitab"]] = "a4" heading: IssueHeading + @field_validator("bg") + @classmethod + def set_to_none(cls, value): + if value == "none": + return None + return value + class Issue(BaseModel): config: IssueConfig diff --git a/static/index.html b/static/index.html index a1ee656..45a3df8 100644 --- a/static/index.html +++ b/static/index.html @@ -34,26 +34,48 @@

Issue creation

Configure your gazette, compose articles and push Send to print to generate a PDF.

See a sample issue screenshot here.

- - - - - - - - - - +
+ Heading + + + + + + + + + + +
- - +
+ Issue body (0) + +
+ +
+ Options + +
-
diff --git a/static/script.js b/static/script.js index 53d0829..9d9258c 100644 --- a/static/script.js +++ b/static/script.js @@ -23,14 +23,14 @@ function updateImageList () { async function requestPDF() { document.getElementById("print-button").disabled = true; - + const requestBody = { config: { - bg: "bashcorpo_v5_pale", - size: "demitab", + size: document.getElementById("size-select").value, + bg: document.getElementById("bg-select").value, heading: { - title: document.getElementById("heading-input").value, - subtitle: document.getElementById("subheading-input").value, + title: document.getElementById("title-input").value, + subtitle: document.getElementById("subtitle-input").value, no: document.getElementById("issue-no-input").value, date: document.getElementById("issue-date-input").value, cost: document.getElementById("issue-cost-input").value diff --git a/static/style.css b/static/style.css index fccefbf..6004f11 100644 --- a/static/style.css +++ b/static/style.css @@ -40,14 +40,6 @@ header p { font-family: TT2020, monospace; font-weight: normal; } -#issue-body-textarea { - background-color: var(--bg); - color: var(--fg); - border: 1px solid var(--fg); -} -#issue-body-textarea:focus { - border: 2px solid var(--fg); -} /* File loading button */ input[type=file]::file-selector-button {