From e3025b02e9bbb57911ad64a0b3eafdc83f08e116 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sat, 6 Nov 2010 19:11:08 +0000 Subject: [PATCH] webinterface: add hosts browsing page --- pyi2phosts/templates/base.html | 1 + pyi2phosts/templates/browse.html | 11 +++++++++++ pyi2phosts/urls.py | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 pyi2phosts/templates/browse.html diff --git a/pyi2phosts/templates/base.html b/pyi2phosts/templates/base.html index d67a804..76c9e1e 100644 --- a/pyi2phosts/templates/base.html +++ b/pyi2phosts/templates/base.html @@ -15,6 +15,7 @@ diff --git a/pyi2phosts/templates/browse.html b/pyi2phosts/templates/browse.html new file mode 100644 index 0000000..0236d34 --- /dev/null +++ b/pyi2phosts/templates/browse.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} + + + {% for host in host_list %} + + {% endfor %} +
HostLast seenDescription
{{ host.name }}{{ host.last_seen }} + {{ host.description }}
+{% endblock %} diff --git a/pyi2phosts/urls.py b/pyi2phosts/urls.py index 6006260..4310c3b 100644 --- a/pyi2phosts/urls.py +++ b/pyi2phosts/urls.py @@ -8,6 +8,7 @@ admin.autodiscover() from pyi2phosts.lib.utils import get_b32 from pyi2phosts.extsources.models import ExternalSource +from pyi2phosts.postkey.models import i2phost import settings extsources = { @@ -19,6 +20,12 @@ extsources = { } } +browse_hosts = { + 'queryset': i2phost.objects.filter(activated=True), + 'template_name': 'browse.html', + 'template_object_name': 'host', + } + urlpatterns = patterns('', url(r'^$', direct_to_template, { 'template': 'index.html', @@ -30,6 +37,7 @@ urlpatterns = patterns('', } }, name='index'), url(r'^faq/$', object_list, extsources, name='faq'), + url(r'^browse/$', object_list, browse_hosts, name='browse'), (r'^postkey/', include('pyi2phosts.postkey.urls')), (r'^jump/', include('pyi2phosts.jump.urls')), # Example: