summaryrefslogtreecommitdiffstats
path: root/templates/packages/results.html
blob: 7560296b59e89800730a6c1f043ba8be89e7eeda (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
{% extends "base.html" %}
{% load package_extras %}
{% block title %}Arch Linux - Search Results{% endblock %}

{% block content %}
    <div id="search">
        <form method="get" action="/packages/">
            <input type="hidden" name="sort" value='{{sort}}' />
            <p>Package Search:&nbsp;&nbsp;<input type="text" name="q" size="20" maxlength="200" /></p>
        </form>
    </div>

    {% if package_list %}
    <div class="greybox">
        <form method="post" action="/packages/update/">
        <table class="results" width="100%">
            {% if paginator %}
                <tr>
                    <td colspan="{% if user.is_authenticated %}5{% else %}4{% endif %}">
                        {{paginator.count}} packages found.
                        Page {{page_obj.number}} of {{paginator.num_pages}}.
                    </td>
                    <td>
                        {% if page_obj.has_previous %}
                        <a href="/packages/{{page_obj.previous_page_number}}/{{current_query}}">
                            &lt;&lt;&lt; Previous
                        </a>
                        {% else %}
                            &lt;&lt;&lt; Previous
                        {% endif %}
                    </td>
                    <td>
                        {% if page_obj.has_next %}
                        <a href="/packages/{{page_obj.next_page_number}}/{{current_query}}">
                            Next &gt;&gt;&gt;
                        </a>
                        {% else %} 
                            Next &gt;&gt;&gt;
                        {% endif %}
                    </td>
                </tr>
            {% endif %}
            <tr>
                {% if user.is_authenticated %}
                <th>&nbsp;</th>
                {% endif %}
                <th><a href="/packages/{% buildsortqs "arch" %}">Arch</a></th>
                <th><a href="/packages/{% buildsortqs "repo" %}">Repo</a></th>
                <th><a href="/packages/{% buildsortqs "pkgname" %}">Name</a></th>
                <th>Version</th>
                <th>Description</th>
                <th><a href="/packages/{% buildsortqs "-last_update" %}">Last Updated</a></th>

            </tr>
            {% for pkg in package_list %}
                <tr class="{% cycle pkgr2,pkgr1 %}">
                    {% if user.is_authenticated %}
                    <td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td>
                    {% endif %}
                    <td>{{ pkg.arch.name }}</td>
                    <td>{{ pkg.repo.name|capfirst }}</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 %}
            {% if paginator %}
                <tr>
                    <td colspan="{% if user.is_authenticated %}5{% else %}4{% endif %}">
                        {{paginator.count}} packages found.
                        Page {{page_obj.number}} of {{paginator.num_pages}}.
                    </td>
                    <td>
                        {% if page_obj.has_previous %}
                        <a href="/packages/{{page_obj.previous_page_number}}/{{current_query}}">
                            &lt;&lt;&lt; Previous
                        </a>
                        {% else %}
                            &lt;&lt;&lt; Previous
                        {% endif %}
                    </td>
                    <td>
                        {% if page_obj.has_next %}
                        <a href="/packages/{{page_obj.next_page_number}}/{{current_query}}">
                            Next &gt;&gt;&gt;
                        </a>
                        {% else %} 
                            Next &gt;&gt;&gt;
                        {% endif %}
                    </td>
                </tr>
            {% endif %}
        </table>
        {% if user.is_authenticated %}
        <div id="adoptbox">
            <input type="submit" name="adopt" value="Adopt Packages">
            <input type="submit" name="disown" value="Disown Packages">
        </div>
        {% endif %}
        </form>
    </div>
    {% endif %}
{% endblock %}