diff options
Diffstat (limited to 'templates/packages')
-rw-r--r-- | templates/packages/search.html | 71 | ||||
-rw-r--r-- | templates/packages/search_paginator.html | 4 | ||||
-rw-r--r-- | templates/packages/stale_relations.html | 6 |
3 files changed, 55 insertions, 26 deletions
diff --git a/templates/packages/search.html b/templates/packages/search.html index d312c374..d4a47b26 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -2,7 +2,7 @@ {% load cycle from future %} {% load package_extras %} -{% block title %}Arch Linux - Package Database{% endblock %} +{% block title %}Arch Linux - Package Search{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block head %} @@ -12,10 +12,7 @@ {% block content %} <div id="pkglist-search" class="box filter-criteria"> - - <h2>Package Database</h2> - - <h3>Package Search</h3> + <h2>Package Search</h2> <form id="pkg-search" method="get" action="/packages/"> <p>{{ search_form.sort }}</p> @@ -41,14 +38,49 @@ type="submit" value="Search" /></div> </fieldset> </form> +</div> -</div><!-- #pkglist-search --> +{% if not is_paginated or page_obj.number == 1 %}{% with search_form.exact_matches as exact_matches %}{% if exact_matches %} +<div id="exact-matches" class="box"> + <div class="pkglist-stats"> + <p>{{ exact_matches|length }} exact match{{ exact_matches|pluralize:"es" }} found.</p> + </div> + <table class="results"> + <thead> + <tr> + <th>Arch</th> + <th>Repo</th> + <th>Name</th> + <th>Version</th> + <th>Description</th> + <th>Last Updated</th> + <th>Flag Date</th> + </tr> + </thead> + <tbody> + {% for pkg in exact_matches %} + <tr class="{% cycle 'odd' 'even' %}"> + <td>{{ pkg.arch.name }}</td> + <td>{{ pkg.repo.name|capfirst }}</td> + <td>{% pkg_details_link pkg %}</td> + {% if pkg.flag_date %} + <td><span class="flagged">{{ pkg.full_version }}</span></td> + {% else %} + <td>{{ pkg.full_version }}</td> + {% endif %} + <td class="wrap">{{ pkg.pkgdesc }}</td> + <td>{{ pkg.last_update|date }}</td> + <td>{{ pkg.flag_date|date }}</td> + </tr> + {% endfor %} + </tbody> + </table> +</div> +{% endif %}{% endwith %}{% endif %} -{% if package_list %} <div id="pkglist-results" class="box"> {% include "packages/search_paginator.html" %} <form id="pkglist-results-form" method="post" action="/packages/update/">{% csrf_token %} - <table class="results"> <thead> <tr> @@ -70,7 +102,8 @@ </tr> </thead> <tbody> - {% for pkg in package_list %}<tr class="{% cycle 'odd' 'even' %}"> + {% for pkg in package_list %} + <tr class="{% cycle 'odd' 'even' %}"> {% if perms.main.change_package %} <td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td> {% endif %} @@ -85,7 +118,10 @@ <td class="wrap">{{ pkg.pkgdesc }}</td> <td>{{ pkg.last_update|date }}</td> <td>{{ pkg.flag_date|date }}</td> - </tr>{% endfor %} + </tr> + {% empty %} + <tr class="empty"><td colspan="{% if perms.main.change_package %}9{% else %}8{% endif %}"><em>No matching packages found</em></td></tr> + {% endfor %} </tbody> </table> {% include "packages/search_paginator.html" %} @@ -96,25 +132,18 @@ <input title="Orphan selected packages" type="submit" id="disown-btn" name="disown" value="Disown Packages" /></p> {% endif %} - </form> +</div> -</div><!-- #pkglist-results --> -{% else %} -<div class="box"> - <p>We couldn't find any packages matching your query. Try searching again +<div id="pkglist-about" class="box"> + <p>Can't find what you are looking for? Try searching again using different criteria, or try {% if search_form.q.data %} <a href="https://aur.archlinux.org/packages.php?K={{ search_form.q.data|urlencode }}">searching the AUR</a> {% else %}searching the <a href="https://aur.archlinux.org/">AUR</a>{% endif %} to see if the package can be found there.</p> -</div> -{% endif %} -<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. - For unsupported packages, browse the <a href="https://aur.archlinux.org/" - title="AUR package database">Arch User Repository (AUR).</a></p> + detailed information about packages located in the official supported repositories.</p> </div> {% endblock %} diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 3c368b82..a748d26b 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -1,6 +1,6 @@ <div class="pkglist-stats"> {% if is_paginated %} - <p>{{ paginator.count }} packages found. + <p>{{ paginator.count }} matching packages found. Page {{ page_obj.number }} of {{ paginator.num_pages }}.</p> <div class="pkglist-nav"> @@ -22,6 +22,6 @@ </span> </div> {% else %} - <p>{{ package_list.count }} packages found.</p> + <p>{{ package_list|length }} matching package{{ package_list|pluralize }} found.</p> {% endif %} </div> diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index 2b5af236..2dafc2be 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -37,7 +37,7 @@ <td>{{ relation.created }}</td> </tr> {% empty %} - <tr class="empty"><td colspan="5"><em>No inactive user relations.</em></td></tr> + <tr class="empty"><td colspan="6"><em>No inactive user relations.</em></td></tr> {% endfor %} </tbody> </table> @@ -66,7 +66,7 @@ <td>{{ relation.last_update.created }}</td> </tr> {% empty %} - <tr class="empty"><td colspan="4"><em>No non-existent pkgbase relations.</em></td></tr> + <tr class="empty"><td colspan="6"><em>No non-existent pkgbase relations.</em></td></tr> {% endfor %} </tbody> </table> @@ -100,7 +100,7 @@ <td class="wrap">{{ relation.repositories|join:", " }}</td> </tr> {% empty %} - <tr class="empty"><td colspan="6"><em>No relations with wrong permissions.</em></td></tr> + <tr class="empty"><td colspan="7"><em>No relations with wrong permissions.</em></td></tr> {% endfor %} </tbody> </table> |