diff --git a/euscanwww/euscan/management/commands/scan-upstream.py b/euscanwww/euscan/management/commands/scan-upstream.py index 87013a0..b1c464f 100644 --- a/euscanwww/euscan/management/commands/scan-upstream.py +++ b/euscanwww/euscan/management/commands/scan-upstream.py @@ -138,7 +138,7 @@ class Command(BaseCommand): sys.stdout.write('[u] %s/%s-%s %s\n' % (package.category, package.name, ver, url)) - obj.url = url + obj.urls = url obj.packaged = False obj.save() diff --git a/euscanwww/euscan/templatetags/mul.py b/euscanwww/euscan/templatetags/mul.py new file mode 100644 index 0000000..c28f270 --- /dev/null +++ b/euscanwww/euscan/templatetags/mul.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + +def mul(value, arg=None): + return value*arg + +register.filter('mul', mul) diff --git a/euscanwww/euscan/urls.py b/euscanwww/euscan/urls.py index 23e9529..08c3873 100644 --- a/euscanwww/euscan/urls.py +++ b/euscanwww/euscan/urls.py @@ -4,10 +4,10 @@ urlpatterns = patterns('euscan.views', (r'^$', 'index'), (r'^logs/$', 'logs'), (r'^categories/$', 'categories'), - (r'^category/(?P\w+)/packages/$', 'category'), + (r'^category/(?P[\w+][\w+.-]*)/packages/$', 'category'), (r'^herds/$', 'herds'), - (r'^herd/(?P\w+)/packages/$', 'herd'), + (r'^herd/(?P[\w+][\w+.-]*)/packages/$', 'herd'), (r'^maintainers/$', 'maintainers'), (r'^maintainer/(?P\d+)/packages/$', 'maintainer'), - (r'^package/(?P\w+)/(?P\w+)/$', 'package'), + (r'^package/(?P[\w+][\w+.-]*)/(?P[\w+][\w+.-]*)/$', 'package'), ) diff --git a/euscanwww/euscan/urls.pyc b/euscanwww/euscan/urls.pyc index e187d8d..c63d84b 100644 Binary files a/euscanwww/euscan/urls.pyc and b/euscanwww/euscan/urls.pyc differ diff --git a/euscanwww/euscan/views.py b/euscanwww/euscan/views.py index 2c1d47d..523496b 100644 --- a/euscanwww/euscan/views.py +++ b/euscanwww/euscan/views.py @@ -1,5 +1,6 @@ from annoying.decorators import render_to from django.http import Http404 +from django.shortcuts import get_object_or_404 from django.db.models import Sum, Max from euscan.models import Version, Package, Herd, Maintainer, EuscanResult @@ -9,7 +10,8 @@ def index(request): ctx = {} ctx['n_packaged'] = Package.objects.aggregate(Sum('n_packaged'))['n_packaged__sum'] ctx['n_versions'] = Package.objects.aggregate(Sum('n_versions'))['n_versions__sum'] - ctx['n_upstream'] = ctx['n_versions'] - ctx['n_packaged'] + if ctx['n_versions'] is not None and ctx['n_pacaged'] is not None: + ctx['n_upstream'] = ctx['n_versions'] - ctx['n_packaged'] ctx['n_packages'] = Package.objects.count() ctx['n_herds'] = Herd.objects.count() ctx['n_maintainers'] = Maintainer.objects.count() @@ -27,7 +29,10 @@ def categories(request): @render_to('euscan/category.html') def category(request, category): - return {} + packages = Package.objects.filter(category=category) + if not packages: + raise Http404 + return { 'category' : category, 'packages' : packages } @render_to('euscan/herds.html') def herds(request): @@ -47,4 +52,7 @@ def maintainer(request, maintainer_id): @render_to('euscan/package.html') def package(request, category, package): - return {} + package = get_object_or_404(Package, category=category, name=package) + packaged = Version.objects.filter(package=package, packaged=True) + upstream = Version.objects.filter(package=package, packaged=False) + return { 'package' : package, 'packaged' : packaged, 'upstream' : upstream } diff --git a/euscanwww/euscan/views.pyc b/euscanwww/euscan/views.pyc index 4aa64aa..ca2b0f7 100644 Binary files a/euscanwww/euscan/views.pyc and b/euscanwww/euscan/views.pyc differ diff --git a/euscanwww/media/css/style.css b/euscanwww/media/css/style.css index 3826939..48b6199 100644 --- a/euscanwww/media/css/style.css +++ b/euscanwww/media/css/style.css @@ -137,43 +137,6 @@ dd { padding: 5px; } -table { - border:3px solid #55534E; - border-collapse:collapse; - width:90%; - margin:auto; -} - -thead, tfoot { - border:1px solid #55534E; -} - -tbody { - background-color:#FFFFFF; - border:1px solid #55534E; -} -tbody tr.even { - background-color: #eee; -} -tbody tr.odd { - background-color: #fff; -} -tbody tr:hover { - background: #DFD9CD; -} - - -th { - border:1px dotted #55534E; - padding:5px; - background-color: #DFD9CD; -} - -td { - border:1px solid #55534E; - padding:5px; - text-align:left; -} h1 { width: 20em; @@ -184,9 +147,11 @@ h1 { .ok { color:#15B100; } + .bad { color:#FFFFFF; } + hr { margin: 0.3em 1em 0.3em 1em; diff --git a/euscanwww/media/css/table.css b/euscanwww/media/css/table.css index d34c74b..799ca5a 100644 --- a/euscanwww/media/css/table.css +++ b/euscanwww/media/css/table.css @@ -463,43 +463,43 @@ tr.even.gradeU td.sorting_3 { /* * Row highlighting example */ -.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { +tbody tr.even:hover, #example tbody tr.even td.highlighted { background-color: #ECFFB3; } -.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { +tbody tr.odd:hover, #example tbody tr.odd td.highlighted { background-color: #E6FF99; } -.ex_highlight_row #example tr.even:hover { +tr.even:hover { background-color: #ECFFB3; } -.ex_highlight_row #example tr.even:hover td.sorting_1 { +tr.even:hover td.sorting_1 { background-color: #DDFF75; } -.ex_highlight_row #example tr.even:hover td.sorting_2 { +tr.even:hover td.sorting_2 { background-color: #E7FF9E; } -.ex_highlight_row #example tr.even:hover td.sorting_3 { +tr.even:hover td.sorting_3 { background-color: #E2FF89; } -.ex_highlight_row #example tr.odd:hover { +tr.odd:hover { background-color: #E6FF99; } -.ex_highlight_row #example tr.odd:hover td.sorting_1 { +tr.odd:hover td.sorting_1 { background-color: #D6FF5C; } -.ex_highlight_row #example tr.odd:hover td.sorting_2 { +tr.odd:hover td.sorting_2 { background-color: #E0FF84; } -.ex_highlight_row #example tr.odd:hover td.sorting_3 { +tr.odd:hover td.sorting_3 { background-color: #DBFF70; } diff --git a/euscanwww/templates/_base.html b/euscanwww/templates/_base.html index c3db08c..cdd6c3c 100644 --- a/euscanwww/templates/_base.html +++ b/euscanwww/templates/_base.html @@ -15,14 +15,15 @@
{% block content %}{% endblock %} +
- {% block content %}{% endblock %} + {% block content %} + {% endblock %} +