diff --git a/src/frontend/app.rs b/src/frontend/app.rs index f9f5302..c38d2b1 100644 --- a/src/frontend/app.rs +++ b/src/frontend/app.rs @@ -6,8 +6,12 @@ use crate::{ dark_mode::DarkMode, pages::{ article::{ - actions::ArticleActions, create::CreateArticle, edit::EditArticle, - history::ArticleHistory, list::ListArticles, read::ReadArticle, + actions::ArticleActions, + create::CreateArticle, + edit::EditArticle, + history::ArticleHistory, + list::ListArticles, + read::ReadArticle, }, diff::EditDiff, instance::{details::InstanceDetails, list::ListInstances}, diff --git a/src/frontend/pages/article/create.rs b/src/frontend/pages/article/create.rs index 896e849..98730a9 100644 --- a/src/frontend/pages/article/create.rs +++ b/src/frontend/pages/article/create.rs @@ -1,6 +1,10 @@ use crate::{ common::CreateArticleForm, - frontend::{api::CLIENT, components::editor::EditorView}, + frontend::{ + api::CLIENT, + app::{is_admin, site, DefaultResource}, + components::editor::EditorView, + }, }; use leptos::{html::Textarea, prelude::*}; use leptos_router::components::Redirect; @@ -47,9 +51,19 @@ pub fn CreateArticle() -> impl IntoView { } } }); + let show_approval_message = Signal::derive(move || { + site().with_default(|site| site.config.article_approval) && !is_admin() + }); view! {