diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-24 11:18:32 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-24 11:19:44 +0100 |
commit | aa762e4686b913e820b271c3424cee38717db6ae (patch) | |
tree | 1eff527ee22677fbf946e59e3820e61b42e97c6e /src/routes/posts.rs | |
parent | d2307ac8c95d3e8cd4a21f7fd8ead8d5ae43c27a (diff) |
Style submission part of poststyle
This patch adds a bit of style to the submission part of the post.
It therefore adds some more css classes in the HTML-generating code plus
some style tweaks in the CSS.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Tested-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/routes/posts.rs')
-rw-r--r-- | src/routes/posts.rs | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 7ad0385..398fa30 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -145,34 +145,38 @@ async fn page_post_inner( } } </div> - <p> - {lang.tr("submitted", None)} - {" "}<TimeAgo since={chrono::DateTime::parse_from_rfc3339(&post.as_ref().created)?} lang={&lang} /> - {" "}{lang.tr("by", None)}{" "}<UserLink user={post.as_ref().author.as_ref()} /> - {" "}{lang.tr("to", None)}{" "}<CommunityLink community={&post.as_ref().community} /> - </p> - { - match &post.as_ref().href { - None => None, - Some(href) => { + <div class={"submission"}> + <p class={"submissionSource"}> + {lang.tr("submitted", None)} + {" "}<TimeAgo since={chrono::DateTime::parse_from_rfc3339(&post.as_ref().created)?} lang={&lang} /> + {" "}{lang.tr("by", None)}{" "}<UserLink user={post.as_ref().author.as_ref()} /> + {" "}{lang.tr("to", None)}{" "}<CommunityLink community={&post.as_ref().community} /> + </p> + { + match &post.as_ref().href { + None => None, + Some(href) => { + Some(render::rsx! { + <p><a href={href.as_ref()}>{href.as_ref()}</a></p> + }) + } + } + } + <div class={"submissionContent"}> + <Content src={&post} /> + </div> + { + if author_is_me(&post.as_ref().author, &base_data.login) || (post.local && base_data.is_site_admin()) { Some(render::rsx! { - <p><a href={href.as_ref()}>{href.as_ref()}</a></p> + <p class={"submissionDelete"}> + <a href={format!("/posts/{}/delete", post_id)}>{lang.tr("delete", None)}</a> + </p> }) + } else { + None } } - } - <Content src={&post} /> - { - if author_is_me(&post.as_ref().author, &base_data.login) || (post.local && base_data.is_site_admin()) { - Some(render::rsx! { - <p> - <a href={format!("/posts/{}/delete", post_id)}>{lang.tr("delete", None)}</a> - </p> - }) - } else { - None - } - } + </div> <div> <h2>{lang.tr("comments", None)}</h2> { |