mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
use API route user/title in UI
This commit is contained in:
parent
b8c30d130a
commit
d0bdc62433
2 changed files with 15 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<section class="hero is-small is-primary" style="overflow-x: auto">
|
||||
<div class="hero-body">
|
||||
<h1 class="title is-uppercase">Adventskalender</h1>
|
||||
<h1 class="title is-uppercase">{{ title }}</h1>
|
||||
<h2 class="subtitle">Der Gelöt</h2>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -46,12 +46,18 @@ import UserView from "./components/UserView.vue";
|
|||
})
|
||||
export default class extends Vue {
|
||||
public is_admin = false;
|
||||
public title = "Adventskalender";
|
||||
public footer = "";
|
||||
|
||||
public mounted(): void {
|
||||
this.$advent22
|
||||
.api_get<string>("user/footer")
|
||||
.then((footer) => (this.footer = footer))
|
||||
Promise.all([
|
||||
this.$advent22.api_get<string>("user/title"),
|
||||
this.$advent22.api_get<string>("user/footer"),
|
||||
])
|
||||
.then(([title, footer]) => {
|
||||
this.title = title;
|
||||
this.footer = footer;
|
||||
})
|
||||
.catch((error) => alert(this.$advent22.format_user_error(error)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
<h3>Rätsel</h3>
|
||||
<dl>
|
||||
<dt>Titel</dt>
|
||||
<!-- TODO -->
|
||||
<dd>Advent22</dd>
|
||||
<dd>{{ title }}</dd>
|
||||
|
||||
<dt>Offene Türchen</dt>
|
||||
<dd>{{ num_user_doors }}</dd>
|
||||
|
@ -215,6 +214,7 @@ export default class extends Vue {
|
|||
},
|
||||
};
|
||||
public doors: DoorsSaved = [];
|
||||
public title = "";
|
||||
public footer = "";
|
||||
public num_user_doors = 0;
|
||||
public next_door: number | null = null;
|
||||
|
@ -233,13 +233,15 @@ export default class extends Vue {
|
|||
this.$advent22.api_get<ConfigModel>("admin/config_model"),
|
||||
this.$advent22.api_get<DoorsSaved>("admin/doors"),
|
||||
this.$advent22.api_get<DoorsSaved>("user/doors"),
|
||||
this.$advent22.api_get<string>("user/title"),
|
||||
this.$advent22.api_get<string>("user/footer"),
|
||||
this.$advent22.api_get<number | null>("user/next_door"),
|
||||
])
|
||||
.then(([config_model, doors, user_doors, footer, next_door]) => {
|
||||
.then(([config_model, doors, user_doors, title, footer, next_door]) => {
|
||||
this.config_model = config_model;
|
||||
this.doors = doors;
|
||||
this.num_user_doors = user_doors.length;
|
||||
this.title = title;
|
||||
this.footer = footer;
|
||||
this.next_door = next_door;
|
||||
|
||||
|
|
Loading…
Reference in a new issue