2021-05-01 01:35:09 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
|
|
|
|
{% block title %}{% trans "Search" %}{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="block">
|
|
|
|
<h1 class="title">
|
|
|
|
{% blocktrans %}Search{% endblocktrans %}
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
|
2021-05-01 01:59:02 +00:00
|
|
|
<form class="block" action="{% url 'search' %}" method="GET">
|
2021-05-01 01:35:09 +00:00
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
2021-05-01 01:59:02 +00:00
|
|
|
<input type="input" class="input" name="q" value="{{ query }}">
|
2021-05-01 01:35:09 +00:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<div class="select">
|
2021-05-01 01:59:02 +00:00
|
|
|
<select name="type">
|
2021-05-01 01:35:09 +00:00
|
|
|
<option value="book" {% if type == "book" %}selected{% endif %}>{% trans "Books" %}</option>
|
|
|
|
<option value="user" {% if type == "user" %}selected{% endif %}>{% trans "Users" %}</option>
|
|
|
|
<option value="list" {% if type == "list" %}selected{% endif %}>{% trans "Lists" %}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary">
|
|
|
|
<span>Search</span>
|
|
|
|
<span class="icon icon-search" aria-hidden="true"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
2021-05-01 02:19:10 +00:00
|
|
|
{% if query %}
|
2021-05-01 01:35:09 +00:00
|
|
|
<nav class="tabs">
|
|
|
|
<ul>
|
2021-05-01 01:59:02 +00:00
|
|
|
<li{% if type == "book" %} class="is-active"{% endif %}>
|
|
|
|
<a href="{% url 'search' %}?q={{ query }}&type=book">{% trans "Books" %}</a>
|
2021-05-01 01:35:09 +00:00
|
|
|
</li>
|
2021-05-01 02:56:29 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2021-05-01 01:59:02 +00:00
|
|
|
<li{% if type == "user" %} class="is-active"{% endif %}>
|
|
|
|
<a href="{% url 'search' %}?q={{ query }}&type=user">{% trans "Users" %}</a>
|
2021-05-01 01:35:09 +00:00
|
|
|
</li>
|
2021-05-01 02:56:29 +00:00
|
|
|
{% endif %}
|
2021-05-01 01:59:02 +00:00
|
|
|
<li{% if type == "list" %} class="is-active"{% endif %}>
|
|
|
|
<a href="{% url 'search' %}?q={{ query }}&type=list">{% trans "Lists" %}</a>
|
2021-05-01 01:35:09 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
|
2021-05-01 01:59:02 +00:00
|
|
|
<section class="block">
|
|
|
|
{% if not results %}
|
|
|
|
<p>
|
|
|
|
<em>{% blocktrans %}No results found for "{{ query }}"{% endblocktrans %}</em>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2021-05-01 02:56:29 +00:00
|
|
|
{% block panel %}
|
|
|
|
{% endblock %}
|
2021-05-01 01:59:02 +00:00
|
|
|
</section>
|
2021-05-01 02:19:10 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-05-01 01:35:09 +00:00
|
|
|
{% endblock %}
|