summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 20:08:58 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 20:08:58 -0500
commitd3c35bc608b6eaf299e66146e1aab76d43b69211 (patch)
tree8247379f7a68391a4a5db7f8f7a80756ee7b9f87
parentb2b6c78e3179cef66cd4e9dcea7f9003f409ce8b (diff)
parent9adc2e53124daa6d13090166830396ffff9013d3 (diff)
Merge tag 'release_2013-11-30' into archweb-generic
End of month release, perf fixes
l---------[-rw-r--r--]README81
-rw-r--r--README.md80
-rw-r--r--main/admin.py4
-rw-r--r--main/models.py2
-rw-r--r--mirrors/templatetags/mirror_status.py11
-rw-r--r--packages/admin.py12
-rw-r--r--packages/templatetags/package_extras.py7
-rw-r--r--requirements.txt4
-rw-r--r--requirements_prod.txt4
-rw-r--r--templates/mirrors/mirror_details.html6
-rw-r--r--templates/mirrors/mirrorlist_status.txt4
-rw-r--r--templates/mirrors/status_table.html6
-rw-r--r--templates/packages/differences.html15
13 files changed, 120 insertions, 116 deletions
diff --git a/README b/README
index beeb7f99..42061c01 100644..120000
--- a/README
+++ b/README
@@ -1,80 +1 @@
-# Archweb README
-
-To get a pretty version of this document, run
-
- $ markdown README > README.html
-
-# License
-
-See LICENSE file.
-
-# Authors
-
-See AUTHORS file.
-
-# Dependencies
-
-- python2
-- python2-virtualenv
-
-# Python dependencies
-
-More detail in `requirements.txt` and `requirements_prod.txt`; it is best to
-use virtualenv and pip to handle these. But if you insist on (Arch Linux)
-packages, you will probably want the following:
-
-- django
-- python2-psycopg2
-- python2-markdown
-- python2-south
-- python2-memcached
-
-# Testing Installation
-
-1. Run `virtualenv2`.
-
- $ cd /path/to/archweb && virtualenv2 ./env/
-
-2. Activate the virtualenv.
-
- $ source ./env/bin/activate
-
-2. Install dependencies through `pip`.
-
- (archweb-env) $ pip install -r requirements.txt
-
-3. Copy `local_settings.py.example` to `local_settings.py` and modify.
- Make sure to uncomment the appropriate database section (either sqlite or
- PostgreSQL).
-
-4. Sync the database to create it.
-
- (archweb-env) $ ./manage.py syncdb
-
-5. Migrate changes.
-
- (archweb-env) $ ./manage.py migrate
-
-6. Load the fixtures to prepopulate some data. If you don't want some of the
- provided data, adjust the file glob accordingly.
-
- (archweb-env) $ ./manage.py loaddata */fixtures/*.json
-
-7. Use the following commands to start a service instance
-
- (archweb-env) $ ./manage.py runserver
-
-8. To optionally populate the database with real data:
-
- (archweb-env) $ wget ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz
- (archweb-env) $ ./manage.py reporead i686 core.db.tar.gz
- (archweb-env) $ ./manage.py syncisos
-
-Alter architecture and repo to get x86\_64 and packages from other repos if
-needed.
-
-# Production Installation
-
-Ask someone who knows, or you are going to be in trouble.
-
-vim: set syntax=markdown et:
+README.md \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..beeb7f99
--- /dev/null
+++ b/README.md
@@ -0,0 +1,80 @@
+# Archweb README
+
+To get a pretty version of this document, run
+
+ $ markdown README > README.html
+
+# License
+
+See LICENSE file.
+
+# Authors
+
+See AUTHORS file.
+
+# Dependencies
+
+- python2
+- python2-virtualenv
+
+# Python dependencies
+
+More detail in `requirements.txt` and `requirements_prod.txt`; it is best to
+use virtualenv and pip to handle these. But if you insist on (Arch Linux)
+packages, you will probably want the following:
+
+- django
+- python2-psycopg2
+- python2-markdown
+- python2-south
+- python2-memcached
+
+# Testing Installation
+
+1. Run `virtualenv2`.
+
+ $ cd /path/to/archweb && virtualenv2 ./env/
+
+2. Activate the virtualenv.
+
+ $ source ./env/bin/activate
+
+2. Install dependencies through `pip`.
+
+ (archweb-env) $ pip install -r requirements.txt
+
+3. Copy `local_settings.py.example` to `local_settings.py` and modify.
+ Make sure to uncomment the appropriate database section (either sqlite or
+ PostgreSQL).
+
+4. Sync the database to create it.
+
+ (archweb-env) $ ./manage.py syncdb
+
+5. Migrate changes.
+
+ (archweb-env) $ ./manage.py migrate
+
+6. Load the fixtures to prepopulate some data. If you don't want some of the
+ provided data, adjust the file glob accordingly.
+
+ (archweb-env) $ ./manage.py loaddata */fixtures/*.json
+
+7. Use the following commands to start a service instance
+
+ (archweb-env) $ ./manage.py runserver
+
+8. To optionally populate the database with real data:
+
+ (archweb-env) $ wget ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz
+ (archweb-env) $ ./manage.py reporead i686 core.db.tar.gz
+ (archweb-env) $ ./manage.py syncisos
+
+Alter architecture and repo to get x86\_64 and packages from other repos if
+needed.
+
+# Production Installation
+
+Ask someone who knows, or you are going to be in trouble.
+
+vim: set syntax=markdown et:
diff --git a/main/admin.py b/main/admin.py
index 6aff12e5..ec2b5bc8 100644
--- a/main/admin.py
+++ b/main/admin.py
@@ -1,23 +1,27 @@
from django.contrib import admin
from main.models import Arch, Donor, Package, Repo
+
class DonorAdmin(admin.ModelAdmin):
list_display = ('name', 'visible', 'created')
list_filter = ('visible', 'created')
search_fields = ('name',)
exclude = ('created',)
+
class ArchAdmin(admin.ModelAdmin):
list_display = ('name', 'agnostic', 'required_signoffs')
list_filter = ('agnostic',)
search_fields = ('name',)
+
class RepoAdmin(admin.ModelAdmin):
list_display = ('name', 'testing', 'staging', 'bugs_project',
'bugs_category', 'svn_root')
list_filter = ('testing', 'staging')
search_fields = ('name',)
+
class PackageAdmin(admin.ModelAdmin):
list_display = ('pkgname', 'full_version', 'repo', 'arch', 'packager',
'last_update', 'build_date')
diff --git a/main/models.py b/main/models.py
index 8d9d4c89..bf7a9409 100644
--- a/main/models.py
+++ b/main/models.py
@@ -97,7 +97,7 @@ class Package(models.Model):
pkgrel = models.CharField(max_length=255)
epoch = models.PositiveIntegerField(default=0)
pkgdesc = models.TextField('description', null=True)
- url = models.CharField(max_length=255, null=True)
+ url = models.CharField('URL', max_length=255, null=True)
filename = models.CharField(max_length=255)
compressed_size = PositiveBigIntegerField()
installed_size = PositiveBigIntegerField()
diff --git a/mirrors/templatetags/mirror_status.py b/mirrors/templatetags/mirror_status.py
index 9a363fbe..b3810d9a 100644
--- a/mirrors/templatetags/mirror_status.py
+++ b/mirrors/templatetags/mirror_status.py
@@ -1,6 +1,5 @@
from datetime import timedelta
from django import template
-from django.template.defaultfilters import floatformat
register = template.Library()
@@ -27,10 +26,16 @@ def hours(value):
return '%d hours' % hrs
@register.filter
-def percentage(value, arg=-1):
+def floatvalue(value, arg=2):
+ if value is None:
+ 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 floatformat(new_val, arg) + '%'
+ return '%.*f%%' % (arg, new_val)
# vim: set ts=4 sw=4 et:
diff --git a/packages/admin.py b/packages/admin.py
index 4680c755..5df0043a 100644
--- a/packages/admin.py
+++ b/packages/admin.py
@@ -15,10 +15,9 @@ class PackageRelationAdmin(admin.ModelAdmin):
class FlagRequestAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'repo', 'created', 'who',
'is_spam', 'is_legitimate', 'message')
- list_filter = ('is_spam', 'is_legitimate', 'repo')
+ list_filter = ('is_spam', 'is_legitimate', 'repo', 'created')
search_fields = ('pkgbase', 'user_email', 'message')
ordering = ('-created',)
- date_hierarchy = 'created'
def get_queryset(self, request):
qs = super(FlagRequestAdmin, self).queryset(request)
@@ -28,19 +27,17 @@ class FlagRequestAdmin(admin.ModelAdmin):
class SignoffAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'arch', 'repo',
'user', 'created', 'revoked')
- list_filter = ('arch', 'repo', 'user')
+ list_filter = ('arch', 'repo', 'user', 'created')
search_fields = ('pkgbase', 'user__username')
ordering = ('-created',)
- date_hierarchy = 'created'
class SignoffSpecificationAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'arch', 'repo',
'user', 'created', 'comments')
- list_filter = ('arch', 'repo', 'user')
+ list_filter = ('arch', 'repo', 'user', 'created')
search_fields = ('pkgbase', 'user__username')
ordering = ('-created',)
- date_hierarchy = 'created'
def get_queryset(self, request):
qs = super(SignoffSpecificationAdmin, self).queryset(request)
@@ -50,10 +47,9 @@ class SignoffSpecificationAdmin(admin.ModelAdmin):
class UpdateAdmin(admin.ModelAdmin):
list_display = ('pkgname', 'repo', 'arch', 'action_flag',
'old_version', 'new_version', 'created')
- list_filter = ('action_flag', 'repo', 'arch')
+ list_filter = ('action_flag', 'repo', 'arch', 'created')
search_fields = ('pkgname',)
ordering = ('-created',)
- date_hierarchy = 'created'
raw_id_fields = ('package',)
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index f7392a96..3ce64748 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -67,13 +67,16 @@ def do_buildsortqs(parser, token):
@register.simple_tag
-def pkg_details_link(pkg, link_title=None):
+def pkg_details_link(pkg, link_title=None, honor_flagged=False):
if not pkg:
return link_title or ''
if link_title is None:
link_title = pkg.pkgname
+ link_content = link_title
+ if honor_flagged and pkg.flag_date:
+ link_content = '<span class="flagged">%s</span>' % link_title
link = '<a href="%s" title="View package details for %s">%s</a>'
- return link % (pkg.get_absolute_url(), pkg.pkgname, link_title)
+ return link % (pkg.get_absolute_url(), pkg.pkgname, link_content)
@register.simple_tag
diff --git a/requirements.txt b/requirements.txt
index 08d89107..7ff363e6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,9 +2,9 @@
Django==1.6
IPy==0.81
Markdown==2.3.1
-South==0.8.2
+South==0.8.4
bencode==1.0
django-countries==1.5
-jsmin==2.0.6
+jsmin==2.0.8
pgpdump==1.4
pytz>=2013.8
diff --git a/requirements_prod.txt b/requirements_prod.txt
index 565c3c6c..3f2958c6 100644
--- a/requirements_prod.txt
+++ b/requirements_prod.txt
@@ -2,10 +2,10 @@
Django==1.6
IPy==0.81
Markdown==2.3.1
-South==0.8.2
+South==0.8.4
bencode==1.0
django-countries==1.5
-jsmin==2.0.6
+jsmin==2.0.8
pgpdump==1.4
psycopg2==2.5.1
pyinotify==0.9.4
diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html
index 5138f3b9..7eb7ad1b 100644
--- a/templates/mirrors/mirror_details.html
+++ b/templates/mirrors/mirror_details.html
@@ -110,9 +110,9 @@
<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|floatformat:2 }}</td>
- <td>{{ m_url.duration_stddev|floatformat:2 }}</td>
- <td>{{ m_url.score|floatformat:1|default:'∞' }}</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>
</tr>
{% endfor %}
</tbody>
diff --git a/templates/mirrors/mirrorlist_status.txt b/templates/mirrors/mirrorlist_status.txt
index cdbc7adb..746aae76 100644
--- a/templates/mirrors/mirrorlist_status.txt
+++ b/templates/mirrors/mirrorlist_status.txt
@@ -1,4 +1,4 @@
-{% comment %}
+{% load mirror_status %}{% comment %}
Yes, ugly templates are ugly, but in order to keep line breaks where we want
them, sacrifices have to be made. If editing this template, it is easiest to
forget about where line breaks are happening until you are done getting the
@@ -9,6 +9,6 @@ content right, and then go back later to fix it all up.
## Generated on {% now "Y-m-d" %}
##
{% for mirror_url in mirror_urls %}
-## Score: {{ mirror_url.score|floatformat:1|default:'unknown' }}, {{ mirror_url.country.name|default:'Worldwide' }}
+## Score: {{ mirror_url.score|floatvalue:1|default:'unknown' }}, {{ mirror_url.country.name|default:'Worldwide' }}
#Server = {{ mirror_url.url}}$repo/os/$arch{% endfor %}
{% endautoescape %}
diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html
index 6fc07a31..00b9c1df 100644
--- a/templates/mirrors/status_table.html
+++ b/templates/mirrors/status_table.html
@@ -20,9 +20,9 @@
<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|floatformat:2 }}</td>
- <td>{{ m_url.duration_stddev|floatformat:2 }}</td>
- <td>{{ m_url.score|floatformat:1|default:'∞' }}</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>
</tr>{% endfor %}
</tbody>
</table>
diff --git a/templates/packages/differences.html b/templates/packages/differences.html
index d70b4209..bde05a50 100644
--- a/templates/packages/differences.html
+++ b/templates/packages/differences.html
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load cycle from future %}
{% load static from staticfiles %}
+{% load package_extras %}
{% block title %}{{ BRANDING_DISTRONAME }} - Package Differences Reports{% endblock %}
{% block navbarclass %}anb-packages{% endblock %}
@@ -45,14 +46,10 @@
<td>{{ diff.pkgname }}</td>
<td>{{ diff.repo.name }}</td>
{% if diff.pkg_a %}
- <td><a href="{{ diff.pkg_a.get_absolute_url }}"
- title="View package details for {{ diff.pkg_a.pkgname }}">
- <span{% if diff.pkg_a.flag_date %} class="flagged"{% endif %}>{{ diff.pkg_a.full_version }}</span></a></td>
+ <td>{% pkg_details_link diff.pkg_a diff.pkg_a.full_version True %}</td>
{% else %}<td>-</td>{% endif %}
{% if diff.pkg_b %}
- <td><a href="{{ diff.pkg_b.get_absolute_url }}"
- title="View package details for {{ diff.pkg_b.pkgname }}">
- <span{% if diff.pkg_b.flag_date %} class="flagged"{% endif %}>{{ diff.pkg_b.full_version }}</span></a></td>
+ <td>{% pkg_details_link diff.pkg_b diff.pkg_b.full_version True %}</td>
{% else %}<td>-</td>{% endif %}
</tr>
{% endfor %}
@@ -78,12 +75,10 @@
<tbody>
{% for pkg1, pkg2 in multilib_differences %}
<tr class="{% cycle 'odd' 'even' %}">
- <td><a href="{{ pkg1.get_absolute_url }}"
- title="View package details for {{ pkg1.pkgname }}">{{ pkg1.pkgname }}</a></td>
+ <td>{% pkg_details_link pkg1 %}</td>
<td><span{% if pkg1.flag_date %} class="flagged"{% endif %}>{{ pkg1.full_version }}</span></td>
<td><span{% if pkg2.flag_date %} class="flagged"{% endif %}>{{ pkg2.full_version }}</span></td>
- <td><a href="{{ pkg2.get_absolute_url }}"
- title="View package details for {{ pkg2.pkgname }}">{{ pkg2.pkgname }}</a></td>
+ <td>{% pkg_details_link pkg2 %}</td>
<td>{{ pkg2.repo }}</td>
<td>{{ pkg1.last_update|date }}</td>
<td>{{ pkg2.last_update|date }}</td>