Server: Handle optional comment publish date

This commit is contained in:
asonix 2021-02-08 21:15:10 -06:00
parent 22d8f85fba
commit 39f3a19189
2 changed files with 11 additions and 7 deletions

View file

@ -27,9 +27,11 @@
@view.profile.full_handle()
})
</div>
<div class="profile-box--meta--date">
@:ago(loader, comment.published())
</div>
@if let Some(date) = comment.published() {
<div class="profile-box--meta--date">
@:ago(loader, date)
</div>
}
</div>
</div>
</div>

View file

@ -8,7 +8,7 @@
@use hyaenidae_toolkit::{templates::icon, Size};
@use i18n_embed_fl::fl;
@(loader: &ActixLoader, view: &OwnedProfileView, published: DateTime<Utc>, parent: &CommentNode, cache: &Cache, dark: bool, meta: Content, body: Content)
@(loader: &ActixLoader, view: &OwnedProfileView, published: Option<DateTime<Utc>>, parent: &CommentNode, cache: &Cache, dark: bool, meta: Content, body: Content)
<div class="profile-box">
@:icon(&view.icon(loader).size(Size::Small).dark(dark))
@ -28,9 +28,11 @@
@view.profile.full_handle()
})
</div>
<div class="profile-box--meta--date">
@:ago(loader, published)
</div>
@if let Some(date) = published {
<div class="profile-box--meta--date">
@:ago(loader, date)
</div>
}
</div>
<div class="profile-box--replying-to">
@if let Some(l) = parent.view_link(cache) {