Browse Source

MarkedBanners + SystemBanners (Improved SystemBanners)

Markeds/System-Banners
alan 7 months ago
parent
commit
2da5578c43
4 changed files with 30 additions and 22 deletions
  1. +0
    -2
      gca-admin-gurusoft-message-dashboard/src/App.vue
  2. +1
    -1
      gca-admin-gurusoft-message-dashboard/src/components/MarkedsBanner.vue
  3. +29
    -18
      gca-admin-gurusoft-message-dashboard/src/components/SystemBanner.vue
  4. +0
    -1
      gca-admin-gurusoft-message-dashboard/vite.config.js

+ 0
- 2
gca-admin-gurusoft-message-dashboard/src/App.vue View File

@ -1,9 +1,7 @@
<template> <template>
<div class="app"> <div class="app">
<!-- System-wide banners -->
<SystemBanner /> <SystemBanner />
<!-- Main page content -->
<router-view /> <router-view />
</div> </div>
</template> </template>

+ 1
- 1
gca-admin-gurusoft-message-dashboard/src/components/MarkedsBanner.vue View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container mt-4"> <div class="container mt-4">
<h2 class="mb-3">Markedsføringsbannere</h2>
<h2 class="mb-3">Markeds Banner</h2>
<div class="scroll-box border rounded p-3 mx-auto"> <div class="scroll-box border rounded p-3 mx-auto">
<div class="d-flex flex-row gap-3 scroll-content"> <div class="d-flex flex-row gap-3 scroll-content">

+ 29
- 18
gca-admin-gurusoft-message-dashboard/src/components/SystemBanner.vue View File

@ -5,31 +5,36 @@
<div <div
v-for="banner in activeBanners" v-for="banner in activeBanners"
:key="banner.id" :key="banner.id"
class="alert alert-danger border-danger banner-drop d-flex align-items-start shadow-sm border-start border-4"
class="alert alert-danger border-danger banner-drop d-flex justify-content-between align-items-start shadow-sm small-banner"
role="alert" role="alert"
@click="goToBannerPage" @click="goToBannerPage"
style="cursor: pointer" style="cursor: pointer"
> >
<div class="flex-grow-1"> <div class="flex-grow-1">
<h5 class="mb-1 fw-bold">{{ banner.title }}</h5>
<p class="text-muted mb-1" style="font-size: 0.85rem;">
<div class="d-flex flex-row justify-content-between align-items-center flex-wrap">
<span class="me-3">{{ banner.text }}</span>
<div class="text-end">
<a
v-if="banner.link"
:href="banner.link"
class="alert-link d-block"
target="_blank"
rel="noopener"
@click.stop
>
Mer info
</a>
<span class="badge bg-light text-dark mt-1 d-block">{{ banner.type }}</span>
</div>
</div>
<div class="text-muted mt-1" style="font-size: 0.75rem;">
{{ formatDate(banner.updated) }} {{ formatDate(banner.updated) }}
</p>
<p class="mb-1">{{ banner.text }}</p>
<a
v-if="banner.link"
:href="banner.link"
class="alert-link d-block mt-2"
target="_blank"
rel="noopener"
@click.stop
>
Mer info
</a>
</div>
</div> </div>
<button <button
type="button" type="button"
class="btn-close ms-3 mt-1"
class="btn-close ms-3"
aria-label="Close" aria-label="Close"
@click.stop="banner.dismissed = true" @click.stop="banner.dismissed = true"
></button> ></button>
@ -39,6 +44,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, onMounted, computed } from 'vue' import { ref, onMounted, computed } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -108,13 +114,18 @@ const goToBannerPage = (event) => {
.alert-wrapper { .alert-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem;
gap: 0.5rem;
}
.small-banner {
padding: 0.5rem 1rem;
font-size: 0.9rem;
} }
.banner-drop { .banner-drop {
animation: dropDown 0.6s ease-out forwards; animation: dropDown 0.6s ease-out forwards;
opacity: 0; opacity: 0;
transform: translateY(-30px);
transform: translateY(-20px);
} }
@keyframes dropDown { @keyframes dropDown {

+ 0
- 1
gca-admin-gurusoft-message-dashboard/vite.config.js View File

@ -4,7 +4,6 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools' import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue(), vue(),

Loading…
Cancel
Save