From 7dc74cf94c542a1f08563b2df29b06b7bb223953 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 27 Oct 2008 01:36:06 +0100 Subject: [PATCH] [svn r8038] add personindex templates --- troggle/expo/views.py | 3 ++- troggle/parsers/logbooks.py | 10 +--------- troggle/settings.py | 2 +- troggle/templates/person.html | 24 ++++++++++++++++++++++++ troggle/templates/personindex.html | 26 ++++++++++++++++++++++++++ troggle/urls.py | 5 +++++ 6 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 troggle/templates/person.html create mode 100644 troggle/templates/personindex.html diff --git a/troggle/expo/views.py b/troggle/expo/views.py index 0ffd800e6..eed58727e 100644 --- a/troggle/expo/views.py +++ b/troggle/expo/views.py @@ -1,2 +1,3 @@ from views_caves import * -from views_survex import * \ No newline at end of file +from views_survex import * +from views_logbooks import * diff --git a/troggle/parsers/logbooks.py b/troggle/parsers/logbooks.py index df2c9a9bd..cc3a74614 100644 --- a/troggle/parsers/logbooks.py +++ b/troggle/parsers/logbooks.py @@ -7,14 +7,6 @@ import re import os import datetime -# Dave Johnson (Stonker) is hacked -- are there two of this DJ name -# Dave Collins (Scout) is hacked -# Letty ten Harkel has middle , tu = timeug or ""name removed -# the have been removed -# Dave Milne (Lummat) -# Ben van Millingen -# Rebecca Lawson (Becka) - persontab = open(os.path.join(settings.EXPOWEB, "noinfo", "folk.csv")) personreader = csv.reader(persontab) headers = personreader.next() @@ -186,7 +178,7 @@ def Parseloghtmltxt(year, expedition, txt): def LoadLogbooks(): models.LogbookEntry.objects.all().delete() - expowebbase = os.path.join(settings.EXPOWEB, "years") # this could be a url + expowebbase = os.path.join(settings.EXPOWEB, "years") yearlinks = [ # ("2008", "2008/logbook/2008logbook.txt"), # ("2007", "2007/logbook/2007logbook.txt"), diff --git a/troggle/settings.py b/troggle/settings.py index 7a830502f..bccbe9ac5 100644 --- a/troggle/settings.py +++ b/troggle/settings.py @@ -67,7 +67,7 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'troggle.urls' TEMPLATE_DIRS = ( - "templates" + "/home/mjg/expoweb/troggle/templates" # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. diff --git a/troggle/templates/person.html b/troggle/templates/person.html new file mode 100644 index 000000000..c71020873 --- /dev/null +++ b/troggle/templates/person.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} +{% load wiki_markup %} + +{% block title %}Person {{person.id}}{% endblock %} + +{% block content %} +
{{person}} +
    + {% for personexpedition in person.personexpedition_set.all %} +
  • +
    + {{personexpedition.expedition}} + +
    + {% for persontrip in personexpedition.persontrip_set.all %} + {{persontrip.date}} + {% endfor %} +
    +
    +
  • + {% endfor %} +
+
+{% endblock %} diff --git a/troggle/templates/personindex.html b/troggle/templates/personindex.html new file mode 100644 index 000000000..45591e61d --- /dev/null +++ b/troggle/templates/personindex.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} +{% load wiki_markup %} + +{% block title %}Person Index{% endblock %} + +{% block content %} +{% for person in persons %} +
{{person}} +
    + {% for personexpedition in person.personexpedition_set.all %} +
  • +
    + {{personexpedition.expedition}} + +
    + {% for persontrip in personexpedition.persontrip_set.all %} + {{persontrip.date}} + {% endfor %} +
    +
    +
  • + {% endfor %} +
+
+{% endfor %} +{% endblock %} diff --git a/troggle/urls.py b/troggle/urls.py index f62109075..3be1a008c 100644 --- a/troggle/urls.py +++ b/troggle/urls.py @@ -9,11 +9,16 @@ urlpatterns = patterns('', (r'^troggle/cave/$', caveindex), (r'^troggle/cave/(?P[^/]+)/$', cave), (r'^troggle/cave/(?P[^/]+)/(?P[^/]?)$', ent), + (r'^troggle/survex/(?P.*)\.index$', index), (r'^troggle/survex/(?P.*)\.svx$', svx), (r'^troggle/survex/(?P.*)\.3d$', threed), (r'^troggle/survex/(?P.*)\.log$', log), (r'^troggle/survex/(?P.*)\.err$', err), + + (r'^person/$', personindex), + (r'^person/(.*)$', person), + (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/(.*)', admin.site.root),