Add announcement display with placeholder messages
This commit is contained in:
parent
96a24ec625
commit
a98bf48884
8 changed files with 126 additions and 2 deletions
src
boot
components
announcement
announcements_page
nav_panel
side_drawer
|
@ -20,6 +20,7 @@ import ShoutPanel from 'components/shout_panel/shout_panel.vue'
|
|||
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
|
||||
import About from 'components/about/about.vue'
|
||||
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
|
||||
import AnnouncementsPage from 'components/announcements_page/announcements_page.vue'
|
||||
|
||||
export default (store) => {
|
||||
const validateAuthenticatedRoute = (to, from, next) => {
|
||||
|
@ -69,6 +70,7 @@ export default (store) => {
|
|||
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
|
||||
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
|
||||
{ name: 'about', path: '/about', component: About },
|
||||
{ name: 'announcements', path: '/announcements', component: AnnouncementsPage },
|
||||
{ name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile }
|
||||
]
|
||||
|
||||
|
|
13
src/components/announcement/announcement.js
Normal file
13
src/components/announcement/announcement.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
const Announcement = {
|
||||
props: {
|
||||
announcement: Object
|
||||
},
|
||||
computed: {
|
||||
content () {
|
||||
return this.announcement.content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Announcement
|
19
src/components/announcement/announcement.vue
Normal file
19
src/components/announcement/announcement.vue
Normal file
|
@ -0,0 +1,19 @@
|
|||
<template>
|
||||
<div class="announcement">
|
||||
<rich-content :html="content" />
|
||||
</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);
|
||||
}
|
||||
</style>
|
42
src/components/announcements_page/announcements_page.js
Normal file
42
src/components/announcements_page/announcements_page.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
import Announcement from '../announcement/announcement.vue'
|
||||
|
||||
const AnnouncementsPage = {
|
||||
components: {
|
||||
Announcement
|
||||
},
|
||||
computed: {
|
||||
announcements () {
|
||||
return [{
|
||||
"id": "8",
|
||||
"content": "<p>Looks like there was an issue processing audio attachments without embedded art since yesterday due to an experimental new feature. That issue has now been fixed, so you may see older posts with audio from other servers pop up in your feeds now as they are being finally properly processed. Sorry!</p>",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2020-07-03T01:27:38.726Z",
|
||||
"updated_at": "2020-07-03T01:27:38.752Z",
|
||||
"read": true,
|
||||
"mentions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"reactions": []
|
||||
}, {
|
||||
"id": "8",
|
||||
"content": "<p>Looks like there was an issue processing audio attachments without embedded art since yesterday due to an experimental new feature. That issue has now been fixed, so you may see older posts with audio from other servers pop up in your feeds now as they are being finally properly processed. Sorry!</p>",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2020-07-03T01:27:38.726Z",
|
||||
"updated_at": "2020-07-03T01:27:38.752Z",
|
||||
"read": true,
|
||||
"mentions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"reactions": []
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default AnnouncementsPage
|
21
src/components/announcements_page/announcements_page.vue
Normal file
21
src/components/announcements_page/announcements_page.vue
Normal file
|
@ -0,0 +1,21 @@
|
|||
<template>
|
||||
<div class="panel panel-default announcements-page">
|
||||
<div class="panel-heading">
|
||||
<span>
|
||||
{{ $t('announcements.page_header') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<section
|
||||
v-for="announcement in announcements"
|
||||
:key="announcement.id"
|
||||
>
|
||||
<announcement
|
||||
:announcement="announcement"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./announcements_page.js"></script>
|
|
@ -12,7 +12,8 @@ import {
|
|||
faComments,
|
||||
faBell,
|
||||
faInfoCircle,
|
||||
faStream
|
||||
faStream,
|
||||
faBullhorn
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
|
||||
library.add(
|
||||
|
@ -25,7 +26,8 @@ library.add(
|
|||
faComments,
|
||||
faBell,
|
||||
faInfoCircle,
|
||||
faStream
|
||||
faStream,
|
||||
faBullhorn
|
||||
)
|
||||
|
||||
const NavPanel = {
|
||||
|
|
|
@ -85,6 +85,18 @@
|
|||
/>{{ $t("nav.about") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'announcements' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110"
|
||||
icon="bullhorn"
|
||||
/>{{ $t('nav.announcements') }}
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -179,6 +179,19 @@
|
|||
/> {{ $t("nav.administration") }}
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="toggleDrawer"
|
||||
>
|
||||
<router-link
|
||||
:to="{ name: 'announcements' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="bullhorn"
|
||||
/> {{ $t("nav.announcements") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li
|
||||
v-if="currentUser"
|
||||
@click="toggleDrawer"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue