search.html 3.77 KB
Newer Older
1 2 3
{% extends 'base.html' %}
{% load bt %}
{% load i18n %}
Okhin's avatar
Okhin committed
4
{% block active_tab_search %}id="current"{% endblock %}
5
{% block styles %}
6
<link rel="stylesheet" href="/static/css/map.css" type="text/css" />
7 8 9
{% endblock %}

{% block head %}
10
<meta name="viewport" content="width=device-width, initial-scale=1.0">
11 12 13
{% endblock %}

{% block scripts %}
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<script type="text/javascript">
var data={% if countryweights %}{{countryweights|safe}}{%else%}[]{% endif %};
var country="{{country}}";
$.tablesorter.addParser({
	// set a unique id
	id: 'stateparser',
	is: function(s) {
		// return false so this parser is not auto detected
		return false;
	},
	format: function(s) {
		// format your data for normalization
		return s{% for s, translation in status %}.replace(/{{translation}}/,{{forloop.counter}}){% endfor %};
	},
	// set type, either numeric or text
	type: 'numeric'
});
</script>
32 33 34 35
{% endblock %}

{% block content %}
<div id="global">
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
	{% if messages %}
	<ul class="messages">
		{% for message in messages %}
		<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
		{% endfor %}
	</ul>
	{% endif %}
	{% trans "Search through cases" %}
	<div id="map"> </div>
	<form method="get" action=".">
		{{ form.as_p }}
		<input type="submit" value="Search">
	</form>

	{% if query %}
	<h3>Results</h3>
52

53 54 55 56 57 58 59
	<h2 id="stats-title">{% trans "Statistics" %}</h2>
	<ul id="stats">
		{% for t, n in stats %}
		<li class="stat"><dl><dt class="inline">{{t}}</dt><dd class="inline"><strong>{{n}}</strong></dd></dl></li>
		{% endfor %}
	</ul>
</div>
60

61 62 63 64 65 66 67 68 69 70 71 72 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 102 103 104
<table class="listing tablesorter zebra-striped" id='sortedlist'>
	<thead>
		<tr>
			<th filter-type='ddl'>{% trans "Status" %}</th>
			<th filter-type='ddl'>{% trans "country" %}</th>
			<th filter-type='ddl'>{% trans "operator" %}</th>
			<th filter-type='ddl'>{% trans "contract" %}</th>
			<th filter-type='ddl'>{% trans "resource" %}</th>
			<th filter-type='ddl'>{% trans "type" %}</th>
			<th filter-type='ddl'>{% trans "fixed / wireless" %}</th>
			<th filter='false'>{% trans "confirmations" %}</th>
			<th filter='false'></th>
		</tr>
	</thead>
	<tbody>
		{% for result in object_list %}
		<tr class="{%if result.object.state%}{{result.object.state}}{%else%}new{%endif%}-status">
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{%if result.object.state%}{{result.object.state|status}}{%else%}{% trans "New" %}{%endif%}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.country|country }}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.operator }}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.contract }}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.resource_name }}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.type|type }}</a></td>
			<td><a class="cell-link" href="{{ result.object.get_absolute_url }}">{{ result.object.media|media }}</a></td>
			<td>{{ result.object.confirmations }}</td>
			<td>
				<div class="confirm"><a class="button">{% trans "Me too!" %}</a>
					<div class="info-validate float-confirm">
						<form method="get" action="" id="i{{ violation.pk }}" class="confirm_form" >
							<div>
								<label>{% trans "In order to <strong>confirm</strong> this report, please enter your email address" %}</label>
								<input type="text" name="email" />
								<input type="hidden" value="{{ violation.pk }}" />
								<input type="submit" value="{% trans "OK" %}" />
							</div>
						</form>
						<input class="cancel-button" type="button" value="{% trans "Close" %}" />
					</div>
				</div>
			</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
105

106
{% endif %}
Okhin's avatar
Okhin committed
107
</div>
108
{% endblock %}