source: telemeta/templates/telemeta_default/search_criteria.html @ c1a2c1c

cremcrem2crem3devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiproductionrelease/1.4.4sabiodsearchsecurityserversocialstoragetelecastertestvideo
Last change on this file since c1a2c1c was c1a2c1c, checked in by olivier <>, 5 years ago

add autocompleted location input field to advanced search

  • Property mode set to 100644
File size: 1.8 KB
Line 
1{% extends "telemeta/base.html" %}
2{% load telemeta_utils %}
3{% load i18n %}
4
5{% block stylesheets %}
6{{ block.super }}
7<link rel="stylesheet" type="text/css" href="{% url telemeta-css "jquery.autocomplete.css" %}" />
8{% endblock %}
9
10{% block extra_javascript %}
11<script src="{% url telemeta-js "jquery.autocomplete.js" %}" type="text/javascript"></script>
12<script type="text/javascript">
13$(document).ready(function () {
14    $('#location').autocomplete('{% url telemeta-complete-location %}', {
15        max: 20,
16        formatResult: function(data) {
17            console.log(data);
18            return data[0].replace(/ *\([0-9]+.*\) *$/, '');
19        }
20    });
21});
22</script>
23{% endblock %}
24
25{% block content %}
26<h3>Advanced search</h3>
27
28<form action="{% url telemeta-search %}" id="searchform">
29<fieldset>
30
31    <p>
32    <label for="location">{% trans "Location" %}</label>
33    <input type="text" name="location" id="location" />
34    </p>
35
36    <p>
37    <label for="ethnic_group">Ethnic group</label>
38    <select id="ethnic_group" name="ethnic_group">
39        <option value="">All ethnic groups</option>
40    {% for group in ethnic_groups %}
41        <option value="{{group.id}}">{{group|escape}}</option>
42    {% endfor %}
43    </select>
44    </p>
45
46</fieldset>
47<fieldset>
48
49    <p>
50    <label for="creator">Creator</label>
51    <input type="text" id="creator" name="creator" />
52    </p>
53
54    <p>
55    <label for="title">Title</label>
56    <input type="text" id="title" name="title" />
57    </p>
58
59    <p>
60    <label for="rec_date">Recording date</label>
61    <input type="text" id="rec_date" name="rec_date" />
62    </p>
63
64    <p>
65    <label for="pub_date">Publishing date</label>
66    <input type="text" id="pub_date" name="pub_date" />
67    </p>
68
69</fieldset>
70
71<p class="input">
72<input type="submit" value="Search" />
73</p>
74
75</form>
76{% endblock %}
Note: See TracBrowser for help on using the repository browser.