summaryrefslogtreecommitdiffstats
path: root/expo/views_logbooks.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-13 05:22:14 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-13 05:22:14 +0100
commit29984ff15aad9910200c924f7fddf668104bc7c2 (patch)
tree4fec811cdf0fb9329ea4eab95b256ac402202e79 /expo/views_logbooks.py
parent47604b1db2505d971fed3c1de93a24951a33038c (diff)
downloadtroggle-29984ff15aad9910200c924f7fddf668104bc7c2.tar.gz
troggle-29984ff15aad9910200c924f7fddf668104bc7c2.tar.bz2
troggle-29984ff15aad9910200c924f7fddf668104bc7c2.zip
[svn] Added cave and logbook search, collapsible footer navbar, useless statistics page. Also fixed broken css. Toying with forms but not committing those yet.
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8081 by aaron @ 12/8/2008 4:28 AM
Diffstat (limited to 'expo/views_logbooks.py')
-rw-r--r--expo/views_logbooks.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/expo/views_logbooks.py b/expo/views_logbooks.py
index 9d69099..b44c770 100644
--- a/expo/views_logbooks.py
+++ b/expo/views_logbooks.py
@@ -1,6 +1,7 @@
from django.shortcuts import render_to_response
from troggle.expo.models import Expedition, Person, PersonExpedition, PersonTrip, LogbookEntry
import troggle.settings as settings
+import search
def personindex(request):
persons = Person.objects.all()
@@ -14,4 +15,14 @@ def logbookentry(request, logbookentry_id):
logbookentry = LogbookEntry.objects.filter(id = logbookentry_id)[0]
return render_to_response('logbookentry.html', {'logbookentry': logbookentry, 'settings': settings})
+def logbookSearch(request, extra):
+ query_string = ''
+ found_entries = None
+ if ('q' in request.GET) and request.GET['q'].strip():
+ query_string = request.GET['q']
+ entry_query = search.get_query(query_string, ['text','title',])
+ found_entries = LogbookEntry.objects.filter(entry_query)
+ return render_to_response('logbooksearch.html',
+ { 'query_string': query_string, 'found_entries': found_entries, 'settings': settings})
+ #context_instance=RequestContext(request)) \ No newline at end of file