Some style fixes
[archweb_dev-nj.git] / templates / packages / search.html
blob030289d4c50745f85a5b4617cb86e1930025a48a
1 {% load validation %}
2 {% load package_extras %}
3 {% extends "base.html" %}
5 {% block head %}
6 <script type="text/JavaScript" src="/media/calendar.js"></script>
7 <link href="/media/calendar.css" rel="stylesheet" type="text/css" />
8 {% endblock %}
10 {% block content %}
11 <div class="greybox">
12 <h4 style="text-align: right">Search Criteria</h4>
13 {% if errors %}
14 {% print_errors errors %}
15 {% endif %}
16 <hr />
17 <form method="get" action="/packages/search/">
18 <table width="100%">
19 <tr>
20 <td><span class="smalltext">Repository</span></td>
21 <td><span class="smalltext">Category</span></td>
22 <td><span class="smalltext">Keywords</span></td>
23 <td><span class="smalltext">Last Update</span></td>
24 <td><span class="smalltext">Per Page</span></td>
25 </tr><tr>
26 <td>
27 <select name="repo">
28 <option value="all">All</option>
29 {% for r in repos %}
30 <option value="{{ r.name }}"{% ifequal repo r.name %} selected{% endifequal %}>{{ r.name|capfirst }}</option>
31 {% endfor %}
32 </select>
33 </td><td>
34 <select name="category">
35 <option value="all">All</option>
36 {% for c in categories %}
37 <option value="{{ c.category }}"{% ifequal category c.category %} selected{% endifequal %}>{{ c.category|capfirst }}</option>
38 {% endfor %}
39 </select>
40 </td><td>
41 <input type="text" name="q" value="{{ query|escape }}" size="30" maxlength="200" />
42 </td><td>
43 <input type="text" name="lastupdate" value="{{ lastupdate|escape }}" size="10" maxlength="10" id="f_lastupdate" /> <button type="reset" id="f_trigger">...</button>
44 <script type="text/javascript">
45 Calendar.setup({
46 inputField : "f_lastupdate", // id of the input field
47 ifFormat : "%Y-%m-%d", // format of the input field
48 showsTime : false, // will display a time selector
49 button : "f_trigger", // trigger for the calendar (button ID)
50 singleClick : true, // double-click mode
51 step : 1 // show all years in drop-down boxes (instead of every other year as default)
52 });
53 </script>
54 </td><td>
55 <select name="limit">
56 <option value="50"{% ifequal limit 50 %} selected{% endifequal %}>50</option>
57 <option value="100"{% ifequal limit 100 %} selected{% endifequal %}>100</option>
58 <option value="250"{% ifequal limit 250 %} selected{% endifequal %}>250</option>
59 <option value="0"{% ifequal limit 0 %} selected{% endifequal %}>All</option>
60 </select>
61 </td><td>
62 <input type="submit" value=" Search " />
63 </td>
64 </tr>
65 </table>
66 </form>
67 </div>
68 <br /><br />
70 {% if results %}
71 <div class="greybox">
72 <table class="results" width="100%">
73 <tr>
74 {% if not user.is_anonymous %}
75 <form method="post" action="/packages/update/">
76 <th>&nbsp;</th>
77 {% endif %}
78 <th><a href="{% buildsortqs "repo" %}">Repo</a></th>
79 <th><a href="{% buildsortqs "category" %}">Category</a></th>
80 <th><a href="{% buildsortqs "pkgname" %}">Name</a></th>
81 <th>Version</th>
82 <th>Description</th>
83 <th><a href="{% buildsortqs "last_update" %}">Last Updated</a></th>
84 </tr>
85 {% for pkg in results %}
86 <tr class="{% cycle pkgr1,pkgr2 %}">
87 {% if not user.is_anonymous %}
88 <td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td>
89 {% endif %}
90 <td>{{ pkg.repo.name }}</td>
91 <td>{{ pkg.category.category }}</td>
92 <td><a href="{{ pkg.get_absolute_url }}">{{ pkg.pkgname }}</a></td>
93 {% if pkg.needupdate %}
94 <td><span style="color:red">{{ pkg.pkgver }}-{{ pkg.pkgrel }}</span></td>
95 {% else %}
96 <td>{{ pkg.pkgver }}-{{ pkg.pkgrel }}</td>
97 {% endif %}
98 <td>{{ pkg.pkgdesc }}</td>
99 <td>{{ pkg.last_update|date:"Y-m-d" }}</td>
100 </tr>
101 {% endfor %}
102 <tr>
103 <td colspan="2" style="font-size:x-small">{% if prevpage %}<br /><a href="{{ prevpage }}">&lt;&lt;&lt; Prev</a>{% endif %}</td>
104 <td colspan="2">&nbsp;</td>
105 <td colspan="2" style="font-size:x-small;text-align:right">{% if nextpage %}<br /><a href="{{ nextpage }}">Next &gt;&gt;&gt;</a>{% endif %}</td>
106 </tr>
107 {% if not user.is_anonymous %}
108 <tr>
109 <td colspan="3">&nbsp;</td>
110 <td colspan="2" style="text-align:center"><input type="submit" name="adopt" value="Adopt Packages"></td>
111 <td colspan="1" style="text-align:center"><input type="submit" name="disown" value="Disown Packages"></td>
112 <td colspan="1">&nbsp;</td>
113 </tr>
114 </form>
115 {% endif %}
116 </table>
117 </div>
118 {% endif %}
119 {% endblock %}