2024-05-30 21:54:25 +12:00
|
|
|
{% if current_user.is_authenticated and current_user.verified -%}
|
|
|
|
{% if can_upvote(current_user, post.community) -%}
|
2024-04-11 14:04:57 +12:00
|
|
|
<div class="upvote_button {{ 'voted_up' if in_sorted_list(recently_upvoted, post.id) }}" role="button" aria-label="{{ _('UpVote button, %(count)d upvotes so far.', count=post.up_votes) }}" aria-live="assertive"
|
2024-01-19 22:49:16 +13:00
|
|
|
hx-post="/post/{{ post.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0">
|
2024-01-02 19:41:00 +13:00
|
|
|
<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>
|
2024-05-30 21:54:25 +12:00
|
|
|
{% endif -%}
|
|
|
|
{% if can_downvote(current_user, post.community) -%}
|
2024-04-11 14:04:57 +12:00
|
|
|
<div class="downvote_button {{ 'voted_down' if in_sorted_list(recently_downvoted, post.id) }}" role="button" aria-label="{{ _('DownVote button, %(count)d downvotes so far.', count=post.down_votes) }}" aria-live="assertive"
|
2024-01-19 22:49:16 +13:00
|
|
|
hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0">
|
2024-01-02 19:41:00 +13:00
|
|
|
<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>
|
2024-05-30 21:54:25 +12:00
|
|
|
{% endif -%}
|
|
|
|
{% else -%}
|
2024-01-21 12:35:20 +13:00
|
|
|
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }} redirect_login">
|
2023-10-23 17:22:21 +13:00
|
|
|
<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>
|
2024-01-21 12:35:20 +13:00
|
|
|
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }} redirect_login">
|
2023-10-23 17:22:21 +13:00
|
|
|
<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>
|
2024-05-30 21:54:25 +12:00
|
|
|
{% endif -%}
|