mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-05 11:19:14 +02:00
feat:#21 updated deps, fixed changes, fixed room list
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { computed } from "vue";
|
||||
import localeStore from "../store/localeStore.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { DropdownChangeEvent } from "primevue/dropdown";
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
const countries = computed(() => [
|
||||
@@ -17,8 +18,8 @@ function displayCountry(code: string) {
|
||||
return countries.value.find((country) => country.code === code)?.name;
|
||||
}
|
||||
|
||||
function updateLocale(locale: string) {
|
||||
localeStore().setLocale(locale);
|
||||
function updateLocale(dropdownChangeEvent: DropdownChangeEvent) {
|
||||
localeStore().setLocale(dropdownChangeEvent.value);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
@@ -28,7 +29,7 @@ function updateLocale(locale: string) {
|
||||
option-label="name"
|
||||
placeholder="Select a Language"
|
||||
class="w-full md:w-14rem"
|
||||
@change="updateLocale($event.data)"
|
||||
@change="updateLocale($event)"
|
||||
>
|
||||
<template #value="slotProps">
|
||||
<div v-if="slotProps.value" class="flex align-items-center">
|
||||
|
@@ -93,20 +93,20 @@ function formatWeekday(weekday: string) {
|
||||
layout="grid"
|
||||
>
|
||||
<template #grid="slotProps">
|
||||
<div class="col-12 sm:col-6 p-1">
|
||||
<div v-for="(item, index) in slotProps.items" :key="index" class="col-12 sm:col-6 p-1">
|
||||
<Card class="border-2 surface-border border-round surface-card">
|
||||
<template #title>
|
||||
<Badge
|
||||
:value="slotProps.data.eventType"
|
||||
:severity="slotProps.data.eventType === 'V' ? 'success' : 'warning'"
|
||||
:value="item.eventType"
|
||||
:severity="item.eventType === 'V' ? 'success' : 'warning'"
|
||||
class="flex-shrink-0 flex-grow-0"
|
||||
/>
|
||||
</template>
|
||||
<template #content>
|
||||
<div class="flex flex-row gap-4 flex-wrap">
|
||||
<div class="flex flex-column">
|
||||
<div class="mr-2">{{ formatWeekday(slotProps.data.day) }}</div>
|
||||
<div class="mr-2">{{ $t("moduleInformation.nthWeek", {count: slotProps.data.week}) }}</div>
|
||||
<div class="mr-2">{{ formatWeekday(item.day) }}</div>
|
||||
<div class="mr-2">{{ $t("moduleInformation.nthWeek", {count: item.week}) }}</div>
|
||||
</div>
|
||||
<div class="flex flex-column">
|
||||
<table>
|
||||
@@ -114,19 +114,19 @@ function formatWeekday(weekday: string) {
|
||||
<td class="mr-2">
|
||||
<b>{{ $t("moduleInformation.start") }}:</b>
|
||||
</td>
|
||||
<td>{{ formatTimestamp(slotProps.data.start) }}</td>
|
||||
<td>{{ formatTimestamp(item.start) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mr-2">
|
||||
<b>{{ $t("moduleInformation.end") }}:</b>
|
||||
</td>
|
||||
<td>{{ formatTimestamp(slotProps.data.end) }}</td>
|
||||
<td>{{ formatTimestamp(item.end) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mr-2">
|
||||
<b>{{ $t("moduleInformation.room") }}:</b>
|
||||
</td>
|
||||
<td>{{ slotProps.data.rooms }}</td>
|
||||
<td>{{ item.rooms }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -29,7 +29,6 @@ function toggleAllModules(){
|
||||
} else {
|
||||
store.overwriteModules(props.modules);
|
||||
}
|
||||
console.debug(props.modules);
|
||||
}
|
||||
|
||||
function toggleModule(module: Module) {
|
||||
@@ -76,19 +75,21 @@ function toggleModule(module: Module) {
|
||||
</p>
|
||||
</template>
|
||||
<template #list="slotProps">
|
||||
<div class="col-12">
|
||||
<div class="grid grid-nogutter">
|
||||
<div v-for="(item, index) in slotProps.items" :key="index" class="col-12">
|
||||
<div class="flex flex-column sm:flex-row justify-content-between align-items-center flex-1 column-gap-4 mx-2 md:mx-4">
|
||||
<p class="text-lg flex-1 align-self-stretch">{{ slotProps.data.name }}</p>
|
||||
<p class="text-lg flex-1 align-self-stretch">{{ item.name }}</p>
|
||||
<ToggleButton
|
||||
class="w-9rem align-self-end my-2"
|
||||
off-icon="pi pi-times"
|
||||
:off-label="$t('moduleSelection.unselected')"
|
||||
on-icon="pi pi-check"
|
||||
:on-label="$t('moduleSelection.selected')"
|
||||
:model-value="store.hasModule(slotProps.data)"
|
||||
@update:model-value="toggleModule(slotProps.data)"
|
||||
:model-value="store.hasModule(item)"
|
||||
@update:model-value="toggleModule(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DataView>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import moduleStore from "../store/moduleStore.ts";
|
||||
import moduleStore from "../store/moduleStore.ts";
|
||||
import { createIndividualFeed } from "../api/createFeed.ts";
|
||||
import router from "../router";
|
||||
import tokenStore from "../store/tokenStore.ts";
|
||||
@@ -37,7 +37,7 @@ async function finalStep() {
|
||||
<div class="flex flex-column align-items-center mb-7">
|
||||
<div class="flex align-items-center justify-content-center m-2 gap-2">
|
||||
<h3>{{ $t("renameModules.subTitle") }}</h3>
|
||||
<ModuleTemplateDialog class=""/>
|
||||
<ModuleTemplateDialog/>
|
||||
</div>
|
||||
<div class="w-full lg:w-8 flex flex-column">
|
||||
<div class="card flex align-items-center justify-content-center my-2">
|
||||
|
@@ -171,7 +171,7 @@ async function deleteFeed() {
|
||||
</template>
|
||||
</template>
|
||||
</Column>
|
||||
<Column>
|
||||
<Column field="module">
|
||||
<template #body="{ data }">
|
||||
<Button
|
||||
icon="pi pi-trash"
|
||||
@@ -186,7 +186,7 @@ async function deleteFeed() {
|
||||
</Column>
|
||||
<template #footer>
|
||||
<div
|
||||
class="flex flex-column sm:flex-row flex-wrap justify-content-between gap-2 w-full"
|
||||
class="flex flex-column sm:flex-row flex-wrap justify-content-between gap-2 w-full"
|
||||
>
|
||||
<Button type="button" severity="danger" outlined icon="pi pi-trash" :label="$t('editCalendarView.delete')" @click="visible = true"/>
|
||||
<Button type="button" severity="info" outlined icon="pi pi-plus" :label="$t('editCalendarView.addModules')" @click="router.push('edit-additional-modules')"/>
|
||||
|
Reference in New Issue
Block a user