Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Martynas Sklizmantas 2024-02-26 08:55:34 +01:00
commit a0b6999486
10 changed files with 20 additions and 19 deletions

View file

@ -15,4 +15,4 @@ To build a federated discussion and link aggregation platform, similar to Reddit
- [Screencast: overview of the PieFed codebase](https://join.piefed.social/2024/01/22/an-introduction-to-the-piefed-codebase/) - [Screencast: overview of the PieFed codebase](https://join.piefed.social/2024/01/22/an-introduction-to-the-piefed-codebase/)
- [Database / entity relationship diagram](https://join.piefed.social/wp-content/uploads/2024/02/PieFed-entity-relationships.png) - [Database / entity relationship diagram](https://join.piefed.social/wp-content/uploads/2024/02/PieFed-entity-relationships.png)
- see INSTALL.md - see [INSTALL.md](INSTALL.md)

View file

@ -460,7 +460,7 @@ fieldset legend {
left: 0; left: 0;
background-color: #fff; background-color: #fff;
/* Background color to cover the link for screen readers */ /* Background color to cover the link for screen readers */
z-index: 999; z-index: 1030;
/* Ensure it's above other content */ /* Ensure it's above other content */
} }

View file

@ -54,7 +54,7 @@ html {
top: -40px; /* Adjust as needed to hide the link off-screen */ top: -40px; /* Adjust as needed to hide the link off-screen */
left: 0; left: 0;
background-color: #fff; /* Background color to cover the link for screen readers */ background-color: #fff; /* Background color to cover the link for screen readers */
z-index: 999; /* Ensure it's above other content */ z-index: 1030; /* Ensure it's above other content */
} }
.skip-link:focus { .skip-link:focus {

View file

@ -90,10 +90,10 @@
{% endif %}</td> {% endif %}</td>
{% if not low_bandwidth %} {% if not low_bandwidth %}
<td width="46"> <td width="46">
<a href="/c/{{ community.link() }}" aria-label="{{ _('View community') }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" /></a> <a href="/c/{{ community.link() }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" /></a>
</td> </td>
{% endif %} {% endif %}
<th scope="row" class="pl-0"><a href="/c/{{ community.link() }}" aria-label="{{ _('View community') }}">{{ community.display_name() }}</a></th> <th scope="row" class="pl-0"><a href="/c/{{ community.link() }}">{{ community.display_name() }}</a></th>
<td>{{ community.post_count }}</td> <td>{{ community.post_count }}</td>
<td>{{ community.post_reply_count }}</td> <td>{{ community.post_reply_count }}</td>
<td>{{ moment(community.last_active).fromNow(refresh=True) }}</td> <td>{{ moment(community.last_active).fromNow(refresh=True) }}</td>

View file

@ -1,14 +1,14 @@
{% if current_user.is_authenticated and current_user.verified %} {% if current_user.is_authenticated and current_user.verified %}
{% if can_upvote(current_user, community) %} {% if can_upvote(current_user, community) %}
<div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" <div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" aria-live="assertive"
hx-post="/comment/{{ comment.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_new" tabindex="0"> hx-post="/comment/{{ comment.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_new" tabindex="0">
<span class="fe fe-arrow-up"></span> <span class="fe fe-arrow-up"></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 %}
<span title="{{ comment.up_votes }}, {{ comment.down_votes }}">{{ comment.up_votes - comment.down_votes }}</span> <span title="{{ comment.up_votes }}, {{ comment.down_votes }}" aria-live="assertive">{{ comment.up_votes - comment.down_votes }}</span>
{% if can_downvote(current_user, community) %} {% if can_downvote(current_user, community) %}
<div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" <div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" aria-live="assertive"
hx-post="/comment/{{ comment.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_new" tabindex="0"> hx-post="/comment/{{ comment.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;">

View file

@ -1,6 +1,6 @@
{% if current_user.is_authenticated and current_user.verified %} {% if current_user.is_authenticated and current_user.verified %}
{% if can_upvote(current_user, post.community) %} {% if can_upvote(current_user, post.community) %}
<div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" <div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" aria-live="assertive"
hx-post="/post/{{ post.id }}/upvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0"> 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> <span class="fe fe-arrow-up"></span>
{{ shorten_number(post.up_votes) }} {{ shorten_number(post.up_votes) }}
@ -8,7 +8,7 @@
</div> </div>
{% endif %} {% endif %}
{% if can_downvote(current_user, post.community) %} {% if can_downvote(current_user, post.community) %}
<div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" <div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" aria-live="assertive"
hx-post="/post/{{ post.id }}/downvote" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons" tabindex="0"> 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> <span class="fe fe-arrow-down"></span>
{{ shorten_number(post.down_votes) }} {{ shorten_number(post.down_votes) }}

View file

@ -1,13 +1,13 @@
{% if current_user.is_authenticated and current_user.verified %} {% if current_user.is_authenticated and current_user.verified %}
{% if can_upvote(current_user, post.community) %} {% if can_upvote(current_user, post.community) %}
<div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" <div class="upvote_button {{ upvoted_class }}" role="button" aria-label="{{ _('UpVote') }}" aria-live="assertive"
hx-post="/post/{{ post.id }}/upvote?style=masonry" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_masonry" tabindex="0" title="{{ post.up_votes }} upvotes"> hx-post="/post/{{ post.id }}/upvote?style=masonry" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_masonry" tabindex="0" title="{{ post.up_votes }} upvotes">
<span class="fe fe-arrow-up"></span> <span class="fe fe-arrow-up"></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 %}
{% if can_downvote(current_user, post.community) %} {% if can_downvote(current_user, post.community) %}
<div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" <div class="downvote_button {{ downvoted_class }}" role="button" aria-label="{{ _('DownVote') }}" aria-live="assertive"
hx-post="/post/{{ post.id }}/downvote?style=masonry" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_masonry" tabindex="0" title="{{ post.down_votes }} downvotes"> hx-post="/post/{{ post.id }}/downvote?style=masonry" hx-trigger="click throttle:1s" hx-target="closest .voting_buttons_masonry" tabindex="0" title="{{ post.down_votes }} downvotes">
<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;">

