From cfb4f1bc6a45ddfc068acabc6efb9a4e350dd544 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 28 Apr 2011 14:46:36 -0500 Subject: isotests: make the various pages a bit more useful Instructions are nice, as are links to other pages that actually flow with the style of the rest of the site. Also fix the styling of the labels on the results entry page as it looked a bit funky before. Signed-off-by: Dan McGee --- media/archweb.css | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media') diff --git a/media/archweb.css b/media/archweb.css index 4b0b9e89..936edc79 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -260,6 +260,9 @@ ul.admin-actions li { display: inline; padding-left: 1.5em; } #dev-signoffs .signoff-no { color: red; } #dev-signoffs .signed-username { color: #888; margin-left: 0.5em; } +/* iso testing feedback form */ +#releng-feedback label { width: auto; display: inline; font-weight: normal; } + /* highlight current website in the navbar */ #archnavbar.anb-home ul li#anb-home a { color: white !important; } #archnavbar.anb-packages ul li#anb-packages a { color: white !important; } -- cgit v1.2.3-54-g00ecf From 684fb5353d0e61075c7a24f703b680d58e8dcf00 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 28 Apr 2011 15:29:38 -0500 Subject: isotests: clean up submissin form Don't show stupid '-----' entries with radio buttons, remove the list item style since we have radio buttons or checkboxes everywhere anyway. Signed-off-by: Dan McGee --- isotests/views.py | 25 ++++++++++++++----------- media/archweb.css | 2 ++ 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'media') diff --git a/isotests/views.py b/isotests/views.py index e373d066..50703bd6 100644 --- a/isotests/views.py +++ b/isotests/views.py @@ -7,11 +7,22 @@ Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, Test) +def standard_field(model, help_text=None): + return forms.ModelChoiceField(queryset=model.objects.all(), + widget=forms.RadioSelect(), empty_label=None, help_text=help_text) + class TestForm(forms.ModelForm): iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True)) - filesystem = forms.ModelChoiceField(queryset=Filesystem.objects.all(), - help_text="Check the installed system, including fstab.", - widget=forms.RadioSelect()) + architecture = standard_field(Architecture) + iso_type = standard_field(IsoType) + boot_type = standard_field(BootType) + hardware_type = standard_field(HardwareType) + install_type = standard_field(InstallType) + source = standard_field(Source) + clock_choice = standard_field(ClockChoice) + bootloader = standard_field(Bootloader) + filesystem = standard_field(Filesystem, + help_text="Check the installed system, including fstab.") modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), help_text="", widget=forms.CheckboxSelectMultiple(), required=False) rollback_filesystem = forms.ModelChoiceField(queryset=Filesystem.objects.all(), @@ -36,14 +47,6 @@ class Meta: "modules", "rollback_filesystem", "rollback_modules", "bootloader", "success", "comments") widgets = { - "architecture": forms.RadioSelect(), - "iso_type": forms.RadioSelect(), - "boot_type": forms.RadioSelect(), - "hardware_type": forms.RadioSelect(), - "install_type": forms.RadioSelect(), - "source": forms.RadioSelect(), - "clock_choice": forms.RadioSelect(), - "bootloader": forms.RadioSelect(), "modules": forms.CheckboxSelectMultiple(), } diff --git a/media/archweb.css b/media/archweb.css index 936edc79..504c8270 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -262,6 +262,8 @@ ul.admin-actions li { display: inline; padding-left: 1.5em; } /* iso testing feedback form */ #releng-feedback label { width: auto; display: inline; font-weight: normal; } +#releng-feedback ul { padding-left: 1em; } +#releng-feedback li { list-style: none; } /* highlight current website in the navbar */ #archnavbar.anb-home ul li#anb-home a { color: white !important; } -- cgit v1.2.3-54-g00ecf From 8de1bd0639a8b6117bc35dfe0ad1e6a1ac34f715 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Sat, 30 Apr 2011 15:15:38 +0300 Subject: Add filesizeformat filter to sizes in reports/big We also add a new 'filesize' tablesorter parser that handles all the suffixes found in django's filesizeformat filter. Signed-off-by: Dan McGee --- devel/views.py | 9 ++++++++- media/archweb.js | 27 +++++++++++++++++++++++++++ templates/devel/packages.html | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) (limited to 'media') diff --git a/devel/views.py b/devel/views.py index 6907de24..9c523f0a 100644 --- a/devel/views.py +++ b/devel/views.py @@ -10,6 +10,7 @@ from django.http import Http404 from django.shortcuts import get_object_or_404 from django.template import loader, Context +from django.template.defaultfilters import filesizeformat from django.views.decorators.cache import never_cache from django.views.generic.simple import direct_to_template @@ -140,7 +141,13 @@ def report(request, report): cutoff = 50 * 1024 * 1024 packages = packages.filter(compressed_size__gte=cutoff).order_by('-compressed_size') names = [ 'Compressed Size', 'Installed Size' ] - attrs = [ 'compressed_size', 'installed_size' ] + attrs = [ 'compressed_size_pretty', 'installed_size_pretty' ] + # Format the compressed and installed sizes with MB/GB/etc suffixes + for package in packages: + package.compressed_size_pretty = filesizeformat( + package.compressed_size) + package.installed_size_pretty = filesizeformat( + package.installed_size) elif report == 'uncompressed-man': title = 'Packages with uncompressed manpages' # magic going on here! Checking for all '.1'...'.9' extensions diff --git a/media/archweb.js b/media/archweb.js index 03358fa9..78b15670 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -67,6 +67,33 @@ if (typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ + id: 'filesize', + re: /^(\d+(?:\.\d+)?) (bytes?|KB|MB|GB|TB)$/, + is: function(s) { + return this.re.test(s); + }, + format: function(s) { + var matches = this.re.exec(s); + var size = parseFloat(matches[1]); + var suffix = matches[2]; + + switch(suffix) { + case 'byte': + case 'bytes': + return size; + case 'KB': + return size * 1024; + case 'MB': + return size * 1024 * 1024; + case 'GB': + return size * 1024 * 1024 * 1024; + case 'TB': + return size * 1024 * 1024 * 1024 * 1024; + } + }, + type: 'numeric' + }); } /* news/add.html */ diff --git a/templates/devel/packages.html b/templates/devel/packages.html index 32cdf217..e0988c03 100644 --- a/templates/devel/packages.html +++ b/templates/devel/packages.html @@ -49,6 +49,7 @@

{{ title }}

{% load cdn %}{% jquery %} +