diff --git a/.gitignore b/.gitignore index ec649c25..465ad7d8 100644 --- a/.gitignore +++ b/.gitignore @@ -159,7 +159,6 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ -app/static/*.css.map /app/static/media/ celery_worker.py diff --git a/app/static/styles.css b/app/static/styles.css index 2d407725..dd28dba6 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -765,19 +765,15 @@ div.navbar { bottom: -12px; left: 10px; } -.post_list .post_teaser .main_row .post_utilities a { +.post_list .post_teaser .main_row .post_utilities a, .post_list .post_teaser .main_row .post_utilities > div, .post_list .post_teaser .main_row .post_utilities > span { display: inline-block; min-width: 44px; line-height: 44px; text-align: center; } -.post_list .post_teaser .main_row .post_utilities a:first-child { +.post_list .post_teaser .main_row .post_utilities a:first-child, .post_list .post_teaser .main_row .post_utilities > div:first-child, .post_list .post_teaser .main_row .post_utilities > span:first-child { text-align: left; } -.post_list .post_teaser .main_row .post_options { - position: absolute; - bottom: -1px; -} .post_list .post_teaser .utilities_row a { display: inline-block; min-width: 44px; @@ -785,9 +781,6 @@ div.navbar { justify-content: center; align-content: center; } -.post_list .post_teaser .utilities_row .preview_image, .post_list .post_teaser .utilities_row .post_options { - text-align: center; -} .post_list .post_teaser .thumbnail { float: right; padding-left: 0; @@ -1070,9 +1063,7 @@ div.navbar { } .voting_buttons_new .upvote_button, .voting_buttons_new .downvote_button { display: inline-block; - padding: 5px 0 5px 3px; text-align: center; - position: relative; cursor: pointer; color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1)); min-width: 44px; @@ -1095,16 +1086,10 @@ div.navbar { color: darkred; font-weight: bold; } -.voting_buttons_new .upvote_button { - top: 1px; -} .voting_buttons_new .upvote_button .htmx-indicator { left: 13px; top: 7px; } -.voting_buttons_new .downvote_button { - top: 1px; -} .voting_buttons_new .downvote_button .htmx-indicator { left: 12px; top: 5px; @@ -1238,12 +1223,16 @@ div.navbar { border-radius: 50%; vertical-align: middle; } -.comment .comment_author a.unhide { +.comment .comment_community { + display: inline-block; +} +.comment .comment_community img { + height: 1rem; + width: auto; +} +.comment a.unhide { display: none; text-decoration: none; - padding: 5px 15px; - position: relative; - top: 3px; } .comment .comment_actions { margin-top: -10px; @@ -1259,7 +1248,10 @@ div.navbar { .comment .comment_actions .hide_button a { padding: 5px 15px; } -.comment .comment_actions .notif_toggle { +.comment .comment_actions .notify_toggle { + display: inline-block; +} +.comment .comment_actions .notify_toggle a { text-decoration: none; font-size: 87%; padding: 5px 15px; @@ -1711,7 +1703,7 @@ form h5 { text-decoration: none; } -.notif_toggle { +.notify_toggle { display: block; position: absolute; top: 2px; diff --git a/app/static/styles.scss b/app/static/styles.scss index 4c6b1b19..bec3c443 100644 --- a/app/static/styles.scss +++ b/app/static/styles.scss @@ -356,7 +356,7 @@ div.navbar { position: absolute; bottom: -12px; left: 10px; - a { + a, > div, > span { display: inline-block; min-width: 44px; line-height: 44px; @@ -367,11 +367,6 @@ div.navbar { } } } - - .post_options { - position: absolute; - bottom: -1px; - } } .utilities_row { @@ -382,9 +377,6 @@ div.navbar { justify-content: center; align-content: center; } - .preview_image, .post_options { - text-align: center; - } } .thumbnail { @@ -710,9 +702,7 @@ div.navbar { .upvote_button, .downvote_button { display: inline-block; - padding: 5px 0 5px 3px; text-align: center; - position: relative; cursor: pointer; color: rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1)); min-width: $min-touch-target; @@ -741,8 +731,6 @@ div.navbar { } .upvote_button { - top: 1px; - .htmx-indicator { left: 13px; top: 7px; @@ -750,7 +738,6 @@ div.navbar { } .downvote_button { - top: 1px; .htmx-indicator { left: 12px; top: 5px; @@ -900,16 +887,21 @@ div.navbar { border-radius: 50%; vertical-align: middle; } + } - a.unhide { - display: none; - text-decoration: none; - padding: 5px 15px; - position: relative; - top: 3px; + .comment_community { + display: inline-block; + img { + height: 1rem; + width: auto; } } + a.unhide { + display: none; + text-decoration: none; + } + .comment_actions { margin-top: -10px; position: relative; @@ -926,10 +918,13 @@ div.navbar { } } - .notif_toggle { - text-decoration: none; - font-size: 87%; - padding: 5px 15px; + .notify_toggle { + display: inline-block; + a { + text-decoration: none; + font-size: 87%; + padding: 5px 15px; + } } } @@ -1416,7 +1411,7 @@ form { text-decoration: none; } -.notif_toggle { +.notify_toggle { display: block; position: absolute; top: 2px; diff --git a/app/templates/admin/deleted_posts.html b/app/templates/admin/deleted_posts.html index 1ad63f32..420ef09e 100644 --- a/app/templates/admin/deleted_posts.html +++ b/app/templates/admin/deleted_posts.html @@ -21,7 +21,10 @@

Deleted comments

{% for post_reply in post_replies.items %} - {% include 'post/_post_reply_teaser.html' %} + {% with teaser=True, disable_voting=True, no_collapse=True %} + {% include 'post/_post_reply_teaser.html' %} + {% endwith %} +
{% else %}

{{ _('No deleted comments.') }}

{% endfor %} @@ -38,4 +41,4 @@

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/admin/spam_posts.html b/app/templates/admin/spam_posts.html index 6124d164..8c3c98eb 100644 --- a/app/templates/admin/spam_posts.html +++ b/app/templates/admin/spam_posts.html @@ -19,7 +19,10 @@

Downvoted comments

{% for post_reply in post_replies.items %} - {% include 'post/_post_reply_teaser.html' %} + {% with teaser=True, disable_voting=True, no_collapse=True %} + {% include 'post/_post_reply_teaser.html' %} + {% endwith %} +
{% endfor %}
{% else %} @@ -34,4 +37,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/post/_post_reply_teaser.html b/app/templates/post/_post_reply_teaser.html index 1913fb0a..b1466542 100644 --- a/app/templates/post/_post_reply_teaser.html +++ b/app/templates/post/_post_reply_teaser.html @@ -1,5 +1,89 @@ -
- {{ post_reply.body_html|safe }} -

{{ _('View context') }}

+{# Options: + teaser: Renders just a teaser + disable_voting: Disable voting buttons (to prevent mass downvoting) + no_collapse: Don't collapse for admin and moderator views +#} +{% if current_user.is_authenticated -%} + {% set collapsed = (post_reply.score <= current_user.reply_collapse_threshold) + and not no_collapse -%} +{% else -%} + {% set collapsed = (post_reply.score <= -10) and not no_collapse -%} +{% endif -%} +
+ {% if not post_reply.author.indexable -%}{% endif -%} + {% if teaser -%} +
+
+ reply to: {{ post_reply.post.title | truncate(80, True) }} + in {{ render_communityname(post_reply.post.community) }} +
+
+ {% endif -%} +
+
+ by + {{ render_username(post_reply.author) }} + {% if post_reply.author.id == post_reply.post.author.id -%} + [OP] + {% endif -%} +
+
+ {{ moment(post_reply.posted_at).fromNow(refresh=True) }} + {% if post_reply.edited_at -%}, edited {{ moment(post_reply.edited_at).fromNow(refresh=True) }} {% endif -%} +
+
+ {% if post_reply.reports and current_user.is_authenticated and post_reply.post.community.is_moderator(current_user) -%} + + {% endif -%} +
+
+ +
+
+ +
+
+ {{ post_reply.body_html | community_links | safe }} +
+
+
+
+ {% if post_reply.post.comments_enabled -%} + reply + {% endif -%} +
+
+ {% if not disable_voting -%} + {% with comment=post_reply, community=post_reply.post.community -%} + {% include "post/_comment_voting_buttons.html" -%} + {% endwith -%} + {% endif -%} +
+
+ {% if collapsed -%} + + {% else -%} + + {% endif -%} +
+
+ {% if current_user.is_authenticated -%} + {% with comment=dict(comment=post_reply) -%} + {% include "post/_reply_notification_toggle.html" -%} + {% endwith -%} + {% endif -%} +
+
+ +
+
+ {% if not post_reply.author.indexable -%}{% endif -%} + {% if collapsed -%} + + {% endif -%}
-
\ No newline at end of file diff --git a/app/templates/post/_post_teaser.html b/app/templates/post/_post_teaser.html index efb759d4..601c6de1 100644 --- a/app/templates/post/_post_teaser.html +++ b/app/templates/post/_post_teaser.html @@ -84,7 +84,7 @@ {% endif -%} {% endif -%} - +
diff --git a/app/templates/post/_reply_notification_toggle.html b/app/templates/post/_reply_notification_toggle.html index 4a47771f..c1cbc2ea 100644 --- a/app/templates/post/_reply_notification_toggle.html +++ b/app/templates/post/_reply_notification_toggle.html @@ -1,4 +1,4 @@ \ No newline at end of file +title="{{ _('Notify about replies') }}" aria-label="{{ _('Notify about replies') }}"> diff --git a/app/templates/post/continue_discussion.html b/app/templates/post/continue_discussion.html index 7abe23d6..102132ea 100644 --- a/app/templates/post/continue_discussion.html +++ b/app/templates/post/continue_discussion.html @@ -46,9 +46,11 @@ {% endif %} - {% if current_user.is_authenticated and current_user.verified and current_user.id == comment['comment'].author.id %} - {% include "post/_reply_notification_toggle.html" %} - {% endif %} +
+ {% if current_user.is_authenticated and current_user.verified and current_user.id == comment['comment'].author.id %} + {% include "post/_reply_notification_toggle.html" %} + {% endif %} +
{% if comment['replies'] %} diff --git a/app/templates/post/post.html b/app/templates/post/post.html index 252ad54b..95976b6c 100644 --- a/app/templates/post/post.html +++ b/app/templates/post/post.html @@ -107,9 +107,11 @@ {% endif -%} - {% if current_user.is_authenticated and current_user.verified -%} - {% include "post/_reply_notification_toggle.html" -%} - {% endif -%} +
+ {% if current_user.is_authenticated and current_user.verified -%} + {% include "post/_reply_notification_toggle.html" -%} + {% endif -%} +
{% if comment['replies'] -%} diff --git a/app/templates/user/bookmarks_comments.html b/app/templates/user/bookmarks_comments.html index 7f488fd9..031e5de0 100644 --- a/app/templates/user/bookmarks_comments.html +++ b/app/templates/user/bookmarks_comments.html @@ -20,7 +20,10 @@
{% for post_reply in post_replies.items %} - {% include 'post/_post_reply_teaser.html' %} + {% with teaser=True %} + {% include 'post/_post_reply_teaser.html' %} + {% endwith %} +
{% else -%}

{{ _('No comments have been bookmarked. Use the three dots on each comment to find the bookmark function.') }}

{% endfor -%} diff --git a/app/templates/user/show_profile.html b/app/templates/user/show_profile.html index 7d9ec758..c1b3984c 100644 --- a/app/templates/user/show_profile.html +++ b/app/templates/user/show_profile.html @@ -122,7 +122,10 @@

Comments

{% for post_reply in post_replies.items %} - {% include 'post/_post_reply_teaser.html' %} + {% with teaser=True, disable_voting=not current_user.is_authenticated or (current_user.id != post_reply.author.id) %} + {% include 'post/_post_reply_teaser.html' %} + {% endwith %} +
{% endfor %}