_base_search.html 7.13 KB
Newer Older
Robin's avatar
Robin committed
1
{% load i18n memopol_tags %}
2
<form class="form-horizontal  hidden-print" method="GET" action="{% url "representative-list" %}">
Jamesie Pic's avatar
Jamesie Pic committed
3
    <div class="input-group">
4
5
        <label class="sr-only" for="search">{% trans "Search for representatives" %}</label>
        <input type="text" class="form-control" name="search" placeholder="{% trans "Search for representatives" %}" id="search" value="{{ filter.data.search }}">
Jamesie Pic's avatar
Jamesie Pic committed
6
        <span class="input-group-btn">
Robin's avatar
Robin committed
7
            <button class="btn btn-primary" type="submit">
Jamesie Pic's avatar
Jamesie Pic committed
8
9
10
11
12
13
                <span class="glyphicon glyphicon-search"></span>
            </button>
        </span>
    </div>
</form>

Nicolas Joyard's avatar
Nicolas Joyard committed
14
15
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#search-options"
  aria-expanded="{% if filter.data %}true{% else %}false{% endif %}" aria-controls="search-options">
16
    {% trans "More search options" %}
Jamesie Pic's avatar
Jamesie Pic committed
17
18
</button>

Nicolas Joyard's avatar
Nicolas Joyard committed
19
20
<div class="collapse{% if filter.data %} in{% endif %}" id="search-options"
  aria-expanded="{% if filter.data %}true{% else %}false{% endif %}">
21

Nicolas Joyard's avatar
Nicolas Joyard committed
22
23
  <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-rep"
    aria-expanded="{% if view == 'representative_list' and filter.data %}true{% else %}false{% endif %}" aria-controls="form-rep">
24
25
26
      {% trans "Find a representative" %}
  </button>

Nicolas Joyard's avatar
Nicolas Joyard committed
27
28
  <div class="collapse{% if view == 'representative_list' and filter.data %} in{% endif %}"
    aria-expanded="{% if view == 'representative_list' and filter.data %}true{% else %}false{% endif %}" id="form-rep">
29
30
31
32
33
34
35

    <form id="rep-search-form" class="form-horizontal" method="GET" action="{% url "representative-list" %}">
      <div class="form-group">
        <label class="col-sm-3" for="search-rep">{% trans "Name" %}</label>
        <div class="col-sm-9">
          <input type="text" class="form-control" name="search" id="search-rep" value="{{ filter.data.search }}">
        </div>
36
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
37

Nicolas Joyard's avatar
Nicolas Joyard committed
38
39
40
41
42
43
44
45
46
47
48
      <div class="form-group">
        <label class="col-sm-3" for="score-min">{% trans "Score between" %}</label>
        <div class="col-sm-4">
          <input type="number" class="form-control" name="scoremin" id="score-min" value="{{ filter.data.scoremin }}">
        </div>
        <label class="col-sm-1" for="score-max">{% trans "and" %}</label>
        <div class="col-sm-4">
          <input type="number" class="form-control" name="scoremax" id="score-max" value="{{ filter.data.scoremax }}">
        </div>
      </div>

49
50
51
52
53
54
55
56
57
58
59
60
      <div class="form-group">
        <label class="col-sm-3" for="chamber-rep">{% trans "Chamber" %}</label>
        <div class="col-sm-9">
          <select class="form-control" id="chamber-rep" name="chamber">
            <option value="">{% trans "All" %}</option>
            {% for chamber in chambers %}
            <option {% if filter.data.chamber = chamber.id|cast_str %}selected{% endif %} value="{{ chamber.id }}">
              {{ chamber.name }}
            </option>
            {% endfor %}
          </select>
        </div>
61
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
62

