Fixes settings tab highlighting

This commit is contained in:
Mouse Reeve 2022-01-10 15:27:33 -08:00
parent c0b5e6ad78
commit dcf8a8dab9
3 changed files with 7 additions and 2 deletions

View file

@ -63,7 +63,7 @@
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "IP Address Blocklist" %}</a>
</li>
<li>
{% url 'settings-link-domain' status='pending' as url %}
{% url 'settings-link-domain' as url %}
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Link Domains" %}</a>
</li>
</ul>

View file

@ -158,6 +158,11 @@ urlpatterns = [
views.EmailBlocklist.as_view(),
name="settings-email-blocks-delete",
),
re_path(
r"^setting/link-domains/?$",
views.LinkDomain.as_view(),
name="settings-link-domain",
),
re_path(
r"^setting/link-domains/(?P<status>(pending|approved|blocked))/?$",
views.LinkDomain.as_view(),

View file

@ -17,7 +17,7 @@ from bookwyrm import forms, models
class LinkDomain(View):
"""Moderate links"""
def get(self, request, status):
def get(self, request, status="pending"):
"""view pending domains"""
data = {
"domains": models.LinkDomain.objects.filter(status=status).prefetch_related(