mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
small messup dealing with unauthenticated users
This commit is contained in:
parent
8892e8922b
commit
62a5521391
2 changed files with 12 additions and 6 deletions
|
@ -3,8 +3,12 @@
|
||||||
disable_voting: Disable voting buttons (to prevent mass downvoting)
|
disable_voting: Disable voting buttons (to prevent mass downvoting)
|
||||||
no_collapse: Don't collapse for admin and moderator views
|
no_collapse: Don't collapse for admin and moderator views
|
||||||
#}
|
#}
|
||||||
{% set collapsed = (post_reply.score <= current_user.reply_collapse_threshold)
|
{% if current_user.is_authenticated -%}
|
||||||
and not no_collapse -%}
|
{% 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 -%}
|
||||||
<div class="container comment{% if post_reply.score <= -10 %} low_score{% endif %}" id="comment_{{ post_reply.id }}">
|
<div class="container comment{% if post_reply.score <= -10 %} low_score{% endif %}" id="comment_{{ post_reply.id }}">
|
||||||
{% if not post_reply.author.indexable -%}<!--googleoff: all-->{% endif -%}
|
{% if not post_reply.author.indexable -%}<!--googleoff: all-->{% endif -%}
|
||||||
{% if teaser -%}
|
{% if teaser -%}
|
||||||
|
@ -63,9 +67,11 @@
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto ms-auto">
|
<div class="col-auto ms-auto">
|
||||||
{% with comment=dict(comment=post_reply) -%}
|
{% if current_user.is_authenticated -%}
|
||||||
{% include "post/_reply_notification_toggle.html" -%}
|
{% with comment=dict(comment=post_reply) -%}
|
||||||
{% endwith -%}
|
{% include "post/_reply_notification_toggle.html" -%}
|
||||||
|
{% endwith -%}
|
||||||
|
{% endif -%}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<a href="{{ url_for('post.post_reply_options', post_id=post_reply.post.id, comment_id=post_reply.id) }}" class="" rel="nofollow noindex" aria-label="{{ _('Comment options') }}"><span class="fe fe-options" title="Options"> </span></a>
|
<a href="{{ url_for('post.post_reply_options', post_id=post_reply.post.id, comment_id=post_reply.id) }}" class="" rel="nofollow noindex" aria-label="{{ _('Comment options') }}"><span class="fe fe-options" title="Options"> </span></a>
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<h2 class="mt-4" id="comments">Comments</h2>
|
<h2 class="mt-4" id="comments">Comments</h2>
|
||||||
<div class="post_list">
|
<div class="post_list">
|
||||||
{% for post_reply in post_replies.items %}
|
{% for post_reply in post_replies.items %}
|
||||||
{% with teaser=True, disable_voting=(current_user.id != post_reply.author.id) %}
|
{% with teaser=True, disable_voting=not current_user.is_authenticated or (current_user.id != post_reply.author.id) %}
|
||||||
{% include 'post/_post_reply_teaser.html' %}
|
{% include 'post/_post_reply_teaser.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<hr />
|
<hr />
|
||||||
|
|
Loading…
Add table
Reference in a new issue