Files
fet2020/fet2020/templates/search/index.html

49 lines
2.1 KiB
HTML

{% extends 'base.html' %}
{% block title %}Suche{% endblock %}
{% block content %}
<!-- Main Content -->
<main class="container mx-auto w-full px-4 my-8 flex-1">
<h1 class="page-title">Suchergebnisse</h1>
<section>
<div class="w-full sticky px-4 py-4 md:py-8 -mt-4 md:-mt-8 top-0 z-10 bg-gray-100/80 dark:bg-gray-900/80 backdrop-blur">
<form class="flex gap-x-2 mx-auto max-w-prose">
<input
type="text"
id="id_q"
name="{{ form.q.name }}"
value="{{ form.q.value|default:'' }}"
autofocus
placeholder="Frag mich etwas..."
class="block w-full rounded-md border-gray-300 dark:border-none shadow-sm focus:border-blue-200 focus:ring focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50 placeholder:italic"
>
<input type="submit" class="flex-grow-0 btn btn-primary" value="Suchen">
</form>
</div>
{% if form.q.value %}
<div class="mx-auto max-w-prose flex flex-col gap-4">
{% for result in object_list %}
{% if result.get_model_name == 'post' %}
{% include 'search/post.html' %}
{% elif result.get_model_name == 'etherpad' %}
{% include 'search/etherpad.html' %}
{% elif result.get_model_name == 'member' %}
{% include 'search/member.html' %}
{% elif result.get_model_name == 'album' %}
{% include 'search/album.html' %}
{% elif result.get_model_name == 'SearchObject' %}
{% include 'search/post.html' %}
{% endif %}
{% empty %}
<div class="text-lg text-gray-800 dark:text-gray-200 text-center my-8">
<i class="fa-solid fa-ban mr-2"></i> Keine Ergebnisse gefunden!
</div>
{% endfor %}
</div>
{% endif %}
</section>
</main>
{% endblock %}