Compare commits

...

2 Commits

Author SHA1 Message Date
philipp lang 54efebf12e Add loginState to skip nami login 2024-07-30 23:22:46 +02:00
philipp lang 38d56d1285 Mod index 2024-07-30 22:58:05 +02:00
2 changed files with 85 additions and 158 deletions

View File

@ -6,167 +6,72 @@
<title>Vite + Vue</title> <title>Vite + Vue</title>
<meta name="adrema_base_url" content="/" /> <meta name="adrema_base_url" content="/" />
</head> </head>
<body style="padding: 50px"> <body>
<event-form <event-form
style="--primary: hsl(181, 75%, 26%); --secondary: hsl(181, 75%, 35%); --font: hsl(181, 84%, 78%); --circle: hsl(181, 86%, 16%)" style="--primary: hsl(181, 75%, 26%); --secondary: hsl(181, 75%, 35%); --font: hsl(181, 84%, 78%); --circle: hsl(181, 86%, 16%)"
value='{"sections":[ value='{
"sections": [
{ {
"name": "tet", "name": "sdfs",
"intro": "",
"fields": [ "fields": [
{ {
"name": "checkbox",
"type": "CheckboxField",
"columns": {
"mobile": 2,
"tablet": 4,
"desktop": 6
},
"value": false,
"required": true, "required": true,
"key": "vorname",
"name": "Vorname",
"nami_type": null, "nami_type": null,
"for_members": true,
"special_type": null,
"description": "Sed laoreet mattis sem, vel sodales leo ullamcorper ut. Aliquam hendrerit vestibulum ex, sit amet consequat dolor donec.",
"hint": "Quisque justo leo, ultricies vestibulum.",
"key": "checkbox"
},
{
"name": "checkboxes Praesent tortor ligula, accumsan quis neque eget, laoreet convallis nunc. Morbi a urna sem. Mauris venenatis a felis ex.",
"hint": "Quisque justo leo, ultricies vestibulum.",
"type": "CheckboxesField",
"columns": { "columns": {
"mobile": 2, "mobile": 2,
"tablet": 4, "tablet": 4,
"desktop": 6 "desktop": 6
}, },
"value": [],
"required": false,
"nami_type": null,
"for_members": true, "for_members": true,
"special_type": null, "special_type": null,
"options": [ "hint": null,
"Integer molestie enim vitae enim tellus.", "intro": null,
"Cras ut magna ac metus rutrum efficitur."
],
"key": "checkboxes"
},
{
"name": "date",
"hint": "Quisque justo leo, ultricies vestibulum.",
"type": "DateField",
"columns": {
"mobile": 2,
"tablet": 4,
"desktop": 6
},
"value": null, "value": null,
"required": false, "type": "TextField"
"nami_type": null,
"for_members": true,
"special_type": null,
"max_today": false,
"key": "date"
}, },
{ {
"name": "dropdown", "required": true,
"hint": "Quisque justo leo, ultricies vestibulum.", "key": "nachname",
"type": "DropdownField", "name": "Nachname",
"nami_type": null,
"columns": { "columns": {
"mobile": 2, "mobile": 2,
"tablet": 4, "tablet": 4,
"desktop": 6 "desktop": 3
}, },
"for_members": true,
"special_type": null,
"hint": null,
"intro": null,
"value": null, "value": null,
"required": false, "type": "TextField"
"nami_type": null,
"for_members": true,
"special_type": null,
"options": [
"a",
"v"
],
"key": "dropdown",
"allowcustom": false
}, },
{ {
"name": "radio", "required": true,
"hint": "Quisque justo leo, ultricies vestibulum.", "key": "mail",
"type": "RadioField", "name": "Mail",
"nami_type": null,
"columns": { "columns": {
"mobile": 2, "mobile": 1,
"tablet": 4, "tablet": 2,
"desktop": 6 "desktop": 3
}, },
"for_members": true,
"special_type": null,
"hint": null,
"intro": null,
"value": null, "value": null,
"required": false, "type": "EmailField"
"nami_type": null,
"for_members": true,
"special_type": null,
"options": [
"a",
"v"
],
"key": "radio",
"allowcustom": false
},
{
"name": "text",
"hint": "Quisque justo leo, ultricies vestibulum.",
"type": "TextField",
"columns": {
"mobile": 2,
"tablet": 4,
"desktop": 6
},
"value": "",
"required": false,
"nami_type": null,
"for_members": true,
"special_type": null,
"key": "text"
},
{
"name": "textarea",
"hint": "Quisque justo leo, ultricies vestibulum.",
"type": "TextareaField",
"columns": {
"mobile": 2,
"tablet": 4,
"desktop": 6
},
"value": "",
"required": false,
"nami_type": null,
"for_members": true,
"special_type": null,
"rows": 5,
"key": "textarea"
},
{
"name": "numerisch",
"hint": "Quisque justo leo, ultricies vestibulum.",
"type": "NumberField",
"columns": {
"mobile": 2,
"tablet": 4,
"desktop": 6
},
"value": null,
"required": false,
"nami_type": null,
"for_members": true,
"special_type": null,
"key": "numerisch",
"min": null,
"max": "7"
},
{"required":true,"parent_field":null,"parent_group":2,"has_empty_option":true,"key":"stamm","name":"Stamm","nami_type":null,"columns":{"mobile":2,"tablet":4,"desktop":6},"for_members":true,"special_type":null,"hint":null,"value":null,"type":"GroupField", "empty_option_value": "Kein Stamm"}
]
} }
]}' ],
"intro": null
}
]
}'
payload='{"vorname": "Philipp", "nachname": "Lang", "mail": "a@b.de"}'
url="http://localhost:8000" url="http://localhost:8000"
editable
></event-form> ></event-form>
<event-overview <event-overview
style="--primary: hsl(181, 75%, 26%); --secondary: hsl(181, 75%, 35%); --font: hsl(181, 84%, 78%); --circle: hsl(181, 86%, 16%)" style="--primary: hsl(181, 75%, 26%); --secondary: hsl(181, 75%, 35%); --font: hsl(181, 84%, 78%); --circle: hsl(181, 86%, 16%)"

