forked from DGNum/gestiojeux
1850746975
Also give a coherent look to all inventory lists
39 lines
1.4 KiB
HTML
39 lines
1.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block "content" %}
|
|
<h1>Recherche</h1>
|
|
<form class="search" method="get" action=".">
|
|
{{ form.q }}
|
|
<button type="submit"><i class="fa fa-fw fa-search" aria-hidden="true"></i></button>
|
|
</form>
|
|
|
|
{% if query %}
|
|
<hr/>
|
|
|
|
<ul>
|
|
{% for result in page_obj.object_list %}
|
|
{% if result.model_name == "game" %}
|
|
{% include "./partials/game_item.html" with game=result.object %}
|
|
{% elif result.model_name == "category" %}
|
|
<li>
|
|
<a href="{{ result.object.get_absolute_url }}"><i class="fa fa-bookmark" aria-hidden="true"></i> {{ result.object.name }}</a>
|
|
</li>
|
|
{% elif result.model_name == "tag" %}
|
|
<li>
|
|
<a href="{{ result.object.get_absolute_url }}"><i class="fa fa-tag" aria-hidden="true"></i> {{ result.object.name }}</a>
|
|
</li>
|
|
{% endif %}
|
|
{% empty %}
|
|
<li>Aucun résultat trouvé</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{% if page_obj.has_previous or page_obj.has_next %}
|
|
<div>
|
|
{% if page_obj.has_previous %}<a href="?q={{ query }}&page={{ page_obj.previous_page_number }}">{% endif %}« Précédent{% if page_obj.has_previous %}</a>{% endif %}
|
|
|
|
|
{% if page_obj.has_next %}<a href="?q={{ query }}&page={{ page_obj.next_page_number }}">{% endif %}Suivant »{% if page_obj.has_next %}</a>{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|