Show clarifying text for empty search when logged out

This commit is contained in:
Mouse Reeve 2021-04-29 13:21:35 -07:00
parent f4ebecfe75
commit 6f38ab167e
2 changed files with 9 additions and 4 deletions

View file

@ -14,7 +14,12 @@
<h2 class="title is-4">{% trans "Matching Books" %}</h2>
<section class="block">
{% if not local_results.results %}
<p>{% blocktrans %}No books found for "{{ query }}"{% endblocktrans %}</p>
<p><em>{% blocktrans %}No books found for "{{ query }}"{% endblocktrans %}</em></p>
{% if not user.is_authenticated %}
<p>
<a href="{% url 'login' %}">{% trans "Log in to import or add books." %}</a>
</p>
{% endif %}
{% else %}
<ul>
{% for result in local_results.results %}
@ -88,7 +93,7 @@
</div>
<div class="column">
{% if request.user.is_authenticated %}
<section class="block">
<section class="box">
<h2 class="title is-4">{% trans "Matching Users" %}</h2>
{% if not user_results %}
<p><em>{% blocktrans %}No users found for "{{ query }}"{% endblocktrans %}</em></p>
@ -106,7 +111,7 @@
</ul>
</section>
{% endif %}
<section class="block">
<section class="box">
<h2 class="title is-4">{% trans "Lists" %}</h2>
{% if not list_results %}
<p><em>{% blocktrans %}No lists found for "{{ query }}"{% endblocktrans %}</em></p>

View file

@ -43,7 +43,7 @@ urlpatterns = [
re_path("^api/updates/notifications/?$", views.get_notification_count),
re_path("^api/updates/stream/(?P<stream>[a-z]+)/?$", views.get_unread_status_count),
# authentication
re_path(r"^login/?$", views.Login.as_view()),
re_path(r"^login/?$", views.Login.as_view(), name="login"),
re_path(r"^register/?$", views.Register.as_view()),
re_path(r"^logout/?$", views.Logout.as_view()),
re_path(r"^password-reset/?$", views.PasswordResetRequest.as_view()),