View File

@ -13,16 +13,27 @@
Bitte achte außerdem darauf, dass du mindestens <span class="font-semibold">Leserechte</span> auf deine Gruppierung hast. Diese kann dir i.d.R. dein Bitte achte außerdem darauf, dass du mindestens <span class="font-semibold">Leserechte</span> auf deine Gruppierung hast. Diese kann dir i.d.R. dein
<span class="font-semibold">StaVo</span> erteilen. <span class="font-semibold">StaVo</span> erteilen.
</p> </p>
<v-checkbox
:modelValue="loginState !== 'nami'"
@update:modelValue="loginState = $event ? 'skipping' : 'nami'"
name="login_state"
id="login_state"
description="Ich bin kein Mitglied der DPSG im DV Köln und möchte daher meine Mitglieder selbst eingeben."
intro=""
></v-checkbox>
</div> </div>
<div class="flex mt-4 space-x-3"> <div class="flex mt-4 space-x-3">
<v-text @keypress.enter="innerLogin" name="nami_mglnr" label="Mitgliedsnummer" id="nami_mglnr" v-model="loginData.mglnr" required></v-text> <v-text @keypress.enter="innerLogin" name="nami_mglnr" label="Mitgliedsnummer" id="nami_mglnr" v-model="loginData.mglnr" required></v-text>
<v-text @keypress.enter="innerLogin" name="nami_password" label="Passwort" id="nami_password" v-model="loginData.password" type="password" required></v-text> <v-text @keypress.enter="innerLogin" name="nami_password" label="Passwort" id="nami_password" v-model="loginData.password" type="password" required></v-text>
<v-btn class="self-end" @click.prevent="innerLogin">Anmelden</v-btn> <v-btn class="self-end" @click.prevent="innerLogin">
<span v-text="loginState === 'nami' ? 'Anmelden' : 'Weiter'"></span>
</v-btn>
</div> </div>
</template> </template>
<template #finished> <template #finished>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div>Erfolgreich eingeloggt als {{ user }}.</div> <div v-if="user">Erfolgreich eingeloggt als {{ user }}.</div>
<div v-else>Nicht eingeloggt</div>
<v-btn class="self-end" @click.prevent="innerLogout">Abmelden</v-btn> <v-btn class="self-end" @click.prevent="innerLogout">Abmelden</v-btn>
</div> </div>
</template> </template>
@ -225,7 +236,7 @@ if (user.value !== null) {
const {resolveComponentName} = useFields(); const {resolveComponentName} = useFields();
const step = computed(() => { const step = computed(() => {
if (user.value === null) { if (user.value === null && loginState.value !== 'skipped') {
return 1; return 1;
} }
@ -247,6 +258,7 @@ function deleteMember(index) {
} }
const membersAccepted = ref(false); const membersAccepted = ref(false);
const loginState = ref('nami');
const membersCompleted = ref(false); const membersCompleted = ref(false);
const emit = defineEmits(['update:modelValue']); const emit = defineEmits(['update:modelValue']);
const props = defineProps({ const props = defineProps({
@ -288,6 +300,13 @@ const inner = computed(
{deep: true}, {deep: true},
); );
async function innerLogin() { async function innerLogin() {
if (loginState.value === 'skipping') {
loginState.value = 'skipped';
membersAccepted.value = true;
membersCompleted.value = false;
return;
}
await login(); await login();
membersAccepted.value = false; membersAccepted.value = false;
membersCompleted.value = false; membersCompleted.value = false;
@ -312,8 +331,11 @@ function toggleMember(member) {
} }
async function innerLogout() { async function innerLogout() {
if (loginState.value !== 'skipped') {
logout(); logout();
resetSearchData(); resetSearchData();
}
loginState.value = 'nami';
membersAccepted.value = false; membersAccepted.value = false;
membersCompleted.value = false; membersCompleted.value = false;
inner.value = []; inner.value = [];