86 lines
4.8 KiB
JavaScript
86 lines
4.8 KiB
JavaScript
import { ref, computed, mergeProps, unref, useSSRContext } from 'vue';
|
|
import { ssrRenderAttrs, ssrRenderList, ssrInterpolate, ssrRenderClass, ssrRenderComponent } from 'vue/server-renderer';
|
|
import { Calendar } from 'lucide-vue-next';
|
|
import { u as useHead } from './composables-CK-Mp9jS.mjs';
|
|
import './server.mjs';
|
|
import '../nitro/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'node:url';
|
|
import '../routes/renderer.mjs';
|
|
import 'vue-bundle-renderer/runtime';
|
|
import 'unhead/server';
|
|
import 'devalue';
|
|
import 'unhead/utils';
|
|
import 'pinia';
|
|
import 'vue-router';
|
|
|
|
const _sfc_main = {
|
|
__name: "termine",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const termine = ref([]);
|
|
const naechsteTermine = computed(() => {
|
|
const heute = /* @__PURE__ */ new Date();
|
|
heute.setHours(0, 0, 0, 0);
|
|
return termine.value.filter((t) => {
|
|
const terminDatum = new Date(t.datum);
|
|
return terminDatum >= heute;
|
|
}).sort((a, b) => new Date(a.datum) - new Date(b.datum));
|
|
});
|
|
const formatDay = (dateString) => {
|
|
const date = new Date(dateString);
|
|
return date.getDate();
|
|
};
|
|
const formatMonth = (dateString) => {
|
|
const date = new Date(dateString);
|
|
const monate = ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"];
|
|
return monate[date.getMonth()];
|
|
};
|
|
const formatFullDate = (dateString) => {
|
|
const date = new Date(dateString);
|
|
const wochentage = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
|
|
const monate = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
|
|
return `${wochentage[date.getDay()]}, ${date.getDate()}. ${monate[date.getMonth()]} ${date.getFullYear()}`;
|
|
};
|
|
useHead({
|
|
title: "Termine & Events - Harheimer TC"
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-full py-16 bg-gray-50" }, _attrs))}><div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8"><div class="text-center mb-12"><h1 class="text-4xl sm:text-5xl font-display font-bold text-gray-900 mb-4"> Termine & Events </h1><div class="w-24 h-1 bg-primary-600 mx-auto mb-6"></div><p class="text-xl text-gray-600 max-w-3xl mx-auto"> Alle kommenden Termine und Veranstaltungen des Harheimer TC </p></div>`);
|
|
if (naechsteTermine.value.length > 0) {
|
|
_push(`<div class="space-y-4"><!--[-->`);
|
|
ssrRenderList(naechsteTermine.value, (termin, index) => {
|
|
_push(`<div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow"><div class="flex items-start space-x-4"><div class="flex-shrink-0 w-16 h-16 bg-primary-600 rounded-xl flex flex-col items-center justify-center text-white"><span class="text-2xl font-bold">${ssrInterpolate(formatDay(termin.datum))}</span><span class="text-xs">${ssrInterpolate(formatMonth(termin.datum))}</span></div><div class="flex-1"><div class="flex items-start justify-between"><div><h3 class="text-xl font-semibold text-gray-900 mb-1">${ssrInterpolate(termin.titel)}</h3><p class="text-gray-600 mb-2">${ssrInterpolate(termin.beschreibung)}</p><p class="text-sm text-gray-500">${ssrInterpolate(formatFullDate(termin.datum))}</p></div><span class="${ssrRenderClass([
|
|
"px-3 py-1 text-sm font-medium rounded-full",
|
|
termin.kategorie === "Turnier" ? "bg-yellow-100 text-yellow-800" : "bg-blue-100 text-blue-800"
|
|
])}">${ssrInterpolate(termin.kategorie)}</span></div></div></div></div>`);
|
|
});
|
|
_push(`<!--]--></div>`);
|
|
} else {
|
|
_push(`<div class="text-center py-16 bg-white rounded-xl shadow-lg">`);
|
|
_push(ssrRenderComponent(unref(Calendar), {
|
|
size: 64,
|
|
class: "text-gray-400 mx-auto mb-4"
|
|
}, null, _parent));
|
|
_push(`<h3 class="text-2xl font-semibold text-gray-900 mb-2">Keine kommenden Termine</h3><p class="text-gray-600"> Aktuell sind keine Termine geplant. Schauen Sie bald wieder vorbei! </p></div>`);
|
|
}
|
|
_push(`<div class="mt-12 bg-primary-50 border border-primary-100 rounded-xl p-6"><h3 class="text-lg font-semibold text-primary-900 mb-2"> Hinweis </h3><p class="text-primary-800"> Alle Termine sind vorbehaltlich kurzfristiger Änderungen. Bei Fragen zu einzelnen Veranstaltungen kontaktieren Sie uns gerne. </p></div></div></div>`);
|
|
};
|
|
}
|
|
};
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/termine.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|
|
//# sourceMappingURL=termine-ZiVCG4zJ.mjs.map
|