From 39f3a191890393a01fd03d1c5217f23edfb4d888 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 8 Feb 2021 21:15:10 -0600 Subject: [PATCH] Server: Handle optional comment publish date --- templates/admin/comment_box.rs.html | 8 +++++--- templates/comments/profile_box.rs.html | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/admin/comment_box.rs.html b/templates/admin/comment_box.rs.html index 156c112..c932354 100644 --- a/templates/admin/comment_box.rs.html +++ b/templates/admin/comment_box.rs.html @@ -27,9 +27,11 @@ @view.profile.full_handle() }) -
- @:ago(loader, comment.published()) -
+ @if let Some(date) = comment.published() { +
+ @:ago(loader, date) +
+ } diff --git a/templates/comments/profile_box.rs.html b/templates/comments/profile_box.rs.html index b297002..236e05e 100644 --- a/templates/comments/profile_box.rs.html +++ b/templates/comments/profile_box.rs.html @@ -8,7 +8,7 @@ @use hyaenidae_toolkit::{templates::icon, Size}; @use i18n_embed_fl::fl; -@(loader: &ActixLoader, view: &OwnedProfileView, published: DateTime, parent: &CommentNode, cache: &Cache, dark: bool, meta: Content, body: Content) +@(loader: &ActixLoader, view: &OwnedProfileView, published: Option>, parent: &CommentNode, cache: &Cache, dark: bool, meta: Content, body: Content)
@:icon(&view.icon(loader).size(Size::Small).dark(dark)) @@ -28,9 +28,11 @@ @view.profile.full_handle() })
-
- @:ago(loader, published) -
+ @if let Some(date) = published { +
+ @:ago(loader, date) +
+ }
@if let Some(l) = parent.view_link(cache) {