mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +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>
|
||||
{% url 'settings-federation' status='federated' as url %}
|
||||
<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>
|
||||
{% url 'settings-federation' status='blocked' as url %}
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -37,6 +37,12 @@ class Federation(View):
|
|||
page = paginated.get_page(request.GET.get("page"))
|
||||
|
||||
data = {
|
||||
"federated_count": models.FederatedServer.objects.filter(
|
||||
status="federated"
|
||||
).count(),
|
||||
"blocked_count": models.FederatedServer.objects.filter(
|
||||
status="blocked"
|
||||
).count(),
|
||||
"servers": page,
|
||||
"page_range": paginated.get_elided_page_range(
|
||||
page.number, on_each_side=2, on_ends=1
|
||||
|
|
Loading…
Reference in a new issue