2023-10-23 17:22:21 +13:00
|
|
|
{% if current_user.is_authenticated and current_user.verified %}
|
2024-01-03 16:29:58 +13:00
|
|
|
{% if can_upvote(current_user, post.community) %}
|
2024-01-02 19:41:00 +13:00
|
|
|
<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">
|
|
|
|
<span class="fe fe-arrow-up"></span>
|
2024-01-10 09:44:59 +13:00
|
|
|
{{ shorten_number(post.up_votes) }}
|
2024-01-02 19:41:00 +13:00
|
|
|
<img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;">
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2024-01-03 16:29:58 +13:00
|
|
|
{% if can_downvote(current_user, post.community) %}
|
2024-01-02 19:41:00 +13:00
|
|
|
<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">
|
|
|
|
<span class="fe fe-arrow-down"></span>
|
2024-01-10 09:44:59 +13:00
|
|
|
{{ shorten_number(post.down_votes) }}
|
2024-01-02 19:41:00 +13:00
|
|
|
<img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;">
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-10-23 17:22:21 +13:00
|
|
|
{% else %}
|
|
|
|
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }}">
|
|
|
|
<span class="fe fe-arrow-up"></span>
|
2024-01-10 09:44:59 +13:00
|
|
|
{{ shorten_number(post.up_votes) }}
|
2023-10-23 17:22:21 +13:00
|
|
|
</div>
|
|
|
|
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }}">
|
|
|
|
<span class="fe fe-arrow-down"></span>
|
2024-01-10 09:44:59 +13:00
|
|
|
{{ shorten_number(post.down_votes) }}
|
2023-10-23 17:22:21 +13:00
|
|
|
</div>
|
|
|
|
{% endif %}
|