Files
newfreeplanet_OLD/src/components/CNotifAtTop/CNotifAtTop.vue

61 lines
2.1 KiB
Vue
Raw Normal View History

2022-09-13 12:28:33 +02:00
<template>
<q-banner
v-if="num_notifs > 0"
rounded
dense
class="bg-primary text-white"
color="primary q-title"
style="text-align: center;">
<template v-slot:avatar>
2022-09-14 11:31:48 +02:00
<q-icon name="fas fa-exclamation-triangle" color="yellow" size="xs"/>
2022-09-13 12:28:33 +02:00
</template>
2022-10-21 21:25:54 +02:00
<q-item v-for="(notif, index) in lasts_notifs_req" :key="index">
2022-09-13 12:28:33 +02:00
<!--<q-item-section avatar>
<q-avatar>
<q-item-label lines="1">{{ getTypeDirNotif(notif) }}</q-item-label>
</q-avatar>
</q-item-section>-->
<q-item-section avatar>
<q-avatar>
<img :src="notif.myimgsender" :alt="notif.sender">
</q-avatar>
</q-item-section>
2022-10-21 21:25:54 +02:00
<q-item-section>
2022-09-13 12:28:33 +02:00
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
<div v-html="getNotifText($t, notif, false)"></div>
</q-item-label>
2022-09-14 11:31:48 +02:00
<q-item-label caption lines="18"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
2022-10-21 21:25:54 +02:00
>
2022-09-13 12:28:33 +02:00
<div class="row no-wrap justify-evenly q-pa-sm">
<q-btn
size="md"
icon="fas fa-coins"
2022-10-21 21:25:54 +02:00
:disable="notif.disablecoinclick"
2022-09-13 12:28:33 +02:00
color="positive" :label="$t('circuit.accept_coins_qty', {qty: notif.extrarec.qty, symbol: notif.extrarec.symbol})"
2022-10-21 21:25:54 +02:00
@click="notif.disablecoinclick = true; tools.acceptCoins(q, notif.sender, notif)"
2022-09-13 12:28:33 +02:00
/>
<q-btn
size="md"
2022-10-21 21:25:54 +02:00
:disable="notif.disablecoinclick"
2022-09-13 12:28:33 +02:00
color="negative" :label="$t('circuit.refuse_coins_qty', {qty: notif.extrarec.qty, symbol: notif.extrarec.symbol})"
2022-10-21 21:25:54 +02:00
@click="notif.disablecoinclick = true; tools.refuseCoins(q, notif.sender, notif)"
2022-09-13 12:28:33 +02:00
/>
</div>
</q-item-label>
</q-item-section>
</q-item>
</q-banner>
</template>
<script lang="ts" src="./CNotifAtTop.ts">
</script>
<style lang="scss" scoped>
@import './CNotifAtTop.scss';
</style>