euscanwww: per handler package list

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-11-26 14:55:49 +01:00
parent 8ad3ed2897
commit a8f69e8128
5 changed files with 36 additions and 2 deletions

View File

@ -93,7 +93,7 @@
{% for url in version.urls_list %}
<a href="{{ url }}">{{ url }}</a>
{% endfor %}
{% if confidence < 100 %}({{ version.confidence }}%){% endif %}
({% if version.handler != "generic" %}{{ version.handler }} - {% endif %}{{ version.confidence }}%)
</li>
{% endfor %}
</ul>

View File

@ -19,7 +19,11 @@
<tbody>
{% for handler in handlers %}
<tr>
<td>{{ handler.handler }}</td>
<td>
<a href="{% url "statistics_handler" handler.handler %}">
{{ handler.handler }}
</a>
</td>
<td>{{ handler.n }}</td>
<td>{{ handler.avg_conf }}</td>
</tr>

View File

@ -0,0 +1,16 @@
{% extends "euscan/_datatable.html" %}
{% load url from future %}
{% load djeuscan_helpers %}
{% block title %}
{{ block.super }} - Handler: {{ handler }}
{% endblock %}
{% block content %}
<h2>
Handler: {{ handler }}
</h2>
{% packages packages %}
{% endblock %}

View File

@ -82,6 +82,8 @@ urlpatterns = patterns('djeuscan.views',
url(r'^about/feeds$', 'feeds', name="feeds"),
url(r'^about/config$', 'config', name="config"),
url(r'^statistics/$', 'statistics', name="statistics"),
url(r'^statistics/handlers/(?P<handler>\w+)/$', 'statistics_handler',
name="statistics_handler"),
url(r'^statistics/charts/(?P<chart>[\w\-]+).png$', 'chart', name="chart"),
url(r'^world/$', 'world', name="world"),
url(r'^world/scan/$', 'world_scan', name="world_scan"),

View File

@ -387,6 +387,18 @@ def statistics(request):
return {"handlers": handlers}
@render_to("euscan/statistics_handler.html")
def statistics_handler(request, handler):
package_ids = [
elem["package"] for elem in
Version.objects.filter(handler=handler)
.values("package")
.distinct()
]
packages = Package.objects.filter(pk__in=package_ids)
return {"handler": handler, "packages": packages}
def chart(request, **kwargs):
from django.views.static import serve