search.html 6.11 KB
Newer Older
eliott's avatar
eliott committed
1
{% extends "base.html" %}
2
{% load package_extras %}
3
{% load admin_static %}
4

5
{% block title %}Arch Linux - Package Database{% endblock %}
6
{% block navbarclass %}anb-packages{% endblock %}
7

eliott's avatar
eliott committed
8
{% block head %}
9
{% if is_paginated and page_obj.number > 1 %}<meta name="robots" content="noindex, nofollow"/>{% endif %}
10
<link rel="stylesheet" type="text/css" href="{% static "admin/css/widgets.css" %}" />
eliott's avatar
eliott committed
11
12
13
{% endblock %}

{% block content %}
14
<div id="pkglist-search" class="box filter-criteria">
15
16
17
18
19

    <h2>Package Database</h2>

    <h3>Package Search</h3>

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
    <form id="pkg-search" method="get" action="/packages/">
        <p><input type="hidden" name="sort" value='{{sort}}' /></p>
        {{ search_form.non_field_errors }}
        <fieldset>
            <legend>Enter search criteria</legend>
            <div>{{ search_form.arch.errors }}
                <label for="id_arch" title="Limit results a specific CPU architecture">
                    Arch</label>{{ search_form.arch }}</div>
            <div>{{ search_form.repo.errors }}
                <label for="id_repo" title="Limit results to a specific respository">
                    Repository</label>{{ search_form.repo }}</div>
            <div>{{ search_form.q.errors }}
                <label for="id_q" title="Enter keywords as desired">
                    Keywords</label>{{ search_form.q }}</div>
            <div>{{ search_form.maintainer.errors }}
                <label for="id_maintainer" title="Limit results to a specific maintainer">
                    Maintainer</label>{{ search_form.maintainer}}</div>
            <div>{{ search_form.last_update.errors }}
                <label for="id_last_update" title="Limit results to a date after the date entered">
                    Last Updated After</label>{{ search_form.last_update }}</div>
            <div>{{ search_form.flagged.errors }}
                <label for="id_flagged" title="Limit results based on out-of-date status">
                    Flagged</label>{{ search_form.flagged }}</div>
            <div>{{ search_form.limit.errors }}
                <label for="id_limit" title="Select the number of results to display per page">
                    Per Page</label>{{ search_form.limit }}</div>
            <div ><label>&nbsp;</label><input title="Search for packages using this criteria"
                type="submit" value="Search" /></div>
        </fieldset>
    </form>
50
51
52
53
54

</div><!-- #pkglist-search -->

{% if package_list %}
<div id="pkglist-results" class="box">
55
    {% include "packages/search_paginator.html" %}
56
    <form id="pkglist-results-form" method="post" action="/packages/update/">{% csrf_token %}
eliott's avatar
eliott committed
57

58
59
        <table class="results">
            <thead>
60
                <tr>
61
                    {% if perms.main.change_package %}
62
63
                    <th>&nbsp;</th>
                    {% endif %}
64
                    <th><a href="/packages/?{% buildsortqs "arch" %}"
65
                            title="Sort packages by architecture">Arch</a></th>
66
                    <th><a href="/packages/?{% buildsortqs "repo" %}"
67
                            title="Sort packages by repository">Repo</a></th>
68
                    <th><a href="/packages/?{% buildsortqs "pkgname" %}"
69
70
71
                            title="Sort packages by package name">Name</a></th>
                    <th>Version</th>
                    <th>Description</th>
72
                    <th><a href="/packages/?{% buildsortqs "-last_update" %}"
73
                            title="Sort packages by last update">Last Updated</a></th>
74
                    <th><a href="/packages/?{% buildsortqs "-flag_date" %}"
75
                            title="Sort packages by when marked-out of-date">Flag Date</a></th>
76
                </tr>
77
78
            </thead>
            <tbody>
79
            {% for pkg in package_list %}
80
                <tr class="{% cycle 'odd' 'even' %}">
81
                    {% if perms.main.change_package %}
82
                    <td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td>
Dan McGee's avatar
Dan McGee committed
83
                    {% endif %}
84
85
                    <td>{{ pkg.arch.name }}</td>
                    <td>{{ pkg.repo.name|capfirst }}</td>
86
                    <td>{% pkg_details_link pkg %}</td>
87
                    {% if pkg.flag_date %}
88
                    <td><span class="flagged">{{ pkg.full_version }}</span></td>
89
                    {% else %}
90
                    <td>{{ pkg.full_version }}</td>
91
92
                    {% endif %}
                    <td class="wrap">{{ pkg.pkgdesc }}</td>
93
                    <td>{{ pkg.last_update|date }}</td>
94
                    <td>{{ pkg.flag_date|date }}</td>
95
96
                </tr>
            {% endfor %}
97
            </tbody>
98
        </table>
99
        {% include "packages/search_paginator.html" %}
eliott's avatar
eliott committed
100

101
        {% if perms.main.change_package %}
102
103
104
105
106
107
108
109
110
        <p><input title="Adopt selected packages" type="submit" id="adopt-btn"
        name="adopt" value="Adopt Packages" />
        <input title="Orphan selected packages" type="submit" id="disown-btn"
        name="disown" value="Disown Packages" /></p>
        {% endif %}

    </form>

</div><!-- #pkglist-results -->
111
112
{% else %}
<div class="box">
Dan McGee's avatar
Dan McGee committed
113
114
115
    <p>We couldn't find any packages matching your query. Try searching again
    using different criteria, or try
    {% if search_form.q.data %}
116
    <a href="https://aur.archlinux.org/packages.php?K={{ search_form.q.data|urlencode }}">searching the AUR</a>
Dan McGee's avatar
Dan McGee committed
117
118
    {% else %}searching the AUR{% endif %}
    to see if the package can be found there.</p>
119
</div>
120
{% endif %}
121
122
123
124

<div id="pkglist-about" class="box">
    <p>You are browsing the Arch Linux package database. From here you can find
    detailed information about packages located in the official supported repositories.
Dan McGee's avatar
Dan McGee committed
125
    For unsupported packages, browse the <a href="https://aur.archlinux.org/"
126
127
        title="AUR package database">Arch User Repository (AUR).</a></p>
</div>
128

129
{% load cdn %}{% jquery %}
130
<script type="text/javascript" src="/jsi18n/"></script>
131
132
133
134
135
<script type="text/javascript">
	window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";
	var django = {"jQuery": jQuery};
</script>
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
136
{{search_form.media}}
137
{% endblock %}