From aa762e4686b913e820b271c3424cee38717db6ae Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 24 Dec 2020 11:18:32 +0100 Subject: Style submission part of post 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 Tested-by: Matthias Beyer --- res/main.css | 19 +++++++++++++++++++ src/routes/posts.rs | 52 ++++++++++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/res/main.css b/res/main.css index 9bf4562..91b67c6 100644 --- a/res/main.css +++ b/res/main.css @@ -135,6 +135,25 @@ textarea { height: 7em; } +.submission { + background-color: aliceblue; + padding-bottom: 0.5em; +} + +.submission .submissionSource { + background-color: #81D4FA; + padding-top: 0.5em; + padding-bottom: 0.5em; +} + +.submission .submissionContent { + margin-left: 0.5em; +} + +.submission .submissionDelete { + margin-left: 0.5em; +} + @media (max-width: 768px) { .communitySidebar { display: none; /* TODO still show this somewhere */ 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( } } -

- {lang.tr("submitted", None)} - {" "} - {" "}{lang.tr("by", None)}{" "} - {" "}{lang.tr("to", None)}{" "} -

- { - match &post.as_ref().href { - None => None, - Some(href) => { +
+

+ {lang.tr("submitted", None)} + {" "} + {" "}{lang.tr("by", None)}{" "} + {" "}{lang.tr("to", None)}{" "} +

+ { + match &post.as_ref().href { + None => None, + Some(href) => { + Some(render::rsx! { +

{href.as_ref()}

+ }) + } + } + } +
+ +
+ { + if author_is_me(&post.as_ref().author, &base_data.login) || (post.local && base_data.is_site_admin()) { Some(render::rsx! { -

{href.as_ref()}

+

+ {lang.tr("delete", None)} +

}) + } else { + None } } - } - - { - if author_is_me(&post.as_ref().author, &base_data.login) || (post.local && base_data.is_site_admin()) { - Some(render::rsx! { -

- {lang.tr("delete", None)} -

- }) - } else { - None - } - } +

{lang.tr("comments", None)}

{ -- cgit v1.2.3