{% extends "base.html" %}

{% block content %}

<div>
    <h2>Bills</h2>


    <form action="" method="post">
    {% csrf_token %}

        <div> Filter by subject 
            <select multiple name="bill_subjects" class="prefs-multiple">
                {% for subject in subjects %}
                    <option value="{{ subject }}">{{ subject }}</option>
                {% endfor %}
            </select>
            <input type="submit"/>
        </div>

    </form>
</div>

    {% for bill in bills %}
    <div>
        <h2> {{ bill.title }} </h2>
            <p> {{ bill.from_organization }} </p>

            {% for action in bill.actions %}
                <p>{{ action.description }}</p>
                <p>{{ action.date }}</p>
            {% endfor %}
    </div>

    <hr/>

    {% endfor %}


{% endblock %}

{% block bottomscript %}

    $(".prefs-multiple").select2();

{% endblock %}

{% extends "base.html" %}

{% block content %}

<div>
    <h2>Bills</h2>


    <form action="" method="post">
    {% csrf_token %}

        <div> Filter by subject 
            <select multiple name="bill_subjects" class="prefs-multiple">
                {% for subject in subjects %}

                    {% if subject.selected %}
                        <option value="{{ subject.item }}" selected="True">{{ subject.item }}</option>
                    {% else %}
                        <option value="{{ subject.item }}">{{ subject.item }}</option>
                    {% endif %}

                    <!-- <option value="{{ subject }}">{{ subject }}</option> -->
                {% endfor %}
            </select>
            <input type="submit"/>
        </div>

    </form>
</div>

    {% if bills %}

        {% for bill in bills %}
        <div>
            <h2> {{ bill.title }} </h2>
                <p> {{ bill.from_organization }} </p>

                {% for action in bill.actions %}
                    <p>{{ action.description }}</p>
                    <p>{{ action.date }}</p>
                {% endfor %}
        </div>

        <hr/>
        {% endfor %}
    {% else %}
    <div>
        <p class="lead">No results for this query</p>
    </div>

    {% endif %}

{% endblock %}

{% block bottomscript %}

    $(".prefs-multiple").select2();

{% endblock %}

Update template to say when none match query
Update template to say when none match query
