_base_search.html 6.63 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>

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

18
19
20
21
22
23
24
25
26
27
28
29
30
31
<div {% if filter.data %}{% else %}class="collapse"{% endif %} id="search-options">

  <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-rep" aria-expanded="false" aria-controls="form-rep">
      {% trans "Find a representative" %}
  </button>

  <div {% if view != 'representative_list' %}class="collapse"{% endif %} id="form-rep">

    <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>
32
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
33

Nicolas Joyard's avatar
Nicolas Joyard committed
34
35
36
37
38
39
40
41
42
43
44
      <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>

45
46
47
48
49
50
51
52
53
54
55
56
      <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>
57
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
58

59
60
61
62
63
64
65
66
67
68
69
70
71
      <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>
72
      </div>
73

74
75
76
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
      <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>
102
      </div>
Jamesie Pic's avatar
Jamesie Pic committed
103

104
105
106
107
108
109
110
111
112
113
114
115
116
      <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>
117

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

122
123
124
  <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-dossier" aria-expanded="false" aria-controls="form-dossier">
      {% trans "Find a dossier" %}
  </button>
Jamesie Pic's avatar
Jamesie Pic committed
125

126
127
128
129
130
131
132
  <div {% if view != 'dossier_list' %}class="collapse"{% endif %} id="form-dossier">
    <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>
133
      </div>
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

      <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>