config.puzzle.title

This commit is contained in:
Jörn-Michael Miehe 2023-09-12 20:45:57 +00:00
parent 4686ab9c56
commit 764c6b16fb
4 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,9 @@ class Server(BaseModel):
class Puzzle(BaseModel): class Puzzle(BaseModel):
# Titel
title: str
# Lösungswort # Lösungswort
solution: str solution: str

View file

@ -21,6 +21,7 @@ async def is_admin(
class ConfigModel(BaseModel): class ConfigModel(BaseModel):
class __Puzzle(BaseModel): class __Puzzle(BaseModel):
title: str
solution: str solution: str
begin: date begin: date
end: date end: date
@ -64,6 +65,7 @@ async def get_config_model(
return ConfigModel.model_validate( return ConfigModel.model_validate(
{ {
"puzzle": { "puzzle": {
"title": cfg.puzzle.title,
"solution": cfg.puzzle.solution, "solution": cfg.puzzle.solution,
"begin": date.today(), # TODO "begin": date.today(), # TODO
"end": date.today(), # TODO "end": date.today(), # TODO

View file

@ -12,8 +12,7 @@
<h4>Rätsel</h4> <h4>Rätsel</h4>
<dl> <dl>
<dt>Titel</dt> <dt>Titel</dt>
<!-- TODO --> <dd>{{ config_model.puzzle.title }}</dd>
<dd>Adventskalender 2023</dd>
<dt>Lösung</dt> <dt>Lösung</dt>
<dd>{{ config_model.puzzle.solution }}</dd> <dd>{{ config_model.puzzle.solution }}</dd>
@ -137,6 +136,7 @@ export default class extends Vue {
public is_loaded = false; public is_loaded = false;
public config_model: ConfigModel = { public config_model: ConfigModel = {
puzzle: { puzzle: {
title: "Advent22",
solution: "ABCDEFGHIJKLMNOPQRSTUVWX", solution: "ABCDEFGHIJKLMNOPQRSTUVWX",
begin: "01.12.2023", begin: "01.12.2023",
end: "24.12.2023", end: "24.12.2023",

View file

@ -1,5 +1,6 @@
export interface ConfigModel { export interface ConfigModel {
puzzle: { puzzle: {
title: string;
solution: string; solution: string;
begin: string; begin: string;
end: string; end: string;