{% extends 'base.html' %}

{% block content %}
    <h2>Search</h2>

    <form method="get" action=".">
        <table>
            {{ form.as_p }}
            <tr>
                <td>&nbsp;</td>
                <td>
                    <input type="submit" value="Search">
                </td>
            </tr>
        </table>

        {% if query %}

        <div>
            {% if org %}
            <div>
                <h3> Structures </h3>
                <ul>
                {% for result in org %}
                    <li> {{ result.rendered|safe }} </li>
                {% endfor %}
                </ul>
            </div>

            {% if exchange %}
            <div>
                <h3> Annonces </h3>
                <ul>
                {% for result in exchange %}
                    <li> {{ result.rendered|safe }} </li>
                {% endfor %}
                </ul>
            </div>
           
            {% if event %}
            <div>
                <h3> Evénements </h3>
                <ul>
                {% for result in event %}
                    <li> {{ result.rendered|safe }} </li>
                {% endfor %}
                </ul>
            </div>

            {% if article %}
            <div>
                <h3> News </h3>
                <ul>
                {% for result in articlee %}
                    <li> {{ result.rendered|safe }} </li>
                {% endfor %}
                </ul>
            </div>


        </div>


    </form>
{% endblock %}