iceshrimp/src/client/pages/announcements.vue
tamaina 08a2162aa7 feat(client): 翻訳をIndexedDBに保存・プッシュ通知を翻訳 (#6396)
* wip

* tabun ok

* better msg

* oops

* fix lint

* Update gulpfile.ts

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* Update src/client/scripts/set-i18n-contexts.ts

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* refactor

Co-authored-by: acid-chicken <root@acid-chicken.com>

* 

* wip

* fix lint

* たぶんおk

* fix flush

* Translate Notification

* remove console.log

* fix

* add notifications

* remove san

* wip

* ok

* ✌️

* Update src/prelude/array.ts

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* wip

* i18n refactor

* Update init.ts

* ✌️

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
2020-05-23 13:19:31 +09:00

71 lines
1.7 KiB
Vue

<template>
<div>
<portal to="icon"><fa :icon="faBroadcastTower"/></portal>
<portal to="title">{{ $t('announcements') }}</portal>
<mk-pagination :pagination="pagination" #default="{items}" class="ruryvtyk" ref="list">
<section class="_card announcement" v-for="(announcement, i) in items" :key="announcement.id">
<div class="_title"><span v-if="$store.getters.isSignedIn && !announcement.isRead">🆕 </span>{{ announcement.title }}</div>
<div class="_content">
<mfm :text="announcement.text"/>
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
</div>
<div class="_footer" v-if="$store.getters.isSignedIn && !announcement.isRead">
<mk-button @click="read(announcement)" primary><fa :icon="faCheck"/> {{ $t('gotIt') }}</mk-button>
</div>
</section>
</mk-pagination>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import { faCheck, faBroadcastTower } from '@fortawesome/free-solid-svg-icons';
import MkPagination from '../components/ui/pagination.vue';
import MkButton from '../components/ui/button.vue';
export default Vue.extend({
metaInfo() {
return {
title: this.$t('announcements') as string
};
},
components: {
MkPagination,
MkButton
},
data() {
return {
pagination: {
endpoint: 'announcements',
limit: 10,
},
faCheck, faBroadcastTower
};
},
methods: {
read(announcement) {
announcement.isRead = true;
this.$root.api('i/read-announcement', { announcementId: announcement.id });
},
}
});
</script>
<style lang="scss" scoped>
.ruryvtyk {
> .announcement {
> ._content {
> img {
display: block;
max-height: 300px;
max-width: 100%;
}
}
}
}
</style>