fix:#53 linted formatted frontend files

This commit is contained in:
Elmar Kresse
2024-09-07 10:09:30 +02:00
parent a9234cbb16
commit fcbe5c0c55
115 changed files with 14849 additions and 11152 deletions

View File

@@ -43,51 +43,51 @@ const disabledPages = [
const router = useRouter();
const route = useRoute();
const domain = "cal.htwk-leipzig.de"
provide('domain', domain);
const domain = "cal.htwk-leipzig.de";
provide("domain", domain);
const baseUri = "https://" + domain;
const canonical = computed(() => `${baseUri}${router.resolve(route.name ? { name: route.name } : route).path}`);
const title = computed(() => route.meta.label?
`HTWKalender - ${t(String(route.meta.label))}`:
"HTWKalender"
const canonical = computed(
() =>
`${baseUri}${router.resolve(route.name ? { name: route.name } : route).path}`,
);
const description = computed(() => route.meta.description?
t(String(route.meta.description)):
t("description")
const title = computed(() =>
route.meta.label
? `HTWKalender - ${t(String(route.meta.label))}`
: "HTWKalender",
);
const description = computed(() =>
route.meta.description ? t(String(route.meta.description)) : t("description"),
);
useHead({
title: title,
link: [
{ rel: "canonical", href: canonical},
],
title: title,
link: [{ rel: "canonical", href: canonical }],
meta: [
{ name: "description", content: description},
{ property: "og:description", content: description},
]
{ name: "description", content: description },
{ property: "og:description", content: description },
],
});
// SEO optimization
useServerHead({
title: title
title: title,
});
useServerSeoMeta({
title: title,
description: description,
keywords:
"HTWK Leipzig, Stundenplan, iCal, freie Räume, Lerngruppen, Sport, Prüfungen",
// openGraph
ogTitle: title,
ogDescription: description,
ogImage: `${baseUri}/img/banner-image.png`,
ogImageType: "image/png",
ogLocale: "de_DE",
ogUrl: canonical,
// twitter
twitterCard: "summary_large_image",
twitterSite: "@HTWKLeipzig",
});
useServerSeoMeta(
{
title: title,
description: description,
keywords: "HTWK Leipzig, Stundenplan, iCal, freie Räume, Lerngruppen, Sport, Prüfungen",
// openGraph
ogTitle: title,
ogDescription: description,
ogImage: `${baseUri}/img/banner-image.png`,
ogImageType: "image/png",
ogLocale: "de_DE",
ogUrl: canonical,
// twitter
twitterCard: "summary_large_image",
twitterSite: "@HTWKLeipzig",
}
);
const store = moduleStore();
const mobilePage = ref(true);
@@ -104,15 +104,14 @@ const updateMobile = () => {
updateMobile();
if (!import.meta.env.SSR)
window.addEventListener("resize", updateMobile);
if (!import.meta.env.SSR) window.addEventListener("resize", updateMobile);
</script>
<template>
<MenuBar />
<RouterView v-slot="{ Component, route }" class="mb-8">
<RouterView v-slot="{ Component, route: currentRoute }" class="mb-8">
<transition name="scale" mode="out-in">
<div :key="route.name ?? ''" class="origin-near-top">
<div :key="currentRoute.name ?? ''" class="origin-near-top">
<component :is="Component" />
</div>
</transition>

View File

@@ -27,9 +27,7 @@ export async function fetchEventTypes(): Promise<string[]> {
})
.then((responseModules: string[]) => {
responseModules.forEach((eventType: string) => {
eventTypes.push(
eventType,
);
eventTypes.push(eventType);
});
});
return eventTypes;

View File

@@ -42,7 +42,6 @@ if (store.isEmpty()) {
const eventTypes: Ref<string[]> = ref([]);
const mobilePage = inject("mobilePage") as Ref<boolean>;
const filters = ref({
course: {
@@ -67,7 +66,7 @@ const loadedModules: Ref<Module[]> = ref(new Array(10));
const loadingData = ref(true);
onMounted( () => {
onMounted(() => {
fetchAllModules()
.then(
(data) =>

View File

@@ -45,7 +45,7 @@ onMounted(() => {
// set theme matching browser preference
setTheme(
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches,
window.matchMedia("(prefers-color-scheme: dark)").matches,
);
window
@@ -63,7 +63,7 @@ onMounted(() => {
class="p-button-rounded w-full md:w-auto"
style="margin-right: 1rem"
:severity="isDark ? 'warning' : 'success'"
@click="toggleTheme();"
@click="toggleTheme()"
>
<i v-if="isDark" class="pi pi-sun"></i>
<i v-else class="pi pi-moon"></i>

View File

@@ -101,8 +101,8 @@ function handleDarkModeToggled(isDarkVar: boolean) {
: 'flex align-items-center'
"
v-bind="props.action"
@click="navigate"
:href="item.route"
@click="navigate"
>
<span :class="item.icon" />
<span class="ml-2 p-menuitem-label">{{ item.label }}</span>
@@ -132,11 +132,13 @@ function handleDarkModeToggled(isDarkVar: boolean) {
>
<span :class="item.icon" />
<span class="ml-2 p-menuitem-label">{{ item.label }}</span>
</span>
</span>
</template>
<template #end>
<div class="flex align-items-stretch justify-content-center">
<DarkModeSwitcher @dark-mode-toggled="handleDarkModeToggled"></DarkModeSwitcher>
<DarkModeSwitcher
@dark-mode-toggled="handleDarkModeToggled"
></DarkModeSwitcher>
<LocaleSwitcher></LocaleSwitcher>
</div>
</template>

View File

@@ -172,12 +172,10 @@ const calendarOptions: ComputedRef<CalendarOptions> = computed(() => ({
id: event.id.toString(),
start: event.start,
end: event.end,
color: event.showFree
? "var(--htwk-gruen-500)"
color: event.showFree
? "var(--htwk-gruen-500)"
: "var(--htwk-grau-60-500)",
textColor: event.showFree
? "var(--green-50)"
: "white",
textColor: event.showFree ? "var(--green-50)" : "white",
title: event.showFree
? t("roomFinderPage.available")
: t("roomFinderPage.occupied"),

View File

@@ -65,7 +65,7 @@ let router: Router;
export const createApp = ViteSSG(
App,
{
{
base: import.meta.env.BASE_URL,
routes: routes.routes,
},
@@ -83,8 +83,8 @@ export const createApp = ViteSSG(
// External redirect
if (to.matched.some((record) => record.meta.redirect)) {
window.location.replace(to.meta.redirect as string);
return;
window.location.replace(to.meta.redirect as string);
return;
}
const newLocale = to.params.locale;
@@ -111,7 +111,7 @@ export const createApp = ViteSSG(
app.use(DialogService);
i18n.setup();
app.use(i18n.vueI18n);
app.use(PrimeVue);
app.component("Avatar", Avatar);
app.component("Badge", Badge);
@@ -142,6 +142,6 @@ export const createApp = ViteSSG(
app.component("Skeleton", Skeleton);
app.component("Calendar", Calendar);
},
)
);
export {router}
export { router };

View File

@@ -14,7 +14,11 @@
//You should have received a copy of the GNU Affero General Public License
//along with this program. If not, see <https://www.gnu.org/licenses/>.
import { createMemoryHistory, RouterOptions, createWebHistory } from "vue-router";
import {
createMemoryHistory,
RouterOptions,
createWebHistory,
} from "vue-router";
const CourseSelection = () => import("../view/CourseSelection.vue");
const AdditionalModules = () => import("../view/create/AdditionalModules.vue");
@@ -28,8 +32,10 @@ const EditAdditionalModules = () =>
const EditModules = () => import("../view/edit/EditModules.vue");
const FaqView = () => import("../view/FaqView.vue");
const routes : RouterOptions = {
history: import.meta.env.SSR ? createMemoryHistory(import.meta.env.BASE_URL) : createWebHistory(import.meta.env.BASE_URL),
const routes: RouterOptions = {
history: import.meta.env.SSR
? createMemoryHistory(import.meta.env.BASE_URL)
: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
@@ -64,7 +70,7 @@ const routes : RouterOptions = {
meta: {
label: "faq",
description: "faqView.description",
}
},
},
{
path: "/additional-modules",
@@ -72,7 +78,7 @@ const routes : RouterOptions = {
component: AdditionalModules,
meta: {
label: "createCalendar",
}
},
},
{
path: "/edit-additional-modules",
@@ -80,8 +86,8 @@ const routes : RouterOptions = {
component: EditAdditionalModules,
meta: {
label: "editCalendar",
description: "editCalendarView.description"
}
description: "editCalendarView.description",
},
},
{
path: "/edit-calendar",
@@ -89,16 +95,16 @@ const routes : RouterOptions = {
component: EditModules,
meta: {
label: "editCalendar",
description: "editCalendarView.description"
}
description: "editCalendarView.description",
},
},
{
path: "/calendar-link",
name: "calendar-link",
component: CalendarLink,
meta: {
label: "createCalendar"
}
label: "createCalendar",
},
},
{
path: "/edit",
@@ -106,8 +112,8 @@ const routes : RouterOptions = {
component: EditCalendarView,
meta: {
label: "editCalendar",
description: "editCalendarView.description"
}
description: "editCalendarView.description",
},
},
{
path: "/privacy-policy",
@@ -115,8 +121,9 @@ const routes : RouterOptions = {
component: {},
meta: {
label: "privacy",
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/datenschutzerklaerung/",
}
redirect:
"https://www.htwk-leipzig.de/hochschule/kontakt/datenschutzerklaerung/",
},
},
{
path: "/imprint",
@@ -125,15 +132,15 @@ const routes : RouterOptions = {
meta: {
label: "imprint",
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/impressum/",
}
},
},
{
path: "/rename-modules",
name: "rename-modules",
component: RenameModules,
meta: {
label: "createCalendar"
}
label: "createCalendar",
},
},
],
};

View File

@@ -26,7 +26,9 @@ import { useI18n } from "vue-i18n";
const { t } = useI18n({ useScope: "global" });
const toast = useToast();
const domain = import.meta.env.SSR ? inject<string>("domain")! : window.location.hostname;
const domain = import.meta.env.SSR
? inject<string>("domain")!
: window.location.hostname;
const getLink = () =>
"https://" + domain + "/api/feed?token=" + tokenStore().token;
@@ -36,7 +38,7 @@ const show = () => {
severity: "info",
summary: t("calendarLink.copyToastSummary"),
detail: t("calendarLink.copyToastNotification"),
life: 3000
life: 3000,
});
};
@@ -57,7 +59,7 @@ function copyToClipboard() {
severity: "error",
summary: t("calendarLink.copyToastError"),
detail: t("calendarLink.copyToastErrorDetail"),
life: 3000
life: 3000,
});
});
}
@@ -65,14 +67,14 @@ function copyToClipboard() {
const forwardToGoogle = () => {
window.open(
"https://calendar.google.com/calendar/u/0/r?cid=" +
encodeURI(getLink().replace("https://", "http://"))
encodeURI(getLink().replace("https://", "http://")),
);
};
const forwardToMicrosoft = () => {
window.open(
"https://outlook.live.com/owa?path=/calendar/action/compose&rru=addsubscription&name=HTWK%20Kalender&url=" +
encodeURI(getLink())
encodeURI(getLink()),
);
};
@@ -80,18 +82,18 @@ const actions = computed(() => [
{
label: t("calendarLink.copyToClipboard"),
icon: "pi pi-copy",
command: copyToClipboard
command: copyToClipboard,
},
{
label: t("calendarLink.toGoogleCalendar"),
icon: "pi pi-google",
command: forwardToGoogle
command: forwardToGoogle,
},
{
label: t("calendarLink.toMicrosoftCalendar"),
icon: "pi pi-microsoft",
command: forwardToMicrosoft
}
command: forwardToMicrosoft,
},
]);
</script>

View File

@@ -87,15 +87,15 @@ const hasContent = computed(() => {
>
<slot name="content"></slot>
<div
v-if="button"
class="flex flex-wrap my-3 gap-2 align-items-center justify-content-end"
v-if="button"
class="flex flex-wrap my-3 gap-2 align-items-center justify-content-end"
>
<Button
:disabled="button.disabled"
class="col-12 md:col-4"
:icon="button.icon"
:label="button.label"
@click="button.onClick()"
:disabled="button.disabled"
class="col-12 md:col-4"
:icon="button.icon"
:label="button.label"
@click="button.onClick()"
/>
</div>
</div>

View File

@@ -16,8 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<script lang="ts" setup>
</script>
<script lang="ts" setup></script>
<template>
<div class="flex align-items-center justify-content-center flex-column">
@@ -244,21 +243,30 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<div class="col">
{{ $t("faqView.crossPromo.teaser") }}
<div class="flex flex-column gap-3 my-3">
<Card v-for="promoPage in new Array('mensa', 'htwkarte')" :key="promoPage">
<Card
v-for="promoPage in new Array('mensa', 'htwkarte')"
:key="promoPage"
>
<template #title>
<div class="flex flex-row align-items-start">
<Avatar :image="'/promo/' + promoPage + '.png'" class="mr-2 flex-shrink-0" size="xlarge" />
<div class="flex flex-column gap-1">
<div>
{{$t("faqView.crossPromo." + promoPage + ".title") }}
</div>
<div class="p-card-subtitle text-base">
<a :href="$t('faqView.crossPromo.' + promoPage + '.link')">
{{$t("faqView.crossPromo." + promoPage + ".link") }}
</a>
</div>
<div class="flex flex-row align-items-start">
<Avatar
:image="'/promo/' + promoPage + '.png'"
class="mr-2 flex-shrink-0"
size="xlarge"
/>
<div class="flex flex-column gap-1">
<div>
{{ $t("faqView.crossPromo." + promoPage + ".title") }}
</div>
<div class="p-card-subtitle text-base">
<a
:href="$t('faqView.crossPromo.' + promoPage + '.link')"
>
{{ $t("faqView.crossPromo." + promoPage + ".link") }}
</a>
</div>
</div>
</div>
</template>
<template #content>
<p class="m-0">

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<script lang="ts" setup>
import moduleStore from "@/store/moduleStore";
import {router} from "@/main";
import { router } from "@/main";
import AdditionalModuleTable from "@/components/AdditionalModuleTable.vue";
const store = moduleStore();
function topFunction() {
window.scrollTo({top: 0, behavior: 'smooth'});
window.scrollTo({ top: 0, behavior: "smooth" });
}
async function nextStep() {

View File

@@ -129,8 +129,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
/>
</template>
<template #body="slotProps">
<div class="flex flex-column sm:flex-row justify-content-between flex-1 column-gap-4 mx-2 md:mx-4">
<p class="flex-1 align-self-stretch sm:align-self-center my-2">{{ slotProps.data.room }}</p>
<div
class="flex flex-column sm:flex-row justify-content-between flex-1 column-gap-4 mx-2 md:mx-4"
>
<p class="flex-1 align-self-stretch sm:align-self-center my-2">
{{ slotProps.data.room }}
</p>
<Button
:label="$t('freeRooms.viewOccupancy')"
icon="pi pi-hourglass"