{% extends "base.html" %}

{% block content %}

<div>
    <h2>{{ current_session }}</h2>

    <form action="" method="get">
    {% csrf_token %}
        <div> Filter by Subject
            <select multiple name="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 %}
                {% endfor %}
            </select>
            <input type="submit"/>
        </div>
    </form>
</div>

{% for bill in latest_bills %}

    <div>

        <p><strong>{{ bill.identifier }}</strong></p>
        <p>{{ bill.title }}</p>
        <p>
            <span>Sponsor(s): </span>
            {% for sponsor in bill.sponsorships.all %}
                {{ sponsor.name }}
            {% endfor %}
        </p>

        <p>Latest action: {{ bill.latest_action.description }} -  {{ bill.latest_action.date }}</p>

        <a href="{% url 'bill_detail' bill.legislative_session.identifier bill.identifier %}" class="btn btn-primary">More on this bill</a>

        <hr/>
    </div>

{% endfor %}

{% endblock %}


{% block bottomscript %}
    $(".prefs-multiple").select2();

{% endblock %}

{% extends "base.html" %}

{% block content %}

<h2>{{ current_session }}</h2>
<div>
    <form action="" method="get">
    {% csrf_token %}
        <div> Filter by Subject
            <select multiple name="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 %}
                {% endfor %}
            </select>
            <input type="submit" class="btn btn-primary" value="GO"/>
        </div>
    </form>
</div>
<div>
    <form action="" method="get">
    {% csrf_token %}
        <div> Filter by Bill Text
            <input type="text" name="search_text">
            <input type="submit" class="btn btn-primary" value="GO"/>
        </div>
    </form>
</div>

{% for bill in latest_bills %}

    <div>

        <p><strong>{{ bill.identifier }}</strong></p>
        <p>{{ bill.title }}</p>
        <p>
            <span>Sponsor(s): </span>
            {% for sponsor in bill.sponsorships.all %}
                {{ sponsor.name }}
            {% endfor %}
        </p>

        <p>Latest action: {{ bill.latest_action.description }} -  {{ bill.latest_action.date }}</p>

        <a href="{% url 'bill_detail' bill.legislative_session.identifier bill.identifier %}" class="btn btn-primary">More on this bill</a>

        <hr/>
    </div>

{% endfor %}

{% endblock %}


{% block bottomscript %}
    $(".prefs-multiple").select2();

{% endblock %}

Add filter by bill text box, make buttons blue and say GO
Add filter by bill text box, make buttons blue and say GO
