2022-03-17 16:59:10 +00:00
|
|
|
<template>
|
|
|
|
<div class="announcement">
|
2022-03-17 18:01:45 +00:00
|
|
|
<div class="heading">
|
|
|
|
<h4>{{ $t('announcements.title') }}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="body">
|
|
|
|
<rich-content
|
|
|
|
:html="content"
|
|
|
|
:emoji="announcement.emojis"
|
|
|
|
:handle-links="true"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="footer">
|
|
|
|
<button
|
2022-03-17 19:07:04 +00:00
|
|
|
v-if="currentUser"
|
2022-03-17 18:01:45 +00:00
|
|
|
class="btn button-default"
|
|
|
|
:class="{ toggled: isRead }"
|
|
|
|
@click="markAsRead"
|
|
|
|
>
|
|
|
|
{{ $t('announcements.mark_as_read_action') }}
|
|
|
|
</button>
|
2022-03-17 19:07:04 +00:00
|
|
|
<button
|
|
|
|
v-if="currentUser && currentUser.role === 'admin'"
|
|
|
|
class="btn button-default"
|
|
|
|
@click="deleteAnnouncement"
|
|
|
|
>
|
|
|
|
{{ $t('announcements.delete_action') }}
|
|
|
|
</button>
|
2022-03-17 18:01:45 +00:00
|
|
|
</div>
|
2022-03-17 16:59:10 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./announcement.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import "../../variables";
|
|
|
|
|
|
|
|
.announcement {
|
|
|
|
border-bottom-width: 1px;
|
|
|
|
border-bottom-style: solid;
|
|
|
|
border-bottom-color: var(--border, $fallback--border);
|
|
|
|
border-radius: 0;
|
|
|
|
padding: var(--status-margin, $status-margin);
|
2022-03-17 18:01:45 +00:00
|
|
|
|
|
|
|
.heading, .body {
|
|
|
|
margin-bottom: var(--status-margin, $status-margin);
|
|
|
|
}
|
2022-03-17 19:07:04 +00:00
|
|
|
|
|
|
|
.footer {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
min-width: 10em;
|
|
|
|
}
|
|
|
|
}
|
2022-03-17 16:59:10 +00:00
|
|
|
}
|
|
|
|
</style>
|