63
64
65
66
67
68
69
70
71
72
73
74
75
      <div class="form-group">
        <label class="col-sm-3" for="country">{% trans "Country" %}</label>
        <div class="col-sm-9">
          <select class="form-control" id="country" name="country">
            <option value="">{% trans "All" %}</option>
            {% for country in countries %}
            <option {% if filter.data.country = country.id|cast_str %}selected{% endif %} value="{{ country.id }}">
              {% if country.abbreviation %}{{ country.abbreviation }} &ndash;{% endif %}
              {{ country.name }}
            </option>
            {% endfor %}
          </select>
        </div>
76
      </div>
77

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
      <div class="form-group">
        <label class="col-sm-3" for="party">{% trans "Party" %}</label>
        <div class="col-sm-9">
          <select class="form-control" id="party" name="party">
            <option value="">{% trans "All" %}</option>
            {% for party in parties %}
            <option {% if filter.data.party = party.pk|cast_str %}selected{% endif %} value="{{ party.pk }}">
              {% if party.abbreviation %}{{ party.abbreviation }} &ndash;{% endif %}
              {{ party.name }}
            </option>
            {% endfor %}
          </select>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-3" for="committee">{% trans "Committee" %}</label>
        <div class="col-sm-9">
          <select class="form-control" id="committee" name="committee">
            <option value="">{% trans "All" %}</option>
            {% for committee in committees %}
            <option {% if filter.data.committee = committee.pk|cast_str %}selected{% endif %} value="{{ committee.pk }}" data-url="{% url "representative-list" %}?committee={{ committee.pk }}">
              {% if committee.abbreviation %}{{ committee.abbreviation }} &ndash;{% endif %}
              {{ committee.name }}
            </option>
            {% endfor %}
          </select>
        </div>
106
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
107

108
109
110
111
112
113
114
115
116
117
118
119
120
      <div class="form-group">
        <label class="col-sm-3" for="delegation">{% trans "Delegation" %}</label>
        <div class="col-sm-9">
          <select class="form-control" id="delegation" name="delegation">
            <option value="">{% trans "All" %}</option>
            {% for delegation in delegations %}
            <option {% if filter.data.delegation = delegation.pk|cast_str %}selected{% endif %} value="{{ delegation.pk }}" data-url="{% url "representative-list" %}?delegation={{ delegation.pk }}">
              {{ delegation.name }}
            </option>
            {% endfor %}
          </select>
        </div>
      </div>
121

122
123
124
      <button type="submit" class="btn btn-default">{% trans "Search" %}</button>
    </form>
  </div>
125

Nicolas Joyard's avatar
Nicolas Joyard committed
126
127
  <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-dossier"
    aria-expanded="{% if view == 'dossier_list' and filter.data %}true{% else %}false{% endif %}" aria-controls="form-dossier">
128
129
      {% trans "Find a dossier" %}
  </button>
Jamesie Pic's avatar
Jamesie Pic committed
130

Nicolas Joyard's avatar
Nicolas Joyard committed
131
132
  <div class="collapse{% if view == 'dossier_list' and filter.data %} in{% endif %}"
    aria-expanded="{% if view == 'dossier_list' and filter.data %}true{% else %}false{% endif %}" id="form-dossier">
133
134
135
136
137
138
    <form id="dossier-search-form" class="form-horizontal" method="GET" action="{% url "dossier-list" %}">
      <div class="form-group">
        <label class="col-sm-3" for="search-dossier">{% trans "Name" %}</label>
        <div class="col-sm-9">
          <input type="text" class="form-control" name="search" id="search-dossier" value="{{ filter.data.search }}">
        </div>
139
      </div>
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

      <div class="form-group">
        <label class="col-sm-3" for="chamber-dossier">{% trans "Chamber" %}</label>
        <div class="col-sm-9">
          <select class="form-control" name="chamber" id="chamber-dossier">
            <option value="">{% trans "All" %}</option>
            {% for chamber in chambers %}
            <option {% if filter.data.chamber = chamber.id|cast_str %}selected{% endif %} value="{{ chamber.id }}">
              {{ chamber.name }}
            </option>
            {% endfor %}
          </select>
        </div>
      </div>

      <button type="submit" class="btn btn-default">{% trans "Search" %}</button>
    </form>
  </div>

</div>