mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
27 lines
1.7 KiB
HTML
27 lines
1.7 KiB
HTML
{% if current_user.is_authenticated and current_user.verified %}
|
|
{% if can_upvote(current_user, post.community) %}
|
|
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}"
|
|
hx-post="/post/{{ post.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0">
|
|
<span class="fe fe-arrow-up"></span>
|
|
{{ shorten_number(post.up_votes) }}
|
|
<img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;">
|
|
</div>
|
|
{% endif %}
|
|
{% if can_downvote(current_user, post.community) %}
|
|
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}"
|
|
hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0">
|
|
<span class="fe fe-arrow-down"></span>
|
|
{{ shorten_number(post.down_votes) }}
|
|
<img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;">
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }}">
|
|
<span class="fe fe-arrow-up"></span>
|
|
{{ shorten_number(post.up_votes) }}
|
|
</div>
|
|
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }}">
|
|
<span class="fe fe-arrow-down"></span>
|
|
{{ shorten_number(post.down_votes) }}
|
|
</div>
|
|
{% endif %}
|