summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 22:00:57 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 22:00:57 -0400
commit05430050147c87818c08373e9930756da4d6b5ac (patch)
tree24db1d6ca431ff64f91e3f41547b91687c4aedd7
parent86bd3d5e4920fd6d57ac51ed3abf02d2f368f2a7 (diff)
parent1a35cbe842212d674d83196ecfa70569ffe2e2da (diff)
Merge tag 'release_2014-11-08' into archweb-generic
Mirror status and details switch to Jinja2
-rw-r--r--devel/fixtures/staff_groups.json72
-rw-r--r--main/fixtures/groups.json961
-rw-r--r--main/templatetags/pgp.py19
-rw-r--r--mirrors/models.py1
-rw-r--r--mirrors/templatetags/jinja2.py53
-rw-r--r--mirrors/templatetags/mirror_status.py7
-rw-r--r--packages/templatetags/jinja2.py1
-rw-r--r--public/views.py37
-rw-r--r--sitestatic/download.pngbin0 -> 1155 bytes
-rw-r--r--sitestatic/magnet.pngbin0 -> 2382 bytes
-rw-r--r--templates/mirrors/error_table.html.jinja (renamed from templates/mirrors/error_table.html)8
-rw-r--r--templates/mirrors/mirror_details.html40
-rw-r--r--templates/mirrors/mirror_details_urls.html.jinja36
-rw-r--r--templates/mirrors/status.html6
-rw-r--r--templates/mirrors/status_table.html30
-rw-r--r--templates/mirrors/status_table.html.jinja28
-rw-r--r--templates/mirrors/url_details.html29
-rw-r--r--templates/mirrors/url_details_logs.html.jinja26
-rw-r--r--templates/public/download.html4
-rw-r--r--templates/public/keys.html4
-rw-r--r--templates/releng/release_detail.html15
-rw-r--r--templates/releng/release_list.html25
-rw-r--r--visualize/static/visualize.js5
23 files changed, 783 insertions, 624 deletions
diff --git a/devel/fixtures/staff_groups.json b/devel/fixtures/staff_groups.json
new file mode 100644
index 00000000..6a0a0514
--- /dev/null
+++ b/devel/fixtures/staff_groups.json
@@ -0,0 +1,72 @@
+[
+{
+ "fields": {
+ "group": [
+ "Developers"
+ ],
+ "description": "This is a list of the current Arch Linux Developers. They maintain the [core] and [extra] package repositories in addition to doing any other developer duties.",
+ "sort_order": 1,
+ "member_title": "Developer",
+ "slug": "developers",
+ "name": "Developers"
+ },
+ "model": "devel.staffgroup",
+ "pk": 1
+},
+{
+ "fields": {
+ "group": [
+ "Trusted Users"
+ ],
+ "description": "Here are all your friendly Arch Linux Trusted Users who are in charge of the [community] repository.",
+ "sort_order": 2,
+ "member_title": "Trusted User",
+ "slug": "trusted-users",
+ "name": "Trusted Users"
+ },
+ "model": "devel.staffgroup",
+ "pk": 2
+},
+{
+ "fields": {
+ "group": [
+ "Retired Developers"
+ ],
+ "description": "Below you can find a list of ex-developers (aka project fellows). These folks helped make Arch what it is today. Thanks!",
+ "sort_order": 11,
+ "member_title": "Fellow",
+ "slug": "developer-fellows",
+ "name": "Developer Fellows"
+ },
+ "model": "devel.staffgroup",
+ "pk": 3
+},
+{
+ "fields": {
+ "group": [
+ "Retired Trusted Users"
+ ],
+ "description": "Below you can find a list of ex-trusted users (aka fellows). These folks helped make Arch what it is today. Thanks!",
+ "sort_order": 12,
+ "member_title": "Fellow",
+ "slug": "trusted-user-fellows",
+ "name": "Trusted User Fellows"
+ },
+ "model": "devel.staffgroup",
+ "pk": 4
+},
+{
+ "fields": {
+ "group": [
+ "Support Staff"
+ ],
+ "description": "These are the unheralded people that keep things running behind the scenes. Forum moderators, wiki admins, IRC moderators, mirror maintenance, and everything else that keeps a Linux distro running smoothly.",
+ "sort_order": 5,
+ "member_title": "Staff",
+ "slug": "support-staff",
+ "name": "Support Staff"
+ },
+ "model": "devel.staffgroup",
+ "pk": 5
+}
+]
diff --git a/main/fixtures/groups.json b/main/fixtures/groups.json
index 134b98b3..2205be7c 100644
--- a/main/fixtures/groups.json
+++ b/main/fixtures/groups.json
@@ -1,475 +1,504 @@
[
- {
- "pk": 1,
- "model": "auth.group",
- "fields": {
- "name": "Developers",
- "permissions": [
- [
- "change_package",
- "main",
- "package"
- ],
- [
- "add_news",
- "news",
- "news"
- ],
- [
- "change_news",
- "news",
- "news"
- ],
- [
- "add_signoff",
- "packages",
- "signoff"
- ],
- [
- "change_signoff",
- "packages",
- "signoff"
- ],
- [
- "add_signoffspecification",
- "packages",
- "signoffspecification"
- ],
- [
- "change_signoffspecification",
- "packages",
- "signoffspecification"
- ],
- [
- "add_todolist",
- "todolists",
- "todolist"
- ],
- [
- "change_todolist",
- "todolists",
- "todolist"
- ],
- [
- "add_todolistpackage",
- "todolists",
- "todolistpackage"
- ],
- [
- "change_todolistpackage",
- "todolists",
- "todolistpackage"
- ],
- [
- "delete_todolistpackage",
- "todolists",
- "todolistpackage"
- ]
+{
+ "fields": {
+ "name": "Developers",
+ "permissions": [
+ [
+ "change_package",
+ "main",
+ "package"
+ ],
+ [
+ "add_news",
+ "news",
+ "news"
+ ],
+ [
+ "change_news",
+ "news",
+ "news"
+ ],
+ [
+ "add_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "change_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "add_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "change_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "add_todolist",
+ "todolists",
+ "todolist"
+ ],
+ [
+ "change_todolist",
+ "todolists",
+ "todolist"
+ ],
+ [
+ "add_todolistpackage",
+ "todolists",
+ "todolistpackage"
+ ],
+ [
+ "change_todolistpackage",
+ "todolists",
+ "todolistpackage"
+ ],
+ [
+ "delete_todolistpackage",
+ "todolists",
+ "todolistpackage"
]
- }
- },
- {
- "pk": 2,
- "model": "auth.group",
- "fields": {
- "name": "Trusted Users",
- "permissions": [
- [
- "change_package",
- "main",
- "package"
- ],
- [
- "add_signoff",
- "packages",
- "signoff"
- ],
- [
- "change_signoff",
- "packages",
- "signoff"
- ],
- [
- "add_signoffspecification",
- "packages",
- "signoffspecification"
- ],
- [
- "change_signoffspecification",
- "packages",
- "signoffspecification"
- ],
- [
- "add_todolist",
- "todolists",
- "todolist"
- ],
- [
- "change_todolist",
- "todolists",
- "todolist"
- ],
- [
- "add_todolistpackage",
- "todolists",
- "todolistpackage"
- ],
- [
- "change_todolistpackage",
- "todolists",
- "todolistpackage"
- ],
- [
- "delete_todolistpackage",
- "todolists",
- "todolistpackage"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 1
+},
+{
+ "fields": {
+ "name": "Trusted Users",
+ "permissions": [
+ [
+ "change_package",
+ "main",
+ "package"
+ ],
+ [
+ "add_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "change_signoff",
+ "packages",
+ "signoff"
+ ],
+ [
+ "add_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "change_signoffspecification",
+ "packages",
+ "signoffspecification"
+ ],
+ [
+ "add_todolist",
+ "todolists",
+ "todolist"
+ ],
+ [
+ "change_todolist",
+ "todolists",
+ "todolist"
+ ],
+ [
+ "add_todolistpackage",
+ "todolists",
+ "todolistpackage"
+ ],
+ [
+ "change_todolistpackage",
+ "todolists",
+ "todolistpackage"
+ ],
+ [
+ "delete_todolistpackage",
+ "todolists",
+ "todolistpackage"
]
- }
- },
- {
- "pk": 3,
- "model": "auth.group",
- "fields": {
- "name": "Mirror Maintainers",
- "permissions": [
- [
- "add_mirror",
- "mirrors",
- "mirror"
- ],
- [
- "change_mirror",
- "mirrors",
- "mirror"
- ],
- [
- "delete_mirror",
- "mirrors",
- "mirror"
- ],
- [
- "add_mirrorprotocol",
- "mirrors",
- "mirrorprotocol"
- ],
- [
- "change_mirrorprotocol",
- "mirrors",
- "mirrorprotocol"
- ],
- [
- "add_mirrorrsync",
- "mirrors",
- "mirrorrsync"
- ],
- [
- "change_mirrorrsync",
- "mirrors",
- "mirrorrsync"
- ],
- [
- "delete_mirrorrsync",
- "mirrors",
- "mirrorrsync"
- ],
- [
- "add_mirrorurl",
- "mirrors",
- "mirrorurl"
- ],
- [
- "change_mirrorurl",
- "mirrors",
- "mirrorurl"
- ],
- [
- "delete_mirrorurl",
- "mirrors",
- "mirrorurl"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 2
+},
+{
+ "fields": {
+ "name": "Mirror Maintainers",
+ "permissions": [
+ [
+ "add_mirror",
+ "mirrors",
+ "mirror"
+ ],
+ [
+ "change_mirror",
+ "mirrors",
+ "mirror"
+ ],
+ [
+ "delete_mirror",
+ "mirrors",
+ "mirror"
+ ],
+ [
+ "add_mirrorprotocol",
+ "mirrors",
+ "mirrorprotocol"
+ ],
+ [
+ "change_mirrorprotocol",
+ "mirrors",
+ "mirrorprotocol"
+ ],
+ [
+ "add_mirrorrsync",
+ "mirrors",
+ "mirrorrsync"
+ ],
+ [
+ "change_mirrorrsync",
+ "mirrors",
+ "mirrorrsync"
+ ],
+ [
+ "delete_mirrorrsync",
+ "mirrors",
+ "mirrorrsync"
+ ],
+ [
+ "add_mirrorurl",
+ "mirrors",
+ "mirrorurl"
+ ],
+ [
+ "change_mirrorurl",
+ "mirrors",
+ "mirrorurl"
+ ],
+ [
+ "delete_mirrorurl",
+ "mirrors",
+ "mirrorurl"
]
- }
- },
- {
- "pk": 4,
- "model": "auth.group",
- "fields": {
- "name": "User Admins",
- "permissions": [
- [
- "add_user",
- "auth",
- "user"
- ],
- [
- "change_user",
- "auth",
- "user"
- ],
- [
- "add_userprofile",
- "devel",
- "userprofile"
- ],
- [
- "change_userprofile",
- "devel",
- "userprofile"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 3
+},
+{
+ "fields": {
+ "name": "User Admins",
+ "permissions": [
+ [
+ "add_user",
+ "auth",
+ "user"
+ ],
+ [
+ "change_user",
+ "auth",
+ "user"
+ ],
+ [
+ "change_staffgroup",
+ "devel",
+ "staffgroup"
+ ],
+ [
+ "add_userprofile",
+ "devel",
+ "userprofile"
+ ],
+ [
+ "change_userprofile",
+ "devel",
+ "userprofile"
]
- }
- },
- {
- "pk": 5,
- "model": "auth.group",
- "fields": {
- "name": "Release Engineering",
- "permissions": [
- [
- "add_architecture",
- "releng",
- "architecture"
- ],
- [
- "change_architecture",
- "releng",
- "architecture"
- ],
- [
- "delete_architecture",
- "releng",
- "architecture"
- ],
- [
- "add_bootloader",
- "releng",
- "bootloader"
- ],
- [
- "change_bootloader",
- "releng",
- "bootloader"
- ],
- [
- "delete_bootloader",
- "releng",
- "bootloader"
- ],
- [
- "add_boottype",
- "releng",
- "boottype"
- ],
- [
- "change_boottype",
- "releng",
- "boottype"
- ],
- [
- "delete_boottype",
- "releng",
- "boottype"
- ],
- [
- "add_clockchoice",
- "releng",
- "clockchoice"
- ],
- [
- "change_clockchoice",
- "releng",
- "clockchoice"
- ],
- [
- "delete_clockchoice",
- "releng",
- "clockchoice"
- ],
- [
- "add_filesystem",
- "releng",
- "filesystem"
- ],
- [
- "change_filesystem",
- "releng",
- "filesystem"
- ],
- [
- "delete_filesystem",
- "releng",
- "filesystem"
- ],
- [
- "add_hardwaretype",
- "releng",
- "hardwaretype"
- ],
- [
- "change_hardwaretype",
- "releng",
- "hardwaretype"
- ],
- [
- "delete_hardwaretype",
- "releng",
- "hardwaretype"
- ],
- [
- "add_installtype",
- "releng",
- "installtype"
- ],
- [
- "change_installtype",
- "releng",
- "installtype"
- ],
- [
- "delete_installtype",
- "releng",
- "installtype"
- ],
- [
- "add_iso",
- "releng",
- "iso"
- ],
- [
- "change_iso",
- "releng",
- "iso"
- ],
- [
- "delete_iso",
- "releng",
- "iso"
- ],
- [
- "add_isotype",
- "releng",
- "isotype"
- ],
- [
- "change_isotype",
- "releng",
- "isotype"
- ],
- [
- "delete_isotype",
- "releng",
- "isotype"
- ],
- [
- "add_module",
- "releng",
- "module"
- ],
- [
- "change_module",
- "releng",
- "module"
- ],
- [
- "delete_module",
- "releng",
- "module"
- ],
- [
- "add_release",
- "releng",
- "release"
- ],
- [
- "change_release",
- "releng",
- "release"
- ],
- [
- "delete_release",
- "releng",
- "release"
- ],
- [
- "add_source",
- "releng",
- "source"
- ],
- [
- "change_source",
- "releng",
- "source"
- ],
- [
- "delete_source",
- "releng",
- "source"
- ],
- [
- "add_test",
- "releng",
- "test"
- ],
- [
- "change_test",
- "releng",
- "test"
- ],
- [
- "delete_test",
- "releng",
- "test"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 4
+},
+{
+ "fields": {
+ "name": "Release Engineering",
+ "permissions": [
+ [
+ "add_architecture",
+ "releng",
+ "architecture"
+ ],
+ [
+ "change_architecture",
+ "releng",
+ "architecture"
+ ],
+ [
+ "delete_architecture",
+ "releng",
+ "architecture"
+ ],
+ [
+ "add_bootloader",
+ "releng",
+ "bootloader"
+ ],
+ [
+ "change_bootloader",
+ "releng",
+ "bootloader"
+ ],
+ [
+ "delete_bootloader",
+ "releng",
+ "bootloader"
+ ],
+ [
+ "add_boottype",
+ "releng",
+ "boottype"
+ ],
+ [
+ "change_boottype",
+ "releng",
+ "boottype"
+ ],
+ [
+ "delete_boottype",
+ "releng",
+ "boottype"
+ ],
+ [
+ "add_clockchoice",
+ "releng",
+ "clockchoice"
+ ],
+ [
+ "change_clockchoice",
+ "releng",
+ "clockchoice"
+ ],
+ [
+ "delete_clockchoice",
+ "releng",
+ "clockchoice"
+ ],
+ [
+ "add_filesystem",
+ "releng",
+ "filesystem"
+ ],
+ [
+ "change_filesystem",
+ "releng",
+ "filesystem"
+ ],
+ [
+ "delete_filesystem",
+ "releng",
+ "filesystem"
+ ],
+ [
+ "add_hardwaretype",
+ "releng",
+ "hardwaretype"
+ ],
+ [
+ "change_hardwaretype",
+ "releng",
+ "hardwaretype"
+ ],
+ [
+ "delete_hardwaretype",
+ "releng",
+ "hardwaretype"
+ ],
+ [
+ "add_installtype",
+ "releng",
+ "installtype"
+ ],
+ [
+ "change_installtype",
+ "releng",
+ "installtype"
+ ],
+ [
+ "delete_installtype",
+ "releng",
+ "installtype"
+ ],
+ [
+ "add_iso",
+ "releng",
+ "iso"
+ ],
+ [
+ "change_iso",
+ "releng",
+ "iso"
+ ],
+ [
+ "delete_iso",
+ "releng",
+ "iso"
+ ],
+ [
+ "add_isotype",
+ "releng",
+ "isotype"
+ ],
+ [
+ "change_isotype",
+ "releng",
+ "isotype"
+ ],
+ [
+ "delete_isotype",
+ "releng",
+ "isotype"
+ ],
+ [
+ "add_module",
+ "releng",
+ "module"
+ ],
+ [
+ "change_module",
+ "releng",
+ "module"
+ ],
+ [
+ "delete_module",
+ "releng",
+ "module"
+ ],
+ [
+ "add_release",
+ "releng",
+ "release"
+ ],
+ [
+ "change_release",
+ "releng",
+ "release"
+ ],
+ [
+ "delete_release",
+ "releng",
+ "release"
+ ],
+ [
+ "add_source",
+ "releng",
+ "source"
+ ],
+ [
+ "change_source",
+ "releng",
+ "source"
+ ],
+ [
+ "delete_source",
+ "releng",
+ "source"
+ ],
+ [
+ "add_test",
+ "releng",
+ "test"
+ ],
+ [
+ "change_test",
+ "releng",
+ "test"
+ ],
+ [
+ "delete_test",
+ "releng",
+ "test"
]
- }
- },
- {
- "pk": 6,
- "model": "auth.group",
- "fields": {
- "name": "Package Relation Maintainers",
- "permissions": [
- [
- "add_packagerelation",
- "packages",
- "packagerelation"
- ],
- [
- "change_packagerelation",
- "packages",
- "packagerelation"
- ],
- [
- "delete_packagerelation",
- "packages",
- "packagerelation"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 5
+},
+{
+ "fields": {
+ "name": "Package Relation Maintainers",
+ "permissions": [
+ [
+ "add_packagerelation",
+ "packages",
+ "packagerelation"
+ ],
+ [
+ "change_packagerelation",
+ "packages",
+ "packagerelation"
+ ],
+ [
+ "delete_packagerelation",
+ "packages",
+ "packagerelation"
]
- }
- },
- {
- "pk": 8,
- "model": "auth.group",
- "fields": {
- "name": "Download Page Releases",
- "permissions": [
- [
- "add_release",
- "releng",
- "release"
- ],
- [
- "change_release",
- "releng",
- "release"
- ],
- [
- "delete_release",
- "releng",
- "release"
- ]
+ ]
+ },
+ "model": "auth.group",
+ "pk": 6
+},
+{
+ "fields": {
+ "name": "Download Page Releases",
+ "permissions": [
+ [
+ "add_release",
+ "releng",
+ "release"
+ ],
+ [
+ "change_release",
+ "releng",
+ "release"
+ ],
+ [
+ "delete_release",
+ "releng",
+ "release"
]
- }
- }
+ ]
+ },
+ "model": "auth.group",
+ "pk": 8
+},
+{
+ "fields": {
+ "name": "Retired Developers",
+ "permissions": []
+ },
+ "model": "auth.group",
+ "pk": 9
+},
+{
+ "fields": {
+ "name": "Retired Trusted Users",
+ "permissions": []
+ },
+ "model": "auth.group",
+ "pk": 10
+},
+{
+ "fields": {
+ "name": "Support Staff",
+ "permissions": []
+ },
+ "model": "auth.group",
+ "pk": 11
+}
]
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py
index 2417f688..455e8f9c 100644
--- a/main/templatetags/pgp.py
+++ b/main/templatetags/pgp.py
@@ -44,21 +44,14 @@ def pgp_key_link(key_id, link_text=None):
return '<a href="%s" title="PGP key search for %s">%s</a>' % values
-@cache_function(1741)
-def name_for_key(normalized):
- try:
- matching_key = DeveloperKey.objects.select_related(
- 'owner').get(key=normalized, owner_id__isnull=False)
- return matching_key.owner.get_full_name()
- except DeveloperKey.DoesNotExist:
- return None
-
-
@register.simple_tag
-def user_pgp_key_link(key_id):
+def user_pgp_key_link(dev_keys, key_id):
normalized = key_id[-16:]
- name = name_for_key(normalized)
- return pgp_key_link(key_id, name)
+ found = dev_keys.get(normalized, None)
+ if found:
+ return pgp_key_link(key_id, found.owner.get_full_name())
+ else:
+ return pgp_key_link(key_id, None)
@register.filter(needs_autoescape=True)
diff --git a/mirrors/models.py b/mirrors/models.py
index 820f3328..9743d177 100644
--- a/mirrors/models.py
+++ b/mirrors/models.py
@@ -165,6 +165,7 @@ class MirrorLog(models.Model):
is_success = models.BooleanField(default=True)
error = models.TextField(blank=True, default='')
+ @property
def delay(self):
if self.last_sync is None:
return None
diff --git a/mirrors/templatetags/jinja2.py b/mirrors/templatetags/jinja2.py
new file mode 100644
index 00000000..04e50238
--- /dev/null
+++ b/mirrors/templatetags/jinja2.py
@@ -0,0 +1,53 @@
+from datetime import timedelta
+from django_jinja import library
+from markupsafe import Markup
+
+
+@library.global_function
+def country_flag(country):
+ if not country:
+ return ''
+ html = '<span class="fam-flag fam-flag-%s" title="%s"></span> ' % (
+ unicode(country.code).lower(), unicode(country.name))
+ return Markup(html)
+
+
+@library.filter
+def duration(value):
+ if not value and type(value) != timedelta:
+ return u''
+ # does not take microseconds into account
+ total_secs = value.seconds + value.days * 24 * 3600
+ mins = total_secs // 60
+ hrs, mins = divmod(mins, 60)
+ return '%d:%02d' % (hrs, mins)
+
+
+@library.filter
+def hours(value):
+ if not value and type(value) != timedelta:
+ return u''
+ # does not take microseconds into account
+ total_secs = value.seconds + value.days * 24 * 3600
+ mins = total_secs // 60
+ hrs, mins = divmod(mins, 60)
+ if hrs == 1:
+ return '%d hour' % hrs
+ return '%d hours' % hrs
+
+
+@library.filter
+def floatvalue(value, arg=2):
+ if value is None:
+ return u''
+ return '%.*f' % (arg, value)
+
+
+@library.filter
+def percentage(value, arg=1):
+ if not value and type(value) != float:
+ return u''
+ new_val = value * 100.0
+ return '%.*f%%' % (arg, new_val)
+
+# vim: set ts=4 sw=4 et:
diff --git a/mirrors/templatetags/mirror_status.py b/mirrors/templatetags/mirror_status.py
index b3810d9a..c8004e4b 100644
--- a/mirrors/templatetags/mirror_status.py
+++ b/mirrors/templatetags/mirror_status.py
@@ -31,11 +31,4 @@ def floatvalue(value, arg=2):
return u''
return '%.*f' % (arg, value)
-@register.filter
-def percentage(value, arg=1):
- if not value and type(value) != float:
- return u''
- new_val = value * 100.0
- return '%.*f%%' % (arg, new_val)
-
# vim: set ts=4 sw=4 et:
diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py
index 22f9914b..88b59a96 100644
--- a/packages/templatetags/jinja2.py
+++ b/packages/templatetags/jinja2.py
@@ -68,5 +68,4 @@ def bug_report(package):
}
return link_encode(url, data)
-
# vim: set ts=4 sw=4 et:
diff --git a/public/views.py b/public/views.py
index 118f067a..c0dae400 100644
--- a/public/views.py
+++ b/public/views.py
@@ -9,7 +9,7 @@ from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from django.views.decorators.cache import cache_control, cache_page
-from devel.models import MasterKey, PGPSignature, StaffGroup
+from devel.models import MasterKey, DeveloperKey, PGPSignature, StaffGroup, UserProfile
from main.models import Arch, Repo, Donor
from mirrors.models import MirrorUrl
from news.models import News
@@ -91,7 +91,9 @@ def feeds(request):
@cache_control(max_age=307)
def keys(request):
- users = User.objects.filter(is_active=True).select_related(
+ profile_ids = UserProfile.allowed_repos.through.objects.values('userprofile_id')
+ users = User.objects.filter(
+ is_active=True, userprofile__id__in=profile_ids).select_related(
'userprofile__pgp_key').order_by('first_name', 'last_name')
user_key_ids = frozenset(user.userprofile.pgp_key[-16:] for user in users
if user.userprofile.pgp_key)
@@ -114,34 +116,39 @@ def keys(request):
not_expired, revoked__isnull=True).values_list('signer', 'signee'))
restrict = Q(signer__in=user_key_ids) & Q(signee__in=user_key_ids)
- cross_signatures = PGPSignature.objects.filter(restrict,
+ cross_signatures = PGPSignature.objects.filter(
not_expired, revoked__isnull=True).order_by('created')
+ # filter in python so we aren't sending a crazy long query to the DB
+ cross_signatures = [s for s in cross_signatures
+ if s.signer in user_key_ids and s.signee in user_key_ids]
+
+ developer_keys = DeveloperKey.objects.select_related(
+ 'owner').filter(owner__isnull=False)
+ developer_keys = {key.key[-16:]: key for key in developer_keys}
context = {
'keys': master_keys,
'active_users': users,
'signatures': signatures,
'cross_signatures': cross_signatures,
+ 'developer_keys': developer_keys,
}
return render(request, 'public/keys.html', context)
@cache_page(1789)
def keys_json(request):
- node_list = []
+ profile_ids = UserProfile.allowed_repos.through.objects.values('userprofile_id')
+ users = User.objects.filter(
+ is_active=True, userprofile__id__in=profile_ids).select_related(
+ 'userprofile__pgp_key').order_by('first_name', 'last_name')
users = User.objects.filter(is_active=True).select_related('userprofile')
- node_list.extend({
- 'name': dev.get_full_name(),
- 'key': dev.userprofile.pgp_key,
- 'group': 'dev'
- } for dev in users.filter(groups__name='Developers'))
- node_list.extend({
- 'name': tu.get_full_name(),
- 'key': tu.userprofile.pgp_key,
- 'group': 'tu'
- } for tu in users.filter(groups__name='Trusted Users').exclude(
- groups__name='Developers'))
+ node_list = [{
+ 'name': user.get_full_name(),
+ 'key': user.userprofile.pgp_key,
+ 'group': 'packager'
+ } for user in users]
master_keys = MasterKey.objects.select_related('owner').filter(
revoked__isnull=True)
diff --git a/sitestatic/download.png b/sitestatic/download.png
new file mode 100644
index 00000000..9ab858c2
--- /dev/null
+++ b/sitestatic/download.png
Binary files differ
diff --git a/sitestatic/magnet.png b/sitestatic/magnet.png
new file mode 100644
index 00000000..f67e69b9
--- /dev/null
+++ b/sitestatic/magnet.png
Binary files differ
diff --git a/templates/mirrors/error_table.html b/templates/mirrors/error_table.html.jinja
index cd7265af..52f68135 100644
--- a/templates/mirrors/error_table.html
+++ b/templates/mirrors/error_table.html.jinja
@@ -1,5 +1,3 @@
-{% load cycle from future %}
-{% load flags mirror_status %}
<table id="errorlog_mirrors" class="results">
<thead>
<tr>
@@ -12,12 +10,12 @@
</tr>
</thead>
<tbody>
- {% for log in error_logs %}<tr class="{% cycle 'odd' 'even' %}">
+ {% for log in error_logs %}<tr class="{{ loop.cycle('odd', 'even') }}">
<td>{{ log.url__url }}</td>
<td>{{ log.url__protocol__protocol }}</td>
- <td class="country">{% country_flag log.country %}{{ log.country.name }}</td>
+ <td class="country">{{ country_flag(log.country) }}{{ log.country.name }}</td>
<td class="wrap">{{ log.error|linebreaksbr }}</td>
- <td>{{ log.last_occurred|date:'Y-m-d H:i' }}</td>
+ <td>{{ log.last_occurred|date('Y-m-d H:i') }}</td>
<td>{{ log.error_count }}</td>
</tr>{% endfor %}
</tbody>
diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html
index bd302d61..5fe1c585 100644
--- a/templates/mirrors/mirror_details.html
+++ b/templates/mirrors/mirror_details.html
@@ -94,46 +94,10 @@
</table>
<h3>Available URLs</h3>
-
- <table id="available_urls" class="results">
- <thead>
- <tr>
- <th>Mirror URL</th>
- <th>Protocol</th>
- <th>Country</th>
- <th>IPv4</th>
- <th>IPv6</th>
- <th>Last Sync</th>
- <th>Completion %</th>
- <th>μ Delay (hh:mm)</th>
- <th>μ Duration (s)</th>
- <th>σ Duration (s)</th>
- <th>Score</th>
- <th>Details</th>
- </tr>
- </thead>
- <tbody>
- {% for m_url in urls %}
- <tr class="{% cycle 'odd' 'even' %}">
- <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td>
- <td>{{ m_url.protocol }}</td>
- <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td>
- <td>{{ m_url.has_ipv4|yesno|capfirst }}</td>
- <td>{{ m_url.has_ipv6|yesno|capfirst }}</td>
- <td>{{ m_url.last_sync|date:'Y-m-d H:i'|default:'unknown' }}</td>
- <td>{{ m_url.completion_pct|percentage:1 }}</td>
- <td>{{ m_url.delay|duration|default:'unknown' }}</td>
- <td>{{ m_url.duration_avg|floatvalue:2 }}</td>
- <td>{{ m_url.duration_stddev|floatvalue:2 }}</td>
- <td>{{ m_url.score|floatvalue:1|default:'∞' }}</td>
- <td><a href="{{ m_url.id }}/">Details</a></td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ {% include "mirrors/mirror_details_urls.html.jinja" %}
<h3>Error Log</h3>
- {% include "mirrors/error_table.html" %}
+ {% include "mirrors/error_table.html.jinja" %}
</div>
<div class="box">
diff --git a/templates/mirrors/mirror_details_urls.html.jinja b/templates/mirrors/mirror_details_urls.html.jinja
new file mode 100644
index 00000000..7ab1548b
--- /dev/null
+++ b/templates/mirrors/mirror_details_urls.html.jinja
@@ -0,0 +1,36 @@
+<table id="available_urls" class="results">
+ <thead>
+ <tr>
+ <th>Mirror URL</th>
+ <th>Protocol</th>
+ <th>Country</th>
+ <th>IPv4</th>
+ <th>IPv6</th>
+ <th>Last Sync</th>
+ <th>Completion %</th>
+ <th>μ Delay (hh:mm)</th>
+ <th>μ Duration (s)</th>
+ <th>σ Duration (s)</th>
+ <th>Score</th>
+ <th>Details</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for m_url in urls %}
+ <tr class="{{ loop.cycle('odd', 'even') }}">
+ <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td>
+ <td>{{ m_url.protocol }}</td>
+ <td class="country">{{ country_flag(m_url.country) }}{{ m_url.country.name }}</td>
+ <td>{{ m_url.has_ipv4|yesno|capfirst }}</td>
+ <td>{{ m_url.has_ipv6|yesno|capfirst }}</td>
+ <td>{{ m_url.last_sync|date('Y-m-d H:i')|default('unknown') }}</td>
+ <td>{{ m_url.completion_pct|percentage(1) }}</td>
+ <td>{{ m_url.delay|duration|default('unknown') }}</td>
+ <td>{{ m_url.duration_avg|floatvalue(2) }}</td>
+ <td>{{ m_url.duration_stddev|floatvalue(2) }}</td>
+ <td>{{ m_url.score|floatvalue(1)|default('∞') }}</td>
+ <td><a href="{{ m_url.id }}/">Details</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html
index 250d9bad..f11d57ca 100644
--- a/templates/mirrors/status.html
+++ b/templates/mirrors/status.html
@@ -60,18 +60,18 @@
<a name="outofsync" id="outofsync"></a>
<h3>Out of Sync Mirrors</h3>
{% with urls=bad_urls table_id='outofsync_mirrors' %}
- {% include "mirrors/status_table.html" %}
+ {% include "mirrors/status_table.html.jinja" %}
{% endwith %}
<a name="successful" id="successful"></a>
<h3>Successfully Syncing Mirrors</h3>
{% with urls=good_urls table_id='successful_mirrors' %}
- {% include "mirrors/status_table.html" %}
+ {% include "mirrors/status_table.html.jinja" %}
{% endwith %}
<a name="errorlog" id="errorlog"></a>
<h3>Mirror Syncing Error Log</h3>
- {% include "mirrors/error_table.html" %}
+ {% include "mirrors/error_table.html.jinja" %}
</div>
{% endblock %}
diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html
deleted file mode 100644
index 83538303..00000000
--- a/templates/mirrors/status_table.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{% load cycle from future %}
-{% load flags mirror_status %}
-<table id="{{ table_id }}" class="results">
- <thead>
- <tr>
- <th>Mirror URL</th>
- <th>Protocol</th>
- <th>Country</th>
- <th>Completion %</th>
- <th>μ Delay (hh:mm)</th>
- <th>μ Duration (s)</th>
- <th>σ Duration (s)</th>
- <th>Mirror Score</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- {% for m_url in urls %}<tr class="{% cycle 'odd' 'even' %}">
- <td>{{ m_url.url }}</td>
- <td>{{ m_url.protocol }}</td>
- <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td>
- <td>{{ m_url.completion_pct|percentage:1 }}</td>
- <td>{{ m_url.delay|duration|default:'unknown' }}</td>
- <td>{{ m_url.duration_avg|floatvalue:2 }}</td>
- <td>{{ m_url.duration_stddev|floatvalue:2 }}</td>
- <td>{{ m_url.score|floatvalue:1|default:'∞' }}</td>
- <td><a href="{{ m_url.get_absolute_url }}">details</a></td>
- </tr>{% endfor %}
- </tbody>
-</table>
diff --git a/templates/mirrors/status_table.html.jinja b/templates/mirrors/status_table.html.jinja
new file mode 100644
index 00000000..598a1af0
--- /dev/null
+++ b/templates/mirrors/status_table.html.jinja
@@ -0,0 +1,28 @@
+<table id="{{ table_id }}" class="results">
+ <thead>
+ <tr>
+ <th>Mirror URL</th>
+ <th>Protocol</th>
+ <th>Country</th>
+ <th>Completion %</th>
+ <th>μ Delay (hh:mm)</th>
+ <th>μ Duration (s)</th>
+ <th>σ Duration (s)</th>
+ <th>Mirror Score</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for m_url in urls %}<tr class="{{ loop.cycle('odd', 'even') }}">
+ <td>{{ m_url.url }}</td>
+ <td>{{ m_url.protocol }}</td>
+ <td class="country">{{ country_flag(m_url.country) }}{{ m_url.country.name }}</td>
+ <td>{{ m_url.completion_pct|percentage(1) }}</td>
+ <td>{{ m_url.delay|duration|default('unknown') }}</td>
+ <td>{{ m_url.duration_avg|floatvalue(2) }}</td>
+ <td>{{ m_url.duration_stddev|floatvalue(2) }}</td>
+ <td>{{ m_url.score|floatvalue(1)|default('∞') }}</td>
+ <td><a href="{{ m_url.get_absolute_url() }}">details</a></td>
+ </tr>{% endfor %}
+ </tbody>
+</table>
diff --git a/templates/mirrors/url_details.html b/templates/mirrors/url_details.html
index 557a1b79..b61033cd 100644
--- a/templates/mirrors/url_details.html
+++ b/templates/mirrors/url_details.html
@@ -1,5 +1,4 @@
{% extends "base.html" %}
-{% load cycle from future %}
{% load static from staticfiles %}
{% load mirror_status %}
{% load flags %}
@@ -58,33 +57,7 @@
</table>
<h3>Check Logs</h3>
-
- <table id="check_logs" class="results">
- <thead>
- <tr>
- <th>Check Time</th>
- <th>Check Location</th>
- <th>Check IP</th>
- <th>Last Sync</th>
- <th>Delay (hh:mm)</th>
- <th>Duration (s)</th>
- <th>Success?</th>
- <th>Error Message</th>
- </tr>
- </thead>
- <tbody>
- {% for log in logs %}<tr class="{% cycle 'odd' 'even' %}">
- <td>{{ log.check_time|date:'Y-m-d H:i' }}</td>
- <td class="country">{% country_flag log.location.country %}{{ log.location.country.name }}</td>
- <td>{{ log.location.source_ip }}</td>
- <td>{{ log.last_sync|date:'Y-m-d H:i' }}</td>
- <td>{{ log.delay|duration }}</td>
- <td>{{ log.duration|floatvalue }}</td>
- <td>{{ log.is_success|yesno|capfirst }}</td>
- <td class="wrap">{{ log.error|linebreaksbr }}</td>
- </tr>{% endfor %}
- </tbody>
- </table>
+ {% include "mirrors/url_details_logs.html.jinja" %}
</div>
{% endblock %}
diff --git a/templates/mirrors/url_details_logs.html.jinja b/templates/mirrors/url_details_logs.html.jinja
new file mode 100644
index 00000000..58f179d8
--- /dev/null
+++ b/templates/mirrors/url_details_logs.html.jinja
@@ -0,0 +1,26 @@
+<table id="check_logs" class="results">
+ <thead>
+ <tr>
+ <th>Check Time</th>
+ <th>Check Location</th>
+ <th>Check IP</th>
+ <th>Last Sync</th>
+ <th>Delay (hh:mm)</th>
+ <th>Duration (s)</th>
+ <th>Success?</th>
+ <th>Error Message</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for log in logs %}<tr class="{{ loop.cycle('odd', 'even') }}">
+ <td>{{ log.check_time|date('Y-m-d H:i') }}</td>
+ <td class="country">{{ country_flag(log.location.country) }}{{ log.location.country.name }}</td>
+ <td>{{ log.location.source_ip }}</td>
+ <td>{{ log.last_sync|date('Y-m-d H:i') }}</td>
+ <td>{{ log.delay|duration }}</td>
+ <td>{{ log.duration|floatvalue }}</td>
+ <td>{{ log.is_success|yesno|capfirst }}</td>
+ <td class="wrap">{{ log.error|linebreaksbr }}</td>
+ </tr>{% endfor %}
+ </tbody>
+</table>
diff --git a/templates/public/download.html b/templates/public/download.html
index 80d636a2..4eaf948c 100644
--- a/templates/public/download.html
+++ b/templates/public/download.html
@@ -60,9 +60,9 @@
{% if release %}<ul>
<li><a href="{{ release.magnet_uri }}"
- title="Magnet link">Magnet link for {{ release.version }}</a></li>
+ title="Magnet link">Magnet link for {{ release.version }} <img width="12" height="12" src="{% static "magnet.png" %}" alt=""/></a></li>
<li><a href="{% url 'releng-release-torrent' release.version %}"
- title="Download torrent">Torrent for {{ release.version }}</a></li>
+ title="Download torrent">Torrent for {{ release.version }}<img width="12" height="12" src="{% static "download.png" %}" alt=""/></a></li>
</ul>{% endif %}
<h3>Netboot</h3>
diff --git a/templates/public/keys.html b/templates/public/keys.html
index 0818719c..f15ec1a9 100644
--- a/templates/public/keys.html
+++ b/templates/public/keys.html
@@ -123,8 +123,8 @@
<tbody>
{% for sig in cross_signatures %}
<tr>
- <td>{% user_pgp_key_link sig.signer %}</td>
- <td>{% user_pgp_key_link sig.signee %}</td>
+ <td>{% user_pgp_key_link developer_keys sig.signer %}</td>
+ <td>{% user_pgp_key_link developer_keys sig.signee %}</td>
<td>{{ sig.created }}</td>
<td>{{ sig.expires|default:"" }}</td>
</tr>
diff --git a/templates/releng/release_detail.html b/templates/releng/release_detail.html
index d04533b9..97017600 100644
--- a/templates/releng/release_detail.html
+++ b/templates/releng/release_detail.html
@@ -1,4 +1,5 @@
{% extends "base.html" %}
+{% load static %}
{% block title %}{{ BRANDING_DISTRONAME }} - Release: {{ release.version }}{% endblock %}
@@ -9,11 +10,15 @@
<ul>
<li><strong>Release Date:</strong> {{ release.release_date|date }}</li>
{% if release.kernel_version %}<li><strong>Kernel Version:</strong> {{ release.kernel_version }}</li>{% endif %}
- <li><strong>Available:</strong> {{ release.available|yesno }}</li>
- {% if release.torrent_data %}<li><strong>Download:</strong> <a
- href="{% url 'releng-release-torrent' release.version %}"
- title="Download torrent for {{ release.version }}">Torrent</a>,
- <a href="{{ release.magnet_uri }}">Magnet</a></li>{% endif %}
+ <li><strong>Available:</strong> {{ release.available|yesno|capfirst }}</li>
+ {% if release.torrent_data %}
+ <li><a href="{% url 'releng-release-torrent' release.version %}"
+ title="Download torrent for {{ release.version }}">
+ Download via Torrent <img width="12" height="12" src="{% static "download.png" %}" alt=""/></a></li>
+ <li><a href="{{ release.magnet_uri }}"
+ title="Get magnet link for {{ release.version }}">
+ Download via Magnet URI <img width="12" height="12" src="{% static "magnet.png" %}" alt=""/></a></li>
+ {% endif %}
{% if release.md5_sum %}<li><strong>MD5:</strong> {{ release.md5_sum }}</li>{% endif %}
{% if release.sha1_sum %}<li><strong>SHA1:</strong> {{ release.sha1_sum }}</li>{% endif %}
</ul>
diff --git a/templates/releng/release_list.html b/templates/releng/release_list.html
index af8b8a61..3f442d07 100644
--- a/templates/releng/release_list.html
+++ b/templates/releng/release_list.html
@@ -12,28 +12,41 @@
<div id="release-list" class="box">
<h2>Releases</h2>
+ <p>This is a list of ISO releases made by the Arch Linux release
+ engineering team. These are typically done on a monthly cadence, containing
+ the latest kernel and base packages from the package repositories. Click
+ the version of each release to read any additional notes or details about
+ each release.</p>
+ <p>Torrents and magnet URIs are available to download the releases.
+ Releases listed as not available may still be seeded by peers, but are no
+ longer registered via the official Arch Linux torrent tracker. We always
+ recommend running the latest available release.</p>
+
<table id="release-table" class="results">
<thead>
<tr>
+ <th style="width: 30px;"></th>
<th>Release Date</th>
<th>Version</th>
<th>Kernel Version</th>
<th>Available?</th>
- <th>Torrent</th>
- <th>Magnet</th>
<th>Download Size</th>
</tr>
</thead>
<tbody>
{% for item in release_list %}
<tr class="{% cycle 'odd' 'even' %}">
+ <td>{% if item.torrent_data %}
+ <a href="{% url 'releng-release-torrent' item.version %}"
+ title="Download torrent for {{ item.version }}"><img width="12" height="12" src="{% static "download.png" %}" alt="Torrent"/></a>
+ &nbsp;
+ <a href="{{ item.magnet_uri }}"
+ title="Get magnet link for {{ item.version }}"><img width="12" height="12" src="{% static "magnet.png" %}" alt="Magnet"/></a>
+ {% endif %}</td>
<td>{{ item.release_date|date }}</td>
<td><a href="{{ item.get_absolute_url }}" title="Release details for {{ item.version }}">{{ item.version }}</a></td>
<td>{{ item.kernel_version|default:"" }}</td>
<td class="available-{{ item.available|yesno }}">{{ item.available|yesno|capfirst }}</td>
- <td>{% if item.available %}<a href="{% url 'releng-release-torrent' item.version %}"
- title="Download torrent for {{ item.version }}">Torrent</a>{% endif %}</td>
- <td>{% if item.available %}<a href="{{ item.magnet_uri }}">Magnet</a>{% endif %}</td>
<td>{% if item.torrent_data %}{{ item.torrent.file_length|filesizeformat }}{% endif %}</td>
</tr>
{% endfor %}
@@ -50,7 +63,7 @@ $(document).ready(function() {
$(".results").tablesorter({
widgets: ['zebra'],
sortList: [[0,1], [1,1]],
- headers: { 4: { sorter: false }, 5: { sorter: false } }
+ headers: { 0: { sorter: false } }
});
});
</script>
diff --git a/visualize/static/visualize.js b/visualize/static/visualize.js
index 6f254f29..32e2a304 100644
--- a/visualize/static/visualize.js
+++ b/visualize/static/visualize.js
@@ -195,7 +195,7 @@ function developer_keys(chart_id, data_url) {
}
});
jQuery.map(json.nodes, function(d, i) {
- if (d.group === "dev" || d.group === "tu") {
+ if (d.group === "packager") {
d.approved = d.master_sigs >= 3;
} else {
d.approved = null;
@@ -220,8 +220,7 @@ function developer_keys(chart_id, data_url) {
return r * 1.6 - 0.75;
case "cacert":
return r * 1.4 - 0.75;
- case "dev":
- case "tu":
+ case "packager":
default:
return r - 0.75;
}