2022-07-10 01:24:54 +02:00
|
|
|
<template>
|
|
|
|
|
<div>
|
2022-07-16 14:20:22 +02:00
|
|
|
<q-btn flat round dense icon="fas fa-bell" class="q-mx-xs" @click="open = !open">
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
2022-07-16 14:20:22 +02:00
|
|
|
</q-btn>
|
|
|
|
|
<q-btn v-if="false" flat round dense icon="fas fa-bell">
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
2022-07-16 14:20:22 +02:00
|
|
|
</q-btn>
|
2022-07-10 01:24:54 +02:00
|
|
|
|
2022-07-21 00:20:48 +02:00
|
|
|
|
2022-07-26 15:46:29 +02:00
|
|
|
<q-drawer v-model="open" side="right" elevated class="text-black" :width="350">
|
2022-07-10 01:24:54 +02:00
|
|
|
|
2022-07-16 14:20:22 +02:00
|
|
|
<q-bar class="bg-primary text-white">
|
|
|
|
|
{{ $t('notifs.notifs') }}
|
|
|
|
|
<q-space/>
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-btn round dense icon="fas fa-pencil-alt" class="q-mx-xs">
|
|
|
|
|
<q-menu style="min-width: 200px">
|
|
|
|
|
<q-list style="">
|
|
|
|
|
<q-item clickable v-close-popup to="/notifs">
|
|
|
|
|
<q-item-section side>
|
|
|
|
|
<q-icon name="fas fa-cog"/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>{{ $t('notifs.settings') }}</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item clickable v-close-popup @click="notifStore.setAllRead(username)">
|
|
|
|
|
<q-item-section side>
|
|
|
|
|
<q-icon name="fas fa-check"/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>{{ $t('notifs.setallread') }}</q-item-section>
|
|
|
|
|
</q-item>
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-item clickable v-close-popup @click="notifStore.deleteAll(username)">
|
|
|
|
|
<q-item-section side>
|
|
|
|
|
<q-icon name="fas fa-trash-alt"/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>{{ $t('notifs.deleteall') }}</q-item-section>
|
|
|
|
|
</q-item>
|
2022-07-21 00:20:48 +02:00
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
</q-btn>
|
2022-07-16 14:20:22 +02:00
|
|
|
<q-btn flat round color="white" icon="close" @click="open = false"></q-btn>
|
|
|
|
|
</q-bar>
|
2022-07-10 01:24:54 +02:00
|
|
|
|
2022-07-21 00:20:48 +02:00
|
|
|
<div class="row justify-center margin_buttons q-gutter-lg">
|
|
|
|
|
<q-btn-toggle
|
|
|
|
|
v-model="show_all"
|
|
|
|
|
class="my-custom-toggle"
|
|
|
|
|
no-caps
|
|
|
|
|
rounded
|
|
|
|
|
dense
|
|
|
|
|
unelevated
|
|
|
|
|
toggle-color="primary"
|
|
|
|
|
color="white"
|
|
|
|
|
text-color="primary"
|
|
|
|
|
:options="[
|
|
|
|
|
{label: t('notifs.all'), value: true},
|
|
|
|
|
{label: t('notifs.notread'), value: false}
|
|
|
|
|
]"
|
|
|
|
|
/>
|
2022-07-16 14:20:22 +02:00
|
|
|
</div>
|
2022-07-21 00:20:48 +02:00
|
|
|
|
2022-07-16 14:20:22 +02:00
|
|
|
<div class="clBorderSperator"></div>
|
|
|
|
|
|
|
|
|
|
<div class="q-ma-xs">
|
|
|
|
|
<q-list bordered class="rounded-borders">
|
2022-07-10 01:24:54 +02:00
|
|
|
|
2022-07-21 00:20:48 +02:00
|
|
|
<div v-if="num_notifs_unread === 0">
|
2022-07-10 01:24:54 +02:00
|
|
|
<q-item>
|
2022-07-16 14:20:22 +02:00
|
|
|
<q-item-label lines="1">{{ $t('notifs.nonotif') }}</q-item-label>
|
2022-07-10 01:24:54 +02:00
|
|
|
|
|
|
|
|
</q-item>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-07-16 14:20:22 +02:00
|
|
|
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-item clickable v-for="(notif, index) in lasts_notifs" :key="index">
|
2022-07-10 01:24:54 +02:00
|
|
|
|
2022-07-21 00:20:48 +02:00
|
|
|
<!--<q-item-section avatar>
|
2022-07-10 01:24:54 +02:00
|
|
|
<q-avatar>
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-item-label lines="1">{{ getTypeDirNotif(notif) }}</q-item-label>
|
2022-07-10 01:24:54 +02:00
|
|
|
</q-avatar>
|
|
|
|
|
</q-item-section>-->
|
|
|
|
|
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-avatar>
|
2022-07-26 15:46:29 +02:00
|
|
|
<img :src="notif.myimgsender" :alt="notif.sender">
|
2022-07-21 00:20:48 +02:00
|
|
|
</q-avatar>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-item-section v-ripple @click="clickNotif(notif)">
|
2022-07-26 15:46:29 +02:00
|
|
|
<q-item-label lines="3" :class="(!notif.read) ? 'unread' : 'read'"><div v-html="getNotifText(notif, false)"></div></q-item-label>
|
|
|
|
|
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'">
|
2022-07-23 17:44:44 +02:00
|
|
|
{{ tools.timeAgo(notif.datenotif) }}
|
2022-07-21 00:20:48 +02:00
|
|
|
<!--{{ // getUsernameChatByNotif(notif) }}-->
|
2022-07-10 01:24:54 +02:00
|
|
|
</q-item-label>
|
|
|
|
|
</q-item-section>
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-item-section side>
|
|
|
|
|
<q-item-label>
|
2022-07-26 15:46:29 +02:00
|
|
|
<q-btn dense rounded icon="fas fa-ellipsis-h">
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-menu>
|
|
|
|
|
<q-list style="min-width: 150px">
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id)">
|
2022-07-21 00:20:48 +02:00
|
|
|
<q-item-section side>
|
|
|
|
|
<q-icon name="fas fa-trash-alt"/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>{{ $t('notifs.delete_notif') }}</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item clickable v-close-popup @click="notifStore.deactivateRec(notif._id)">
|
|
|
|
|
<q-item-section side>
|
2022-07-23 17:44:44 +02:00
|
|
|
<q-icon name="fas fa-bell-slash"/>
|
2022-07-21 00:20:48 +02:00
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>{{ $t('notifs.deactivate_notif') }}</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-item-label>
|
2022-07-10 01:24:54 +02:00
|
|
|
</q-item-section>
|
2022-07-21 00:20:48 +02:00
|
|
|
|
2022-07-10 01:24:54 +02:00
|
|
|
</q-item>
|
|
|
|
|
<q-separator/>
|
|
|
|
|
</q-list>
|
2022-07-16 14:20:22 +02:00
|
|
|
</div>
|
|
|
|
|
</q-drawer>
|
2022-07-10 01:24:54 +02:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" src="./notifPopover.ts">
|
|
|
|
|
</script>
|
2022-07-21 00:20:48 +02:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import './notifPopover.scss';
|
|
|
|
|
</style>
|