feat: Timestamps on announcements

Closes #10453
This commit is contained in:
ThatOneCalculator 2023-07-09 20:46:53 -07:00
parent ba4e96ee1e
commit a5f84ec30b
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
2 changed files with 22 additions and 2 deletions

View File

@ -5,6 +5,13 @@
<MkSparkle v-if="isGoodNews">{{ title }}</MkSparkle> <MkSparkle v-if="isGoodNews">{{ title }}</MkSparkle>
<p v-else>{{ title }}</p> <p v-else>{{ title }}</p>
</div> </div>
<div :class="$style.time">
<MkTime :time="announcement.createdAt" />
<div v-if="announcement.updatedAt">
{{ i18n.ts.updatedAt }}:
<MkTime :time="announcement.createdAt" />
</div>
</div>
<Mfm :text="text" /> <Mfm :text="text" />
<img <img
v-if="imageUrl != null" v-if="imageUrl != null"
@ -68,6 +75,10 @@ const gotIt = () => {
} }
} }
.time {
font-size: 0.8rem;
}
.gotIt { .gotIt {
margin: 8px 0 0 0; margin: 8px 0 0 0;
} }

View File

@ -15,8 +15,13 @@
class="_card announcement" class="_card announcement"
> >
<div class="_title"> <div class="_title">
<span v-if="$i && !announcement.isRead">🆕 </span <span v-if="$i && !announcement.isRead">🆕 </span>
>{{ announcement.title }} <h3>{{ announcement.title }}</h3>
<MkTime :time="announcement.createdAt" />
<div v-if="announcement.updatedAt">
{{ i18n.ts.updatedAt }}:
<MkTime :time="announcement.createdAt" />
</div>
</div> </div>
<div class="_content"> <div class="_content">
<Mfm :text="announcement.text" /> <Mfm :text="announcement.text" />
@ -76,6 +81,10 @@ definePageMetadata({
margin-bottom: var(--margin); margin-bottom: var(--margin);
} }
> ._title {
padding: 14px 32px !important;
}
> ._content { > ._content {
> img { > img {
display: block; display: block;