inital commit

This commit is contained in:
Torsten Schulz
2024-06-15 23:01:46 +02:00
parent 1b7fefe381
commit 61653ff407
105 changed files with 7805 additions and 524 deletions

View File

@@ -0,0 +1,63 @@
<template>
<div v-if="modelValue" class="dialog-overlay">
<div class="dialog">
<h2>{{ title }}</h2>
<p>{{ message }}</p>
<button @click="closeDialog">OK</button>
</div>
</div>
</template>
<script>
export default {
name: 'DialogComponent',
props: {
title: {
type: String,
required: true
},
message: {
type: String,
required: true
},
modelValue: {
type: Boolean,
default: false
}
},
methods: {
closeDialog() {
this.$emit('update:modelValue', false);
this.$emit('close');
}
}
};
</script>
<style scoped>
.dialog-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
.dialog {
background: white;
padding: 20px;
border-radius: 5px;
max-width: 400px;
width: 100%;
text-align: center;
}
button {
margin-top: 20px;
}
</style>

View File

@@ -0,0 +1,65 @@
<template>
<footer class="footer">
<div class="left-links">
<router-link class="login-link" to="/login" v-if="!isLoggedIn">Login</router-link>
<a v-if="isLoggedIn" @click="logout" class="logout-link">Logout</a>
</div>
<div class="right-links">
<router-link to="/terms">Impressum</router-link>
<router-link to="/privacy-policy">Datenschutzerklärung</router-link>
</div>
</footer>
</template>
<script>
import { mapGetters, mapActions } from 'vuex';
export default {
name: 'FooterComponent',
computed: {
...mapGetters(['isLoggedIn'])
},
methods: {
...mapActions(['logout']),
navigateToLogin() {
this.$router.push('/login');
}
}
};
</script>
<style scoped>
.footer {
background-color: #0b1735;
bottom: 0;
left: 0;
width: 100%;
padding: 7px;
display: flex;
justify-content: space-between;
align-items: center;
}
.left-links {
display: flex;
align-items: center;
}
.right-links {
display: flex;
align-items: center;
}
.footer a {
color: #fff;
padding-right: 20px;
text-decoration: none;
}
.footer a.login-link {
color: #444;
}
.footer a.logout-link {
cursor: pointer;
}
</style>

View File

@@ -0,0 +1,62 @@
<template>
<header>
<div class="header-title">
<h1>Evangelische Miriamgemeinde Frankfurt am Main</h1>
<span class="reload-icon" @click="reloadMenu">&#x27F3;</span>
</div>
<NavbarComponent />
</header>
</template>
<script>
import NavbarComponent from './NavbarComponent.vue';
import { mapActions } from 'vuex';
export default {
name: 'HeaderComponent',
components: {
NavbarComponent
},
methods: {
...mapActions(['loadMenuData']),
reloadMenu() {
this.loadMenuData();
}
}
};
</script>
<style scoped>
header {
display: flex;
flex-direction: column;
width: 100%;
background-color: #e0bfff;
}
.header-title {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 0.3em 0.5em;
}
header h1 {
margin: 0;
}
.reload-icon {
font-size: 16px;
cursor: pointer;
margin-left: 10px;
background-color: #e0bfff;
color: white;
padding: 5px;
border-radius: 50%;
}
.reload-icon:hover {
color: #7a00d1;
}
</style>

View File

@@ -0,0 +1,129 @@
<template>
<nav class="navbar">
<ul>
<li v-for="item in menu" :key="item.name">
<router-link :to="item.link" v-if="item.link">
{{ item.name }}
</router-link>
<span v-if="!item.link">
{{ item.name }}
</span>
<transition name="fade">
<div v-if="item.submenu && item.submenu.length" class="dropdown-content">
<router-link v-for="subitem in item.submenu" :key="subitem.name" :to="subitem.link">
{{ subitem.name }}
</router-link>
</div>
</transition>
</li>
</ul>
</nav>
</template>
<script>
import { mapState } from 'vuex';
export default {
name: 'NavbarComponent',
computed: {
...mapState(['menuData']),
menu() {
return this.menuData.filter(item => {
if (!item.showInMenu) {
return false;
}
if (item.requiresAuth && !this.isLoggedIn) {
return false;
}
if (item.submenu) {
item.submenu = item.submenu.filter(subitem => subitem.showInMenu && (!subitem.requiresAuth || this.isLoggedIn));
}
return true;
});
},
isLoggedIn() {
return this.$store.getters.isLoggedIn;
}
}
};
</script>
<style scoped>
.navbar {
background-color: #9400ff;
overflow: visible;
height: 47px;
display: flex;
width: 100%;
}
.navbar ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
}
.navbar li {
position: relative;
}
.navbar a,
.navbar li > span {
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
font-weight: bold;
}
.navbar a:hover {
background-color: #7a00d1;
}
.menu-icon {
width: 20px;
height: 20px;
margin-right: 5px;
}
.dropdown-content {
position: absolute;
background-color: #9400ff;
min-width: 200px;
z-index: 1;
top: 100%;
left: 0;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
box-shadow: 2px 2px 4px #666;
}
.dropdown-content a {
color: white;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #7a00d1;
}
.navbar li:hover .dropdown-content {
opacity: 1;
visibility: visible;
}
.fade-enter-active, .fade-leave-active {
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
opacity: 0;
visibility: hidden;
}
</style>