fix: forum signatures
This commit is contained in:
parent
9ec52abfe4
commit
3738a5cd1f
5 changed files with 11 additions and 4 deletions
|
@ -134,7 +134,12 @@
|
||||||
("placeholder" "content")
|
("placeholder" "content")
|
||||||
("minlength" "2")
|
("minlength" "2")
|
||||||
("maxlength" "4096")
|
("maxlength" "4096")
|
||||||
(text "{% if draft -%}{{ draft.content }}{%- endif %}")))
|
(text "{% if draft -%}{{ draft.content }}{%- endif %}")
|
||||||
|
(text "{%- if use_signature %}")
|
||||||
|
(text "
|
||||||
|
|
||||||
|
{{ user.settings.forum_signature }}")
|
||||||
|
(text "{%- endif %}")))
|
||||||
(div
|
(div
|
||||||
("id" "files_list")
|
("id" "files_list")
|
||||||
("class" "flex gap_2 flex_wrap"))
|
("class" "flex gap_2 flex_wrap"))
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
(div
|
(div
|
||||||
("class" "flex gap_2")
|
("class" "flex gap_2")
|
||||||
(a
|
(a
|
||||||
("href" "/communities/intents/post?community={{ community.id }}&topic={{ topic_id }}")
|
("href" "/communities/intents/post?community={{ community.id }}&topic={{ topic_id }}&sig=true")
|
||||||
("class" "button small lowered")
|
("class" "button small lowered")
|
||||||
("data-turbo" "false")
|
("data-turbo" "false")
|
||||||
(icon (text "plus"))
|
(icon (text "plus"))
|
||||||
|
|
|
@ -1954,7 +1954,7 @@
|
||||||
\"textarea\",
|
\"textarea\",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[\"forum_signature\", \"Forum signature (coming soon)\"],
|
[\"forum_signature\", \"Forum signature\"],
|
||||||
settings.forum_signature,
|
settings.forum_signature,
|
||||||
\"textarea\",
|
\"textarea\",
|
||||||
],
|
],
|
||||||
|
|
|
@ -12,7 +12,6 @@ use tetratto_core::model::{
|
||||||
permissions::FinePermission,
|
permissions::FinePermission,
|
||||||
ApiReturn, Error,
|
ApiReturn, Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
get_user_from_token,
|
get_user_from_token,
|
||||||
routes::api::v1::{
|
routes::api::v1::{
|
||||||
|
|
|
@ -266,6 +266,8 @@ pub struct CreatePostProps {
|
||||||
pub from_draft: usize,
|
pub from_draft: usize,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub quote: usize,
|
pub quote: usize,
|
||||||
|
#[serde(default, alias = "sig")]
|
||||||
|
pub use_signature: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `/communities/intents/post`
|
/// `/communities/intents/post`
|
||||||
|
@ -359,6 +361,7 @@ pub async fn create_post_request(
|
||||||
context.insert("communities", &communities);
|
context.insert("communities", &communities);
|
||||||
context.insert("selected_stack", &props.stack);
|
context.insert("selected_stack", &props.stack);
|
||||||
context.insert("selected_community", &props.community);
|
context.insert("selected_community", &props.community);
|
||||||
|
context.insert("use_signature", &props.use_signature);
|
||||||
|
|
||||||
// return
|
// return
|
||||||
Ok(Html(
|
Ok(Html(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue