1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-12-04 19:11:09 +00:00

Add message about new article approval

This commit is contained in:
Felix Ableitner 2024-11-25 12:17:09 +01:00
parent 1f7baddc29
commit 3ed0df90a1
2 changed files with 21 additions and 3 deletions

View file

@ -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},

View file

@ -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! {
<h1 class="text-4xl font-bold font-serif my-4">Create new Article</h1>
<Suspense>
<Show when=move || show_approval_message.get()>
<div class="alert alert-warning mb-4">
New articles require admin approval before being published
</div>
</Show>
</Suspense>
<Show
when=move || create_response.get().is_some()
fallback=move || {