From 23985a3263ac83aab2f72e90ec98bfea4632a7fc Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 20 Aug 2020 15:45:39 +0200 Subject: [PATCH] Highlight targeted comment & add permalink --- articles/static/style.css | 8 +++++ .../templates/articles/article_detail.html | 32 +------------------ .../templates/articles/comment_snippet.html | 32 +++++++++++++++++++ 3 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 articles/templates/articles/comment_snippet.html diff --git a/articles/static/style.css b/articles/static/style.css index b4b5582..99f1819 100644 --- a/articles/static/style.css +++ b/articles/static/style.css @@ -229,6 +229,14 @@ textarea, input { color: var(--main3); } +.comment:target { + background-color: var(--warning-background); +} + +.permalink { + font-size: 80%; +} + /* MESSAGES */ .messages p { background-color: var(--background2); diff --git a/articles/templates/articles/article_detail.html b/articles/templates/articles/article_detail.html index caa74b9..18956d4 100644 --- a/articles/templates/articles/article_detail.html +++ b/articles/templates/articles/article_detail.html @@ -11,35 +11,5 @@ {{ article.get_formatted_content|safe }} -
-

Comments

- {% for comment in comments %} -
- -

- {{ comment.content|linebreaksbr }} -

-
- {% empty %} - No reaction yet, write your own! - {% endfor %} -
- {% csrf_token %} - - {{ form.as_table }} -
- -

- Your comment may not be approved if it's not respectful, on topic or spammy. - If you feel I've made a mistake with your comment, please - send me a message! -

-
-
+ {% include 'articles/comment_snippet.html' %} {% endblock %} diff --git a/articles/templates/articles/comment_snippet.html b/articles/templates/articles/comment_snippet.html new file mode 100644 index 0000000..2ac2681 --- /dev/null +++ b/articles/templates/articles/comment_snippet.html @@ -0,0 +1,32 @@ +
+

Comments

+ {% for comment in comments %} +
+ +

+ {{ comment.content|linebreaksbr }} +

+
+ {% empty %} + No reaction yet, write your own! + {% endfor %} +
+ {% csrf_token %} + + {{ form.as_table }} +
+ +

+ Your comment may not be approved if it's not respectful, on topic or spammy. + If you feel I've made a mistake with your comment, please + send me a message! +

+
+