View file

@ -13,7 +13,7 @@
<div class="row post_replies"> <div class="row post_replies">
<div class="col"> <div class="col">
{% macro render_comment(comment) %} {% macro render_comment(comment) %}
<div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].author.id == post.author.id %}original_poster{% endif %}"> <div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].author.id == post.author.id %}original_poster{% endif %}" role="treeitem">
<div class="limit_height"> <div class="limit_height">
<div class="comment_author"> <div class="comment_author">
{% if comment['comment'].author.deleted %} {% if comment['comment'].author.deleted %}
@ -70,7 +70,7 @@
<a href="{{ url_for('post.post_reply_options', post_id=post.id, comment_id=comment['comment'].id) }}" class="comment_actions_link" rel="nofollow"><span class="fe fe-options" title="Options"> </span></a> <a href="{{ url_for('post.post_reply_options', post_id=post.id, comment_id=comment['comment'].id) }}" class="comment_actions_link" rel="nofollow"><span class="fe fe-options" title="Options"> </span></a>
</div> </div>
{% if comment['replies'] %} {% if comment['replies'] %}
<div class="replies hidable"> <div class="replies hidable" role="group">
{% for reply in comment['replies'] %} {% for reply in comment['replies'] %}
{{ render_comment(reply) | safe }} {{ render_comment(reply) | safe }}
{% endfor %} {% endfor %}
@ -78,7 +78,7 @@
{% endif %} {% endif %}
</div> </div>
{% endmacro %} {% endmacro %}
<div id="replies" class="comments"> <div id="replies" class="comments" role="tree">
{% for reply in replies %} {% for reply in replies %}
{{ render_comment(reply) | safe }} {{ render_comment(reply) | safe }}
{% endfor %} {% endfor %}

View file

@ -66,7 +66,7 @@
</div> </div>
{% macro render_comment(comment) %} {% macro render_comment(comment) %}
<div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].score <= -10 %}low_score{% endif %} <div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].score <= -10 %}low_score{% endif %}
{% if comment['comment'].author.id == post.author.id %}original_poster{% endif %}"> {% if comment['comment'].author.id == post.author.id %}original_poster{% endif %}" aria-level="{{ comment['comment'].depth + 1 }}" role="treeitem">
<div class="limit_height"> <div class="limit_height">
<div class="comment_author"> <div class="comment_author">
{% if comment['comment'].author.deleted %} {% if comment['comment'].author.deleted %}
@ -124,7 +124,7 @@
</div> </div>
{% if comment['replies'] %} {% if comment['replies'] %}
{% if comment['comment'].depth <= THREAD_CUTOFF_DEPTH %} {% if comment['comment'].depth <= THREAD_CUTOFF_DEPTH %}
<div class="replies hidable"> <div class="replies hidable" role="group">
{% for reply in comment['replies'] %} {% for reply in comment['replies'] %}
{{ render_comment(reply) | safe }} {{ render_comment(reply) | safe }}
{% endfor %} {% endfor %}
@ -144,7 +144,7 @@
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
<div id="replies" class="comments"> <div id="replies" class="comments" role="tree" aria-label="{{ _('Comments') }}">
{% for reply in replies %} {% for reply in replies %}
{{ render_comment(reply) | safe }} {{ render_comment(reply) | safe }}
{% endfor %} {% endfor %}

View file

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
celery -A celery_worker.celery worker celery -A celery_worker.celery worker --autoscale=5,1