Add draft with color
This commit is contained in:
parent
b8bd9d0607
commit
f7339b36e4
5 changed files with 21 additions and 2 deletions
|
@ -7,6 +7,7 @@ pub struct PostMetadata {
|
|||
pub date: String,
|
||||
pub description: String,
|
||||
pub project_link: String,
|
||||
pub draft: bool
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, Debug)]
|
||||
|
|
|
@ -73,6 +73,19 @@ pub fn PostElement() -> impl IntoView {
|
|||
view! {
|
||||
<>
|
||||
<Title href="/posts".to_string() title=post.metadata.title.clone()/>
|
||||
{
|
||||
if post.metadata.draft {
|
||||
Some(view!{
|
||||
<div class="bg-warning text-on_warning dark:bg-dark_warning dark:text-dart_on_warning rounded-md p-5">
|
||||
r#"
|
||||
L'article est en cours d'écriture. La formulation peut ne pas être exacte et les phrases peuvent contenir des fautes.
|
||||
"#
|
||||
</div>
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
<div inner_html={post.content.clone()}></div>
|
||||
</>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue