summaryrefslogtreecommitdiffstats
path: root/templates/packages/search.html
blob: 030289d4c50745f85a5b4617cb86e1930025a48a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{% load validation %}
{% load package_extras %}
{% extends "base.html" %}

{% block head %}
<script type="text/JavaScript" src="/media/calendar.js"></script>
<link href="/media/calendar.css" rel="stylesheet" type="text/css" />
{% endblock %}

{% block content %}
	<div class="greybox">
		<h4 style="text-align: right">Search Criteria</h4>
	{% if errors %}
		{% print_errors errors %}
	{% endif %}
		<hr />
		<form method="get" action="/packages/search/">
		<table width="100%">
			<tr>
				<td><span class="smalltext">Repository</span></td>
				<td><span class="smalltext">Category</span></td>
				<td><span class="smalltext">Keywords</span></td>
				<td><span class="smalltext">Last Update</span></td>
				<td><span class="smalltext">Per Page</span></td>
			</tr><tr>
				<td>
					<select name="repo">
						<option value="all">All</option>
					{% for r in repos %}
						<option value="{{ r.name }}"{% ifequal repo r.name %} selected{% endifequal %}>{{ r.name|capfirst }}</option>
					{% endfor %}
					</select>
				</td><td>
					<select name="category">
						<option value="all">All</option>
					{% for c in categories %}
						<option value="{{ c.category }}"{% ifequal category c.category %} selected{% endifequal %}>{{ c.category|capfirst }}</option>
					{% endfor %}
					</select>
				</td><td>
					<input type="text" name="q" value="{{ query|escape }}" size="30" maxlength="200" />
				</td><td>
					<input type="text" name="lastupdate" value="{{ lastupdate|escape }}" size="10" maxlength="10" id="f_lastupdate" /> <button type="reset" id="f_trigger">...</button>
					<script type="text/javascript">
    Calendar.setup({
        inputField     :    "f_lastupdate",  // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        showsTime      :    false,           // will display a time selector
        button         :    "f_trigger",     // trigger for the calendar (button ID)
        singleClick    :    true,            // double-click mode
        step           :    1                // show all years in drop-down boxes (instead of every other year as default)
    });
					</script>
				</td><td>
					<select name="limit">
						<option value="50"{% ifequal limit 50 %} selected{% endifequal %}>50</option>
						<option value="100"{% ifequal limit 100 %} selected{% endifequal %}>100</option>
						<option value="250"{% ifequal limit 250 %} selected{% endifequal %}>250</option>
						<option value="0"{% ifequal limit 0 %} selected{% endifequal %}>All</option>
					</select>
				</td><td>
					<input type="submit" value=" Search " />
				</td>
			</tr>
		</table>
		</form>
	</div>
	<br /><br />

	{% if results %}
	<div class="greybox">
		<table class="results" width="100%">
			<tr>
				{% if not user.is_anonymous %}
				<form method="post" action="/packages/update/">
				<th>&nbsp;</th>
				{% endif %}
				<th><a href="{% buildsortqs "repo" %}">Repo</a></th>
				<th><a href="{% buildsortqs "category" %}">Category</a></th>
				<th><a href="{% buildsortqs "pkgname" %}">Name</a></th>
				<th>Version</th>
				<th>Description</th>
				<th><a href="{% buildsortqs "last_update" %}">Last Updated</a></th>
			</tr>
		{% for pkg in results %}
        <tr class="{% cycle pkgr1,pkgr2 %}">
				{% if not user.is_anonymous %}
				<td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td>
				{% endif %}
				<td>{{ pkg.repo.name }}</td>
				<td>{{ pkg.category.category }}</td>
				<td><a href="{{ pkg.get_absolute_url }}">{{ pkg.pkgname }}</a></td>
			{% if pkg.needupdate %}
				<td><span style="color:red">{{ pkg.pkgver }}-{{ pkg.pkgrel }}</span></td>
			{% else %}
				<td>{{ pkg.pkgver }}-{{ pkg.pkgrel }}</td>
			{% endif %}
				<td>{{ pkg.pkgdesc }}</td>
				<td>{{ pkg.last_update|date:"Y-m-d" }}</td>
			</tr>
		{% endfor %}
			<tr>
				<td colspan="2" style="font-size:x-small">{% if prevpage %}<br /><a href="{{ prevpage }}">&lt;&lt;&lt; Prev</a>{% endif %}</td>
				<td colspan="2">&nbsp;</td>
				<td colspan="2" style="font-size:x-small;text-align:right">{% if nextpage %}<br /><a href="{{ nextpage }}">Next &gt;&gt;&gt;</a>{% endif %}</td>
			</tr>
			{% if not user.is_anonymous %}
			<tr>
				<td colspan="3">&nbsp;</td>
				<td colspan="2" style="text-align:center"><input type="submit" name="adopt" value="Adopt Packages"></td>
				<td colspan="1" style="text-align:center"><input type="submit" name="disown" value="Disown Packages"></td>
				<td colspan="1">&nbsp;</td>
			</tr>
			</form>
			{% endif %}
		</table>
	</div>
	{% endif %}
{% endblock %}