From da1441451d5cad51aed5148c89cd8219b34fb6c9 Mon Sep 17 00:00:00 2001 From: Colin Reeder Date: Fri, 31 Jul 2020 10:19:52 -0600 Subject: Add infoBox for non-approved posts --- src/resp_types.rs | 1 + src/routes/posts.rs | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/resp_types.rs b/src/resp_types.rs index d32e69b..b51b26c 100644 --- a/src/resp_types.rs +++ b/src/resp_types.rs @@ -110,6 +110,7 @@ pub struct RespPostInfo<'a> { pub content_text: Option>, pub content_html: Option>, + pub approved: bool, pub score: i64, #[serde(borrow)] pub comments: Vec>, diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 86a3134..2f26686 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -48,6 +48,13 @@ async fn page_post( Ok(html_response(render::html! { + { + if post.approved { + None + } else { + Some(render::rsx! {
{lang.tr("post_not_approved", None)}
}) + } + }

{title}

-- cgit v1.2.3