From b75314ffb9e6725ef48410eb53dd9884586b666a Mon Sep 17 00:00:00 2001 From: Xeovalyte Date: Tue, 27 Sep 2022 17:33:00 +0200 Subject: [PATCH] added news system --- frontend/app.vue | 6 +- frontend/components/layout/Navbar.vue | 2 +- frontend/pages/news.vue | 11 --- frontend/pages/news/index.vue | 78 +++++++++++++++++++ frontend/pages/news/newmessage.vue | 70 +++++++++++++++++ .../pages/settings/config/changepassword.vue | 4 +- 6 files changed, 156 insertions(+), 15 deletions(-) delete mode 100644 frontend/pages/news.vue create mode 100644 frontend/pages/news/index.vue create mode 100644 frontend/pages/news/newmessage.vue diff --git a/frontend/app.vue b/frontend/app.vue index ef584ea..e3a7b30 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -31,6 +31,7 @@ const userData = ref(null) const userPersons = ref([]) const userAllPersons = ref([]) const calEvents = ref([]) +const news = ref(null) onMounted(() => { auth.value = getAuth() @@ -48,6 +49,9 @@ onMounted(() => { getPersons(userData.value.relatiecodes) } + if (!userData.value.sendNews && route.path === '/news/newmessage') navigateTo('/') + if (!userData.value.admin && route.path.startsWith('/settings/admin')) navigateTo('/') + isAuthenticated.value = true } else { @@ -76,5 +80,5 @@ const getPersons = async (persons) => { const ledenlijst = ref([]) -provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents }) +provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents, news }) \ No newline at end of file diff --git a/frontend/components/layout/Navbar.vue b/frontend/components/layout/Navbar.vue index fe5912e..12d5af2 100644 --- a/frontend/components/layout/Navbar.vue +++ b/frontend/components/layout/Navbar.vue @@ -5,7 +5,7 @@ Home - + News diff --git a/frontend/pages/news.vue b/frontend/pages/news.vue deleted file mode 100644 index b8ed543..0000000 --- a/frontend/pages/news.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/pages/news/index.vue b/frontend/pages/news/index.vue new file mode 100644 index 0000000..cf63ffe --- /dev/null +++ b/frontend/pages/news/index.vue @@ -0,0 +1,78 @@ + + + \ No newline at end of file diff --git a/frontend/pages/news/newmessage.vue b/frontend/pages/news/newmessage.vue new file mode 100644 index 0000000..afd7d3d --- /dev/null +++ b/frontend/pages/news/newmessage.vue @@ -0,0 +1,70 @@ +