voting_buttons remove extra whitespace and make hiding the arrows consistent

This commit is contained in:
Hendrik L 2024-12-21 11:55:36 +01:00
parent 0b8251524c
commit 922a9103c8

View file

@ -7,19 +7,23 @@
</div> </div>
{% endif -%} {% endif -%}
<span title="{{ post.up_votes }}, {{ post.down_votes }}" aria-live="assertive" aria-label="{{ _('Score: ') }}{{ post.up_votes - post.down_votes }}.">{{ shorten_number(post.up_votes - post.down_votes) }}</span> <span title="{{ post.up_votes }}, {{ post.down_votes }}" aria-live="assertive" aria-label="{{ _('Score: ') }}{{ post.up_votes - post.down_votes }}.">{{ shorten_number(post.up_votes - post.down_votes) }}</span>
{% if can_downvote(current_user, post.community) and not disable_voting -%} {%- if can_downvote(current_user, post.community) and not disable_voting -%}
<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" <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"
hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_new" tabindex="0"> hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_new" tabindex="0">
<span class="fe fe-arrow-down"></span> <span class="fe fe-arrow-down"></span>
<img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;"> <img class="htmx-indicator" src="/static/images/spinner.svg" alt="" style="opacity: 0;">
</div> </div>
{% endif -%} {%- endif -%}
{% else -%} {% else -%}
{% if not disable_voting -%}
<div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }} redirect_login"> <div class="upvote_button digits_{{ digits(post.up_votes) }} {{ upvoted_class }} redirect_login">
<span class="fe fe-arrow-up"></span> <span class="fe fe-arrow-up"></span>
</div> </div>
{% endif -%}
<span title="{{ post.up_votes }}, {{ post.down_votes }}" aria-live="assertive" aria-label="{{ _('Score: ') }}{{ post.up_votes - post.down_votes }}.">{{ shorten_number(post.up_votes - post.down_votes) }}</span> <span title="{{ post.up_votes }}, {{ post.down_votes }}" aria-live="assertive" aria-label="{{ _('Score: ') }}{{ post.up_votes - post.down_votes }}.">{{ shorten_number(post.up_votes - post.down_votes) }}</span>
{%- if not disable_voting -%}
<div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }} redirect_login"> <div class="downvote_button digits_{{ digits(post.down_votes) }} {{ downvoted_class }} redirect_login">
<span class="fe fe-arrow-down"></span> <span class="fe fe-arrow-down"></span>
</div> </div>
{%- endif -%}
{% endif -%} {% endif -%}