From b59e79f3878d59b83c6867eb5c6196f8f003dcd9 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Tue, 1 May 2012 17:13:33 -0500
Subject: Opensearch enhancements
* Add a 64x64 icon as indicated in the Opensearch specification.
* Add suggestions capability and a new view providing suggestions based
on package name starting with the typed value.
Signed-off-by: Dan McGee
---
templates/packages/opensearch.xml | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
(limited to 'templates/packages')
diff --git a/templates/packages/opensearch.xml b/templates/packages/opensearch.xml
index 216be3e9..6c50d991 100644
--- a/templates/packages/opensearch.xml
+++ b/templates/packages/opensearch.xml
@@ -1,13 +1,18 @@
-
+{% load static from staticfiles %}
- Arch Linux Packages
- Search the Arch Linux package repositories.
+ Arch Packages
+ Arch Linux Package Repository Search
+ Search the Arch Linux package repositories by keyword in package names and descriptions.linux archlinux package software
- {{domain}}/static/favicon.ico
+ {{ domain }}{% static "favicon.ico" %}
+ {{ domain }}{% static "logos/icon-transparent-64x64.png" %}en-usUTF-8UTF-8
-
-
+
+
+
--
cgit v1.2.3-54-g00ecf
From 768bc688aab844cf9fdf9809b9381aaf0042f2fc Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Wed, 2 May 2012 10:21:30 -0500
Subject: Flagging related cleanups and improvements
Touch up the style slightly on the flag help popup to match the main
site style more closely.
When a logged-in user is flagging a package out of date, we have no need
for them to fill in the email field since we already have an email
address on file.
Signed-off-by: Dan McGee
---
packages/views/flag.py | 34 ++++++++++++++++++++++++----------
templates/packages/flaghelp.html | 20 +++++++++-----------
2 files changed, 33 insertions(+), 21 deletions(-)
(limited to 'templates/packages')
diff --git a/packages/views/flag.py b/packages/views/flag.py
index 0d2f9009..7fa2d508 100644
--- a/packages/views/flag.py
+++ b/packages/views/flag.py
@@ -6,16 +6,13 @@
from django.shortcuts import get_object_or_404, redirect
from django.template import loader, Context
from django.views.generic.simple import direct_to_template
-from django.views.decorators.cache import never_cache
+from django.views.decorators.cache import cache_page, never_cache
from ..models import FlagRequest
from main.models import Package
from main.utils import utc_now
-def flaghelp(request):
- return direct_to_template(request, 'packages/flaghelp.html')
-
class FlagForm(forms.Form):
email = forms.EmailField(label='E-mail Address')
message = forms.CharField(label='Message To Developer',
@@ -26,6 +23,20 @@ class FlagForm(forms.Form):
widget=forms.TextInput(attrs={'style': 'display:none;'}),
required=False)
+ def __init__(self, *args, **kwargs):
+ # we remove the 'email' field if this form is being shown to a
+ # logged-in user, e.g., a developer.
+ auth = kwargs.pop('authenticated', False)
+ super(FlagForm, self).__init__(*args, **kwargs)
+ if auth:
+ del self.fields['email']
+
+
+@cache_page(3600)
+def flaghelp(request):
+ return direct_to_template(request, 'packages/flaghelp.html')
+
+
@never_cache
def flag(request, name, repo, arch):
pkg = get_object_or_404(Package,
@@ -41,8 +52,10 @@ def flag(request, name, repo, arch):
repo__staging=pkg.repo.staging).order_by(
'pkgname', 'repo__name', 'arch__name')
+ authenticated = request.user.is_authenticated()
+
if request.POST:
- form = FlagForm(request.POST)
+ form = FlagForm(request.POST, authenticated=authenticated)
if form.is_valid() and form.cleaned_data['website'] == '':
# save the package list for later use
flagged_pkgs = list(pkgs)
@@ -54,9 +67,12 @@ def flag(request, name, repo, arch):
else:
version = ''
- email = form.cleaned_data['email']
message = form.cleaned_data['message']
ip_addr = request.META.get('REMOTE_ADDR')
+ if authenticated:
+ email = request.user.email
+ else:
+ email = form.cleaned_data['email']
@transaction.commit_on_success
def perform_updates():
@@ -68,7 +84,7 @@ def perform_updates():
ip_address=ip_addr, pkgbase=pkg.pkgbase,
version=version, repo=pkg.repo,
num_packages=len(flagged_pkgs))
- if request.user.is_authenticated():
+ if authenticated:
flag_request.user = request.user
flag_request.save()
@@ -106,9 +122,7 @@ def perform_updates():
arch=arch)
else:
initial = {}
- if request.user.is_authenticated():
- initial['email'] = request.user.email
- form = FlagForm(initial=initial)
+ form = FlagForm(authenticated=authenticated)
context = {
'package': pkg,
diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html
index 819a2f01..399b7e01 100644
--- a/templates/packages/flaghelp.html
+++ b/templates/packages/flaghelp.html
@@ -1,20 +1,19 @@
-
+{% load static from staticfiles %}
Flagging Packages
-
-
Flagging Packages
-
If you notice that a package is out-of-date (i.e., there is a newer
stable release available), then please notify us by
using the Flag button in the Package Details
@@ -29,8 +28,7 @@
Flagging Packages
with your additional text.
Note: Please do not use this facility if the
- package is broken! Use the bugtracker instead.
-
--
cgit v1.2.3-54-g00ecf
From f36d876aca5571f09032d0d2a67c8b1f1a3258c8 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 12 May 2012 09:22:52 -0500
Subject: Change to new time access methods in pgpdump code
Signed-off-by: Dan McGee
---
devel/views.py | 2 +-
templates/packages/details.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'templates/packages')
diff --git a/devel/views.py b/devel/views.py
index 7ef33362..0f1c8d15 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -280,7 +280,7 @@ def report(request, report_name, username=None):
filtered = []
packages = packages.filter(pgp_signature__isnull=False)
for package in packages:
- sig_date = package.signature.datetime.replace(tzinfo=pytz.utc)
+ sig_date = package.signature.creation_time.replace(tzinfo=pytz.utc)
package.sig_date = sig_date.date()
key_id = package.signature.key_id
signer = finder.find_by_pgp_key(key_id)
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 4ab55ef2..4cb6032e 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -165,7 +165,7 @@
Versions Elsewhere
{% with pkg.signer as signer %}{% if signer %}{% pgp_key_link pkg.signature.key_id signer.get_full_name %}{% else %}Unknown ({% pgp_key_link pkg.signature.key_id %}){% endif %}{% endwith %}
Signature Date:
-
{{ pkg.signature.datetime|date:"DATETIME_FORMAT" }} UTC
+
{{ pkg.signature.creation_time|date:"DATETIME_FORMAT" }} UTC
{% else %}
Signed By:
Unsigned
--
cgit v1.2.3-54-g00ecf
From 1625cd31c334b017688a8c30631ddad60fafd8f4 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Fri, 18 May 2012 19:57:40 -0500
Subject: Link to provides/conflicts/replacements if we can in details template
Use the newly implemented get_best_satisfier() method that is in the
abstract base class for all of these types.
Signed-off-by: Dan McGee
---
templates/packages/details.html | 12 ++++++------
templates/packages/details_relatedto.html | 10 ++++++++++
2 files changed, 16 insertions(+), 6 deletions(-)
create mode 100644 templates/packages/details_relatedto.html
(limited to 'templates/packages')
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 4cb6032e..358ab525 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -120,22 +120,22 @@
Versions Elsewhere
{% endif %}{% endwith %}
- {% with pkg.provides.all as provides %}{% if provides %}
+ {% with pkg.provides.all as all_related %}{% if all_related %}
Provides:
-
{{ provides|join:", " }}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
- {% with pkg.conflicts.all as conflicts %}{% if conflicts %}
+ {% with pkg.conflicts.all as all_related %}{% if all_related %}
Conflicts:
-
{{ conflicts|join:", " }}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
- {% with pkg.replaces.all as replaces %}{% if replaces %}
+ {% with pkg.replaces.all as all_related %}{% if all_related %}
Replaces:
-
{{ replaces|join:", " }}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
diff --git a/templates/packages/details_relatedto.html b/templates/packages/details_relatedto.html
new file mode 100644
index 00000000..1ffe2884
--- /dev/null
+++ b/templates/packages/details_relatedto.html
@@ -0,0 +1,10 @@
+{% load package_extras %}
+{% for related in all_related %}
+{% with related.get_best_satisfier as best_satisfier %}
+{% ifequal best_satisfier None %}
+{{ related.name }}{{ related.comparison|default:"" }}{{ related.version|default:"" }}{% if not forloop.last %}, {% endif %}
+{% else %}
+{% pkg_details_link best_satisfier %}{{ related.comparison|default:"" }}{{related.version|default:"" }}{% if not forloop.last %}, {% endif %}
+{% endifequal %}
+{% endwith %}
+{% endfor %}
--
cgit v1.2.3-54-g00ecf
From 72a92102df4999dbcc370064707c9026d51c4fe7 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Fri, 18 May 2012 21:29:03 -0500
Subject: Switch to usage of new Depend object
Signed-off-by: Dan McGee
---
devel/management/commands/reporead.py | 18 +++++++++-------
devel/views.py | 6 +++---
main/models.py | 7 +++---
packages/models.py | 34 ++++++++++++++++++++++++++----
packages/utils.py | 6 +++---
templates/packages/details_depend.html | 6 +++---
templates/packages/details_requiredby.html | 2 +-
7 files changed, 54 insertions(+), 25 deletions(-)
(limited to 'templates/packages')
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index fd8e3979..47294d9a 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -29,9 +29,9 @@
from django.db.utils import IntegrityError
from devel.utils import UserFinder
-from main.models import Arch, Package, PackageDepend, PackageFile, Repo
+from main.models import Arch, Package, PackageFile, Repo
from main.utils import utc_now
-from packages.models import Conflict, Provision, Replacement
+from packages.models import Depend, Conflict, Provision, Replacement
logging.basicConfig(
@@ -141,19 +141,21 @@ def full_version(self):
return u'%s-%s' % (self.ver, self.rel)
-DEPEND_RE = re.compile(r"^(.+?)((>=|<=|=|>|<)(.*))?$")
+DEPEND_RE = re.compile(r"^(.+?)((>=|<=|=|>|<)(.+))?$")
def create_depend(package, dep_str, optional=False):
- depend = PackageDepend(pkg=package, optional=optional)
+ depend = Depend(pkg=package, optional=optional)
# lop off any description first
parts = dep_str.split(':', 1)
if len(parts) > 1:
depend.description = parts[1].strip()
match = DEPEND_RE.match(parts[0].strip())
if match:
- depend.depname = match.group(1)
- if match.group(2):
- depend.depvcmp = match.group(2)
+ depend.name = match.group(1)
+ if match.group(3):
+ depend.comparison = match.group(3)
+ if match.group(4):
+ related.version = match.group(4)
else:
logger.warning('Package %s had unparsable depend string %s',
package.pkgname, dep_str)
@@ -232,7 +234,7 @@ def populate_pkg(dbpkg, repopkg, force=False, timestamp=None):
dbpkg.depends.all().delete()
deps = [create_depend(dbpkg, y) for y in repopkg.depends]
deps += [create_depend(dbpkg, y, True) for y in repopkg.optdepends]
- PackageDepend.objects.bulk_create(deps)
+ Depend.objects.bulk_create(deps)
dbpkg.conflicts.all().delete()
conflicts = [create_related(Conflict, dbpkg, y) for y in repopkg.conflicts]
diff --git a/devel/views.py b/devel/views.py
index 0f1c8d15..16b6acc6 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -26,11 +26,11 @@
from django.utils.http import http_date
from .models import UserProfile
-from main.models import Package, PackageDepend, PackageFile, TodolistPkg
+from main.models import Package, PackageFile, TodolistPkg
from main.models import Arch, Repo
from main.utils import utc_now
from news.models import News
-from packages.models import PackageRelation, Signoff
+from packages.models import PackageRelation, Signoff, Depend
from packages.utils import get_signoff_groups
from todolists.utils import get_annotated_todolists
from .utils import get_annotated_maintainers, UserFinder
@@ -267,7 +267,7 @@ def report(request, report_name, username=None):
elif report_name == 'unneeded-orphans':
title = 'Orphan packages required by no other packages'
owned = PackageRelation.objects.all().values('pkgbase')
- required = PackageDepend.objects.all().values('depname')
+ required = Depend.objects.all().values('name')
# The two separate calls to exclude is required to do the right thing
packages = packages.exclude(pkgbase__in=owned).exclude(
pkgname__in=required)
diff --git a/main/models.py b/main/models.py
index 4b445dd0..f17d4a4d 100644
--- a/main/models.py
+++ b/main/models.py
@@ -180,11 +180,12 @@ def get_requiredby(self):
list slim by including the corresponding package in the same testing
category as this package if that check makes sense.
"""
+ from packages.models import Depend
provides = set(self.provides.values_list('name', flat=True))
provides.add(self.pkgname)
- requiredby = PackageDepend.objects.select_related('pkg',
+ requiredby = Depend.objects.select_related('pkg',
'pkg__arch', 'pkg__repo').filter(
- depname__in=provides).order_by(
+ name__in=provides).order_by(
'pkg__pkgname', 'pkg__arch__name', 'pkg__repo__name')
if not self.arch.agnostic:
# make sure we match architectures if possible
@@ -232,7 +233,7 @@ def get_depends(self):
deps = []
arches = None
# TODO: we can use list comprehension and an 'in' query to make this more effective
- for dep in self.depends.order_by('optional', 'depname'):
+ for dep in self.depends.order_by('optional', 'name'):
pkg = dep.get_best_satisfier()
providers = None
if not pkg:
diff --git a/packages/models.py b/packages/models.py
index c7b1cab4..cb65f1f1 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -228,10 +228,6 @@ def get_best_satisfier(self):
'''Find a satisfier for this related package that best matches the
given criteria. It will not search provisions, but will find packages
named and matching repo characteristics if possible.'''
- # NOTE: this is cribbed directly from the PackageDepend method of the
- # same name. Really, all of these things could use the same method if
- # the PackageDepend class was moved here and field names were changed
- # to match the layout we use here.
pkgs = Package.objects.normal().filter(pkgname=self.name)
if not self.pkg.arch.agnostic:
# make sure we match architectures if possible
@@ -258,6 +254,36 @@ def get_best_satisfier(self):
return pkg
+ def get_providers(self):
+ '''Return providers of this related package. Does *not* include exact
+ matches as it checks the Provision names only, use get_best_satisfier()
+ instead for exact matches.'''
+ pkgs = Package.objects.normal().filter(
+ provides__name=self.name).order_by().distinct()
+ if not self.pkg.arch.agnostic:
+ # make sure we match architectures if possible
+ arches = self.pkg.applicable_arches()
+ pkgs = pkgs.filter(arch__in=arches)
+
+ # Logic here is to filter out packages that are in multiple repos if
+ # they are not requested. For example, if testing is False, only show a
+ # testing package if it doesn't exist in a non-testing repo.
+ filtered = {}
+ for package in pkgs:
+ if package.pkgname not in filtered or \
+ package.repo.staging == self.pkg.repo.staging:
+ filtered[package.pkgname] = package
+ pkgs = filtered.values()
+
+ filtered = {}
+ for package in pkgs:
+ if package.pkgname not in filtered or \
+ package.repo.testing == self.pkg.repo.testing:
+ filtered[package.pkgname] = package
+ pkgs = filtered.values()
+
+ return pkgs
+
def __unicode__(self):
if self.version:
return u'%s%s%s' % (self.name, self.comparison, self.version)
diff --git a/packages/utils.py b/packages/utils.py
index 8d00bd68..82313472 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -7,10 +7,10 @@
from django.db.models import Count, Max, F
from django.contrib.auth.models import User
-from main.models import Package, PackageDepend, PackageFile, Arch, Repo
+from main.models import Package, PackageFile, Arch, Repo
from main.utils import cache_function, groupby_preserve_order, PackageStandin
from .models import (PackageGroup, PackageRelation,
- License, Conflict, Provision, Replacement,
+ License, Depend, Conflict, Provision, Replacement,
SignoffSpecification, Signoff, DEFAULT_SIGNOFF_SPEC)
@cache_function(127)
@@ -451,7 +451,7 @@ def default(self, obj):
return obj.name.lower()
if isinstance(obj, (PackageGroup, License)):
return obj.name
- if isinstance(obj, (Conflict, Provision, Replacement, PackageDepend)):
+ if isinstance(obj, (Depend, Conflict, Provision, Replacement)):
return unicode(obj)
elif isinstance(obj, User):
return obj.username
diff --git a/templates/packages/details_depend.html b/templates/packages/details_depend.html
index 8b6e85c9..0cf2c36a 100644
--- a/templates/packages/details_depend.html
+++ b/templates/packages/details_depend.html
@@ -2,12 +2,12 @@
{% pkg_details_link req.pkg %}
-{% if req.depname != pkg.pkgname %}(requires {{ req.depname }}){% endif %}
+{% if req.name != pkg.pkgname %}(requires {{ req.name }}){% endif %}
{% if req.pkg.repo.testing %}(testing){% endif %}
{% if req.pkg.repo.staging %}(staging){% endif %}
{% if req.optional %}(optional){% endif %}
--
cgit v1.2.3-54-g00ecf
From eef1ee7051093b9f6e74ab5669af8c57983872d9 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 19 May 2012 16:32:17 -0500
Subject: Add RSS links to /news/ and /packages/ URLs
These were available only from the home page, but it makes sense to
advertise them on the corresponding index pages too.
Signed-off-by: Dan McGee
---
templates/news/list.html | 4 ++++
templates/packages/search.html | 1 +
2 files changed, 5 insertions(+)
(limited to 'templates/packages')
diff --git a/templates/news/list.html b/templates/news/list.html
index a72a2dda..e85ceced 100644
--- a/templates/news/list.html
+++ b/templates/news/list.html
@@ -1,6 +1,10 @@
{% extends "base.html" %}
{% block title %}Arch Linux - News{% endblock %}
+{% block head %}
+
+{% endblock %}
+
{% block content %}
diff --git a/templates/packages/search.html b/templates/packages/search.html
index ebd4e6c4..df5c5791 100644
--- a/templates/packages/search.html
+++ b/templates/packages/search.html
@@ -8,6 +8,7 @@
{% block head %}
{% if is_paginated and page_obj.number > 1 %}{% endif %}
+
{% endblock %}
{% block content %}
--
cgit v1.2.3-54-g00ecf
From b88ef911b8c5e62b23ceb6d13d1a7a4f1b176f7f Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sun, 1 Jul 2012 20:42:24 -0500
Subject: Update flag out of date verbiage when orphans are involved
From FS#29922, indicate what happens if the package is unmaintained.
Signed-off-by: Dan McGee
---
templates/packages/flaghelp.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'templates/packages')
diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html
index 399b7e01..c298b5c5 100644
--- a/templates/packages/flaghelp.html
+++ b/templates/packages/flaghelp.html
@@ -18,7 +18,8 @@
Flagging Packages
stable release available), then please notify us by
using the Flag button in the Package Details
screen. This will notify the maintainer(s) responsible for that
- package so they can update it.
+ package so they can update it. If the package is unmaintained, the
+ notification will be sent to a developer mailing list.
The message box portion of the flag utility is optional, and meant
for short messages only. If you need more than 200 characters for your
--
cgit v1.2.3-54-g00ecf
From ca86b8d339ff3b8e74ac6d2ccf8a14458a690cf5 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Thu, 5 Jul 2012 17:36:22 -0500
Subject: Collapse the dependencies and required by lists when they are long
For now, this happens when the lists are over 20 items. Using JS, hide
the 21st and following packages listed in the list and replace them with
a 'Show More...' link that users can click to get the full list.
For a package such as glibc with 444 'Required By' entries, this can
make quite a visual difference.
Signed-off-by: Dan McGee
---
sitestatic/archweb.js | 26 ++++++++++++++++++++++++--
templates/packages/details.html | 10 +++++++---
2 files changed, 31 insertions(+), 5 deletions(-)
(limited to 'templates/packages')
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 248be7a6..12b7c702 100644
--- a/sitestatic/archweb.js
+++ b/sitestatic/archweb.js
@@ -126,9 +126,9 @@ if (typeof $.tablesorter !== 'undefined') {
(function($) {
$.fn.enableCheckboxRangeSelection = function() {
var lastCheckbox = null;
- var lastElement = null;
+ var lastElement = null;
- var spec = this;
+ var spec = this;
spec.unbind("click.checkboxrange");
spec.bind("click.checkboxrange", function(e) {
if (lastCheckbox != null && e.shiftKey) {
@@ -170,6 +170,28 @@ function ajaxifyFiles() {
});
}
+function collapseDependsList(list) {
+ var limit = 20;
+ // hide everything past a given limit, but don't do anything if we don't
+ // enough items that it is worth adding the link
+ list = $(list);
+ var items = list.find('li').slice(limit);
+ if (items.length == 0) {
+ return;
+ }
+ items.hide();
+ var linkid = list.attr('id') + 'link';
+ list.after('
');
+
+ // add links and wire them up to show the hidden items
+ $('#' + linkid).click(function(event) {
+ event.preventDefault();
+ list.find('li').show();
+ // remove the full node from the DOM
+ $(this).parent().remove();
+ });
+}
+
/* packages/differences.html */
function filter_packages() {
/* start with all rows, and then remove ones we shouldn't show */
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 358ab525..201e3074 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -186,7 +186,7 @@
Versions Elsewhere
Dependencies ({{deps|length}})
- {% if deps %}
+ {% if deps %}
{% for depend in deps %}{% include "packages/details_depend.html" %}{% endfor %}
{% endif %}
@@ -196,7 +196,7 @@
Required By ({{rqdby|length}})
- {% if rqdby %}
+ {% if rqdby %}
{% for req in rqdby %}{% include "packages/details_requiredby.html" %}{% endfor %}
{% endif %}
@@ -219,6 +219,10 @@
{% load cdn %}{% jquery %}
{% endblock %}
--
cgit v1.2.3-54-g00ecf
From 8383a071608329c7683f7a710030ce945bd20b4d Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sun, 8 Jul 2012 23:30:48 -0500
Subject: Add a new jquery_tablesorter CDN template tag
And use it everywhere we were including the file before. This should
make updating the version a heck of a lot easier.
Signed-off-by: Dan McGee
---
main/templatetags/cdn.py | 7 +++++++
templates/devel/clock.html | 3 +--
templates/devel/index.html | 3 +--
templates/devel/packages.html | 3 +--
templates/mirrors/mirror_details.html | 3 +--
templates/mirrors/mirrors.html | 3 +--
templates/mirrors/status.html | 3 +--
templates/packages/differences.html | 3 +--
templates/packages/groups.html | 3 +--
templates/packages/packages_list.html | 3 +--
templates/packages/signoffs.html | 3 +--
templates/packages/stale_relations.html | 3 +--
templates/public/keys.html | 3 +--
templates/releng/iso_overview.html | 3 +--
templates/releng/result_list.html | 3 +--
templates/todolists/list.html | 3 +--
templates/todolists/public_list.html | 3 +--
templates/todolists/view.html | 3 +--
18 files changed, 24 insertions(+), 34 deletions(-)
(limited to 'templates/packages')
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index ab5d881a..54299823 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -17,4 +17,11 @@ def jquery():
link = staticfiles_storage.url(filename)
return '' % link
+
+@register.simple_tag
+def jquery_tablesorter():
+ filename = 'jquery.tablesorter.min.js'
+ link = staticfiles_storage.url(filename)
+ return '' % link
+
# vim: set ts=4 sw=4 et:
diff --git a/templates/devel/clock.html b/templates/devel/clock.html
index 6a3f0a69..9ebea06c 100644
--- a/templates/devel/clock.html
+++ b/templates/devel/clock.html
@@ -52,8 +52,7 @@
{% pkg_details_link req.pkg %}
-{% if req.name != pkg.pkgname %}(requires {{ req.name }})
-{% endif %}{% if req.pkg.repo.testing %}(testing)
-{% endif %}{% if req.pkg.repo.staging %}(staging)
-{% endif %}{% if req.deptype == 'O' %}(optional)
-{% endif %}{% if req.deptype == 'M' %}(make)
-{% endif %}{% if req.deptype == 'C' %}(check)
+{% if req.name != pkg.pkgname %} (requires {{ req.name }})
+{% endif %}{% if req.pkg.repo.testing %} (testing)
+{% endif %}{% if req.pkg.repo.staging %} (staging)
+{% endif %}{% if req.deptype == 'O' %} (optional)
+{% endif %}{% if req.deptype == 'M' %} (make)
+{% endif %}{% if req.deptype == 'C' %} (check)
{% endif %}
{% endspaceless %}
--
cgit v1.2.3-54-g00ecf
From 7d9ed0b881bd05878e7a54f785c2551bc6e336d6 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Tue, 7 Aug 2012 01:16:51 -0500
Subject: Add reverse conflicts to package details
This is a place where calling vercmp could come in really handy.
Signed-off-by: Dan McGee
---
main/models.py | 10 ++++++++++
templates/packages/details.html | 13 ++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
(limited to 'templates/packages')
diff --git a/main/models.py b/main/models.py
index 7d8ea755..b49edde3 100644
--- a/main/models.py
+++ b/main/models.py
@@ -258,6 +258,16 @@ def sort_key(val):
return (sort_order.get(dep.deptype, 1000), dep.name)
return sorted(deps, key=sort_key)
+ @cache_function(123)
+ def reverse_conflicts(self):
+ """
+ Returns a list of packages with conflicts against this package.
+ """
+ # TODO: fix this; right now we cheat since we can't do proper version
+ # number checking without using alpm or vercmp directly.
+ return Package.objects.filter(conflicts__name=self.pkgname,
+ conflicts__comparison='').distinct()
+
@cache_function(125)
def base_package(self):
"""
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 201e3074..9e898b7f 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -126,16 +126,23 @@
Versions Elsewhere
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
+ {% with pkg.replaces.all as all_related %}{% if all_related %}
+
+
Replaces:
+
{% include "packages/details_relatedto.html" %}
+
+ {% endif %}{% endwith %}
{% with pkg.conflicts.all as all_related %}{% if all_related %}
Conflicts:
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
- {% with pkg.replaces.all as all_related %}{% if all_related %}
+ {% with pkg.reverse_conflicts as rev_conflicts %}{% if rev_conflicts %}
-
Replaces:
-
{% include "packages/details_relatedto.html" %}
+
Reverse Conflicts:
+
{% for conflict in rev_conflicts %}
+ {% pkg_details_link conflict %}{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}{% endwith %}
--
cgit v1.2.3-54-g00ecf
From 585b53a52a441761690ef81cd293597f38fa8a2f Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 8 Sep 2012 11:08:36 -0500
Subject: Add structured data markup from schema.org to package details
This might help out search engines show more helpful blurbs for our
package details pages. Tested using the Google Rich Snippets Testing
Tool at http://www.google.com/webmasters/tools/richsnippets.
Signed-off-by: Dan McGee
---
templates/packages/details.html | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
(limited to 'templates/packages')
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 9e898b7f..5a5598a0 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -72,6 +72,17 @@
{% endwith %}
-
{% with pkg.get_requiredby as rqdby %}
@@ -208,7 +218,6 @@
{% endif %}
{% endwith %}
-
Package Contents
@@ -218,9 +227,7 @@
View the file list for {{ pkg.pkgname }}
-
-
{% load cdn %}{% jquery %}
--
cgit v1.2.3-54-g00ecf
From 6e1712b4d6c7525e03c5fac775fa16406dd4009f Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sun, 30 Sep 2012 10:31:20 -0500
Subject: Show full date and time for package last update
Now that we do updates on the fly and not just once an hour, we can
afford to show a bit more granularity here.
Signed-off-by: Dan McGee
---
templates/packages/details.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'templates/packages')
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 5a5598a0..5a93ce23 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -189,7 +189,7 @@
Versions Elsewhere
Unsigned
{% endif %}
Last Updated:
-
{{ pkg.last_update|date }}
+
{{ pkg.last_update|date:"DATETIME_FORMAT" }} UTC
{% if user.is_authenticated %}{% with pkg.flag_request as flag_request %}{% if flag_request %}
Last Flag Request:
--
cgit v1.2.3-54-g00ecf
From febf5e92233738198107a69f66c9f3443b4306c7 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sun, 30 Sep 2012 18:18:19 -0500
Subject: Collapse long lists of related packages
Just like we did with the rows of depends and required by, collapse down
conflicts, provides, etc. comma-separated lists if they grow too large.
Signed-off-by: Dan McGee
---
sitestatic/archweb.js | 24 +++++++++++++++++++++++-
templates/packages/details.html | 13 +++++++------
templates/packages/details_relatedto.html | 12 ++----------
3 files changed, 32 insertions(+), 17 deletions(-)
(limited to 'templates/packages')
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 783f75c6..a42e0208 100644
--- a/sitestatic/archweb.js
+++ b/sitestatic/archweb.js
@@ -206,7 +206,7 @@ function collapseDependsList(list) {
// enough items, or the link already exists.
var linkid = list.attr('id') + 'link';
var items = list.find('li').slice(limit);
- if (items.length == 0 || $('#' + linkid).length > 0) {
+ if (items.length <= 1 || $('#' + linkid).length > 0) {
return;
}
items.hide();
@@ -221,6 +221,28 @@ function collapseDependsList(list) {
});
}
+function collapseRelatedTo(elements) {
+ var limit = 5;
+ $(elements).each(function(idx, ele) {
+ ele = $(ele);
+ // Hide everything past a given limit. Don't do anything if we don't
+ // have enough items, or the link already exists.
+ var items = ele.find('span.related').slice(limit);
+ if (items.length <= 1 || ele.find('a.morelink').length > 0) {
+ return;
+ }
+ items.hide();
+ ele.append('More…');
+
+ // add link and wire it up to show the hidden items
+ ele.find('a.morelink').click(function(event) {
+ event.preventDefault();
+ ele.find('span.related').show();
+ $(this).remove();
+ });
+ });
+}
+
/* packages/differences.html */
function filter_packages() {
/* start with all rows, and then remove ones we shouldn't show */
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 5a93ce23..aa073551 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -97,7 +97,7 @@
Versions Elsewhere
{% with pkg.split_packages as splits %}{% if splits %}
Split Packages:
-
{% for s in splits %}{% pkg_details_link s %}{% if not forloop.last %}, {% endif %}{% endfor %}
+
{% for s in splits %}{% pkg_details_link s %}{% if not forloop.last %}, {% endif %}{% endfor %}
{% with pkg.provides.all as all_related %}{% if all_related %}
Provides:
-
{% include "packages/details_relatedto.html" %}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
{% with pkg.replaces.all as all_related %}{% if all_related %}
Replaces:
-
{% include "packages/details_relatedto.html" %}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
{% with pkg.conflicts.all as all_related %}{% if all_related %}
Conflicts:
-
{% include "packages/details_relatedto.html" %}
+
{% include "packages/details_relatedto.html" %}
{% endif %}{% endwith %}
{% with pkg.reverse_conflicts as rev_conflicts %}{% if rev_conflicts %}
Reverse Conflicts:
-
{% for conflict in rev_conflicts %}
- {% pkg_details_link conflict %}{% if not forloop.last %}, {% endif %}{% endfor %}
+
{% for conflict in rev_conflicts %}
+ {% pkg_details_link conflict %}{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}{% endwith %}
@@ -237,6 +237,7 @@
ajaxifyFiles();
collapseDependsList("#pkgdepslist");
collapseDependsList("#pkgreqslist");
+ collapseRelatedTo(".relatedto");
});
{% endblock %}
diff --git a/templates/packages/details_relatedto.html b/templates/packages/details_relatedto.html
index 1ffe2884..e14375d3 100644
--- a/templates/packages/details_relatedto.html
+++ b/templates/packages/details_relatedto.html
@@ -1,10 +1,2 @@
-{% load package_extras %}
-{% for related in all_related %}
-{% with related.get_best_satisfier as best_satisfier %}
-{% ifequal best_satisfier None %}
-{{ related.name }}{{ related.comparison|default:"" }}{{ related.version|default:"" }}{% if not forloop.last %}, {% endif %}
-{% else %}
-{% pkg_details_link best_satisfier %}{{ related.comparison|default:"" }}{{related.version|default:"" }}{% if not forloop.last %}, {% endif %}
-{% endifequal %}
-{% endwith %}
-{% endfor %}
+{% load package_extras %}{% for related in all_related %}{% with related.get_best_satisfier as best_satisfier %}{% ifequal best_satisfier None %}{{ related.name }}{% else %}{% pkg_details_link best_satisfier %}{% endifequal %}{{ related.comparison|default:"" }}{{ related.version|default:"" }}{% if not forloop.last %}, {% endif %}
+{% endwith %}{% endfor %}
--
cgit v1.2.3-54-g00ecf
From eea25558c766d5f3a32879d16e579d051906cbf3 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Tue, 27 Nov 2012 08:48:01 -0600
Subject: Don't cache package properties as aggressively
For package signatures, it turns out it is way cheaper to just parse the
signature again rather than going though all the decorator and
cache_function_key business. This speeds up the mismatched signatures
report significantly once this is removed.
For base_package, given that we only call it once from our package
details template, it makes little sense to cache the result.
Signed-off-by: Dan McGee
---
main/models.py | 3 ---
templates/packages/details.html | 6 +++---
2 files changed, 3 insertions(+), 6 deletions(-)
(limited to 'templates/packages')
diff --git a/main/models.py b/main/models.py
index cc81637c..603d7ccc 100644
--- a/main/models.py
+++ b/main/models.py
@@ -141,7 +141,6 @@ def get_full_url(self, proto='https'):
return '%s://%s%s' % (proto, domain, self.get_absolute_url())
@property
- @cache_function(15)
def signature(self):
try:
data = b64decode(self.pgp_signature)
@@ -154,7 +153,6 @@ def signature(self):
return packets[0]
@property
- @cache_function(15)
def signer(self):
sig = self.signature
if sig and sig.key_id:
@@ -318,7 +316,6 @@ def reverse_conflicts(self):
new_pkgs.append(package)
return new_pkgs
- @cache_function(125)
def base_package(self):
"""
Locate the base package for this package. It may be this very package,
diff --git a/templates/packages/details.html b/templates/packages/details.html
index aa073551..0a47217c 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -103,12 +103,12 @@
Versions Elsewhere
{% else %}
Base Package:
- {% if pkg.base_package %}
-
{% pkg_details_link pkg.base_package %}
+ {% with pkg.base_package as base %}{% if base %}
+
--
cgit v1.2.3-54-g00ecf
From 8a8542ede6493939bd6528a72b8fd912fdf4d14b Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Tue, 11 Dec 2012 10:02:26 -0600
Subject: Use multiple separate document.ready() handlers
If one of them breaks, we don't want to prevent the rest of the on-load
events from firing. This is currently a problem on some browsers with
the versions of jQuery and tablesorter we are using.
Signed-off-by: Dan McGee
---
templates/devel/packages.html | 4 +++-
templates/packages/differences.html | 5 +++--
templates/packages/signoffs.html | 6 ++++--
templates/todolists/view.html | 4 +++-
4 files changed, 13 insertions(+), 6 deletions(-)
(limited to 'templates/packages')
diff --git a/templates/devel/packages.html b/templates/devel/packages.html
index 4e1381ab..a62ae1ab 100644
--- a/templates/devel/packages.html
+++ b/templates/devel/packages.html
@@ -78,7 +78,9 @@
--
cgit v1.2.3-54-g00ecf
From 746023d529489b68f1a2494ff7572734b3b368ce Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 16 Feb 2013 15:38:29 -0600
Subject: Make page a query string parameter on package search
This is a bit silly to encode in the URL, or at least makes it much
harder to screen out via robots.txt and other such things.
Signed-off-by: Dan McGee
---
packages/urls.py | 1 -
packages/views/display.py | 2 ++
templates/packages/search_paginator.html | 4 ++--
3 files changed, 4 insertions(+), 3 deletions(-)
(limited to 'templates/packages')
diff --git a/packages/urls.py b/packages/urls.py
index 9a151b4b..4e2e2638 100644
--- a/packages/urls.py
+++ b/packages/urls.py
@@ -24,7 +24,6 @@
(r'^update/$', 'update'),
(r'^$', SearchListView.as_view(), {}, 'packages-search'),
- (r'^(?P\d+)/$', SearchListView.as_view()),
(r'^search/json/$', 'search_json'),
(r'^differences/$', 'arch_differences', {}, 'packages-differences'),
diff --git a/packages/views/display.py b/packages/views/display.py
index 497c8d48..fcf8fdea 100644
--- a/packages/views/display.py
+++ b/packages/views/display.py
@@ -104,6 +104,8 @@ def redirect_agnostic(request, name, repo, arch):
def redirect_to_search(request, name, repo, arch):
+ if request.GET.get('q'):
+ name = request.GET.get('q')
pkg_data = [
('arch', arch.lower()),
('repo', repo.lower()),
diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html
index 758dca4c..3c368b82 100644
--- a/templates/packages/search_paginator.html
+++ b/templates/packages/search_paginator.html
@@ -6,7 +6,7 @@
{% if page_obj.has_previous %}
- < Prev
{% else %}
< Prev
@@ -14,7 +14,7 @@
{% if page_obj.has_next %}
- Next >
{% else %}
Next >
--
cgit v1.2.3-54-g00ecf
From 95ceb2a4a42093c9fd728e9e3d546943bc7b0b9d Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 20 Apr 2013 11:03:00 -0500
Subject: Remove spaceless from depends and required by template fragments
This was a bit of premature optimization, and ends up slowing the page
generation a good amount since we have to run this ~400 times on some
packages with long depends or required by lists. Webserver compression
should handle this just fine and not result in too much page bloat.
Signed-off-by: Dan McGee
---
templates/packages/details_depend.html | 5 ++---
templates/packages/details_requiredby.html | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
(limited to 'templates/packages')
diff --git a/templates/packages/details_depend.html b/templates/packages/details_depend.html
index 4aa739c2..b89ffbfa 100644
--- a/templates/packages/details_depend.html
+++ b/templates/packages/details_depend.html
@@ -1,5 +1,4 @@
-{% load package_extras %}{% spaceless %}
{% pkg_details_link req.pkg %}
{% if req.name != pkg.pkgname %} (requires {{ req.name }})
{% endif %}{% if req.pkg.repo.testing %} (testing)
{% endif %}{% if req.pkg.repo.staging %} (staging)
{% endif %}{% if req.deptype == 'O' %} (optional)
{% endif %}{% if req.deptype == 'M' %} (make)
{% endif %}{% if req.deptype == 'C' %} (check)
-{% endif %}
{% endspaceless %}
+{% endif %}
--
cgit v1.2.3-54-g00ecf
From b519c40e0af5b86ba660cf9d9cfc53a66fd8bef8 Mon Sep 17 00:00:00 2001
From: Dan McGee
Date: Sat, 20 Apr 2013 11:11:04 -0500
Subject: Remove {% spaceless %} tag from a few more places
This tag is simply not worth the time it takes to do what it does.
Signed-off-by: Dan McGee
---
templates/mirrors/status.html | 6 ++----
templates/mirrors/status_table.html | 6 ++----
templates/packages/search.html | 6 ++----
templates/packages/signoffs.html | 8 ++------
4 files changed, 8 insertions(+), 18 deletions(-)
(limited to 'templates/packages')
diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html
index 8d32d3fa..26e81e79 100644
--- a/templates/mirrors/status.html
+++ b/templates/mirrors/status.html
@@ -87,16 +87,14 @@