mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 13:01:08 +00:00
Adds counts of blocked and federated instances
This commit is contained in:
parent
991461221d
commit
f4aa202292
2 changed files with 8 additions and 2 deletions
|
@ -16,11 +16,11 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% url 'settings-federation' status='federated' as url %}
|
{% url 'settings-federation' status='federated' as url %}
|
||||||
<li {% if request.path in url %}class="is-active" aria-current="page"{% endif %}>
|
<li {% if request.path in url %}class="is-active" aria-current="page"{% endif %}>
|
||||||
<a href="{{ url }}">{% trans "Federated" %}</a>
|
<a href="{{ url }}">{% trans "Federated" %} ({{ federated_count }})</a>
|
||||||
</li>
|
</li>
|
||||||
{% url 'settings-federation' status='blocked' as url %}
|
{% url 'settings-federation' status='blocked' as url %}
|
||||||
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
|
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
|
||||||
<a href="{{ url }}">{% trans "Blocked" %}</a>
|
<a href="{{ url }}">{% trans "Blocked" %} ({{ blocked_count }})</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,6 +37,12 @@ class Federation(View):
|
||||||
page = paginated.get_page(request.GET.get("page"))
|
page = paginated.get_page(request.GET.get("page"))
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
"federated_count": models.FederatedServer.objects.filter(
|
||||||
|
status="federated"
|
||||||
|
).count(),
|
||||||
|
"blocked_count": models.FederatedServer.objects.filter(
|
||||||
|
status="blocked"
|
||||||
|
).count(),
|
||||||
"servers": page,
|
"servers": page,
|
||||||
"page_range": paginated.get_elided_page_range(
|
"page_range": paginated.get_elided_page_range(
|
||||||
page.number, on_each_side=2, on_ends=1
|
page.number, on_each_side=2, on_ends=1
|
||||||
|
|
Loading…
Reference in a new issue