pyfedi/app/templates/post/_post_voting_buttons.html

22 lines
972 B
HTML
Raw Normal View History

2023-10-23 17:22:21 +13:00
{% if current_user.is_authenticated and current_user.verified %}
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }}"
hx-post="/post/{{ post.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons">
2023-10-23 17:22:21 +13:00
<span class="fe fe-arrow-up"></span>
{{ post.up_votes }}
</div>
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }}"
hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons">
2023-10-23 17:22:21 +13:00
<span class="fe fe-arrow-down"></span>
{{ post.down_votes }}
</div>
{% else %}
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }}">
<span class="fe fe-arrow-up"></span>
{{ post.up_votes }}
</div>
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }}">
<span class="fe fe-arrow-down"></span>
{{ post.down_votes }}
</div>
{% endif %}