Improve announcement

* お知らせにMFMを使えるように
* お知らせに画像を添付できるように
This commit is contained in:
syuilo 2019-04-24 15:21:39 +09:00
parent d73e52ac2a
commit 64d00b08a3
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
6 changed files with 17 additions and 5 deletions

View File

@ -37,6 +37,10 @@ mongodb:
unreleased unreleased
------------------- -------------------
### Improvements
* お知らせにMFMを使えるように
* お知らせに画像を添付できるように
### Fixes ### Fixes
* 投稿のタグ検索APIで大文字小文字が区別されていたのを修正 * 投稿のタグ検索APIで大文字小文字が区別されていたのを修正
* 公開範囲がホームの投稿がグローバルTLに流れる問題を修正 * 公開範囲がホームの投稿がグローバルTLに流れる問題を修正

View File

@ -9,6 +9,9 @@
<ui-textarea v-model="announcement.text"> <ui-textarea v-model="announcement.text">
<span>{{ $t('text') }}</span> <span>{{ $t('text') }}</span>
</ui-textarea> </ui-textarea>
<ui-input v-model="announcement.image">
<span>{{ $t('image-url') }}</span>
</ui-input>
<ui-horizon-group class="fit-bottom"> <ui-horizon-group class="fit-bottom">
<ui-button @click="save()"><fa :icon="['far', 'save']"/> {{ $t('save') }}</ui-button> <ui-button @click="save()"><fa :icon="['far', 'save']"/> {{ $t('save') }}</ui-button>
<ui-button @click="remove(i)"><fa :icon="['far', 'trash-alt']"/> {{ $t('remove') }}</ui-button> <ui-button @click="remove(i)"><fa :icon="['far', 'trash-alt']"/> {{ $t('remove') }}</ui-button>
@ -43,7 +46,8 @@ export default Vue.extend({
add() { add() {
this.announcements.unshift({ this.announcements.unshift({
title: '', title: '',
text: '' text: '',
image: null
}); });
}, },

View File

@ -18,7 +18,8 @@
<p class="fetching" v-if="fetching">{{ $t('fetching') }}<mk-ellipsis/></p> <p class="fetching" v-if="fetching">{{ $t('fetching') }}<mk-ellipsis/></p>
<h1 v-if="!fetching">{{ announcements.length == 0 ? $t('no-broadcasts') : announcements[i].title }}</h1> <h1 v-if="!fetching">{{ announcements.length == 0 ? $t('no-broadcasts') : announcements[i].title }}</h1>
<p v-if="!fetching"> <p v-if="!fetching">
<span v-if="announcements.length != 0" v-html="announcements[i].text"></span> <mfm v-if="announcements.length != 0" :text="announcements[i].text"/>
<img v-if="announcements.length != 0 && announcements[i].image" :src="announcements[i].image" alt="" style="display: block; max-height: 130px; max-width: 100%;"/>
<template v-if="announcements.length == 0">{{ $t('have-a-nice-day') }}</template> <template v-if="announcements.length == 0">{{ $t('have-a-nice-day') }}</template>
</p> </p>
<a v-if="announcements.length > 1" @click="next">{{ $t('next') }} &gt;&gt;</a> <a v-if="announcements.length > 1" @click="next">{{ $t('next') }} &gt;&gt;</a>

View File

@ -44,7 +44,8 @@
<div v-if="announcements && announcements.length > 0"> <div v-if="announcements && announcements.length > 0">
<div v-for="announcement in announcements"> <div v-for="announcement in announcements">
<h1 v-html="announcement.title"></h1> <h1 v-html="announcement.title"></h1>
<div v-html="announcement.text"></div> <mfm :text="announcement.text"/>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 130px; max-width: 100%;"/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -43,7 +43,8 @@
<div class="announcements" v-if="announcements && announcements.length > 0"> <div class="announcements" v-if="announcements && announcements.length > 0">
<article v-for="announcement in announcements"> <article v-for="announcement in announcements">
<span v-html="announcement.title" class="title"></span> <span v-html="announcement.title" class="title"></span>
<div v-html="announcement.text"></div> <mfm :text="announcement.text"/>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 120px; max-width: 100%;"/>
</article> </article>
</div> </div>
<a :href="aboutUrl"><p class="about">{{ $t('about') }}</p></a> <a :href="aboutUrl"><p class="about">{{ $t('about') }}</p></a>

View File

@ -29,7 +29,8 @@
<div class="announcements" v-if="announcements && announcements.length > 0"> <div class="announcements" v-if="announcements && announcements.length > 0">
<article v-for="announcement in announcements"> <article v-for="announcement in announcements">
<span class="title" v-html="announcement.title"></span> <span class="title" v-html="announcement.title"></span>
<div v-html="announcement.text"></div> <mfm :text="announcement.text"/>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 120px; max-width: 100%;"/>
</article> </article>
</div> </div>
<article class="about-misskey"> <article class="about-misskey">