{% extends "../base.html" %}

{% block head %}
    <script type="module" src="{{fix_static('js/search/search.js')}}"></script>
{% end %}
{% block stylesheets %}
    <link rel="stylesheet" type="text/css" href="{{fix_static('css/form.css')}}">
    <style>em{color:var(--contrast-2);}</style>
{% end %}

{% block body %}
    <form id="search-form">
        <label>
            Suche:
            <input type="search" id="search-input" name="q" value="{{query}}">
        </label>
    </form>
    {% if results %}
        <h2>
            Gefundene Seiten:
        </h2>
        <ul id="search-results" class="list">
            {% for result in results %}
                <li score="{{result['score']}}" class="menu-list">
                    <a href="{{fix_url(result['url'])}}"
                    >{% raw result["title"]%}</a>:
                    {% raw result["description"] %}
                </li>
            {% end %}
        </ul>
    {% else %}
        <div>Nichts gefunden.</div>
    {% end %}
{% end %}
