summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-08-23 10:29:12 +0800
committerJeremy Kerr <jk@ozlabs.org>2008-08-23 10:29:12 +0800
commit8252a61e73126c2b89c97e4195c635bc3d60a3e9 (patch)
tree572cf8f8c02d6cf6495ed336c015f41345e41c98
parentf1f11ba9e5511d5c0534929ed435baee994ff68b (diff)
downloadpatchwork-8252a61e73126c2b89c97e4195c635bc3d60a3e9.tar.bz2
patchwork-8252a61e73126c2b89c97e4195c635bc3d60a3e9.tar.xz
Add simple help infrastructure, with an 'about' page.
We'll need the about page for adding attribution for included components. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--apps/patchwork/urls.py3
-rw-r--r--apps/patchwork/views/base.py11
-rw-r--r--templates/base.html8
-rw-r--r--templates/patchwork/help/about.html19
-rw-r--r--templates/patchwork/help/index.html2
5 files changed, 37 insertions, 6 deletions
diff --git a/apps/patchwork/urls.py b/apps/patchwork/urls.py
index f475e74..194f512 100644
--- a/apps/patchwork/urls.py
+++ b/apps/patchwork/urls.py
@@ -50,4 +50,7 @@ urlpatterns = patterns('',
# submitter autocomplete
(r'^submitter/$', 'patchwork.views.submitter_complete'),
+
+ # help!
+ (r'^help/(?P<path>.*)$', 'patchwork.views.help'),
)
diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py
index 85014af..b3b1c12 100644
--- a/apps/patchwork/views/base.py
+++ b/apps/patchwork/views/base.py
@@ -22,7 +22,7 @@ from patchwork.models import Patch, Project, Person
from patchwork.filters import Filters
from patchwork.forms import LoginForm, PatchForm
from django.shortcuts import render_to_response, get_object_or_404
-from django.http import HttpResponse, HttpResponseRedirect
+from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.db import transaction
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
@@ -64,3 +64,12 @@ def submitter_complete(request):
json_serializer = serializers.get_serializer("json")()
json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
return response
+
+help_pages = {'': 'index.html', 'about/': 'about.html'}
+
+def help(request, path):
+ context = PatchworkRequestContext(request)
+ if help_pages.has_key(path):
+ return render_to_response('patchwork/help/' + help_pages[path], context)
+ raise Http404
+
diff --git a/templates/base.html b/templates/base.html
index df668aa..b9b359f 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -24,16 +24,14 @@
<a href="{% url patchwork.views.user.profile %}">profile</a> ::
<a href="{% url patchwork.views.user.todo_lists %}">todo
({{ user.get_profile.n_todo_patches }})</a><br/>
- <a href="{% url auth_logout %}">logout</a><!-- ::
- <a href="/help/">help</a> -->
+ <a href="{% url auth_logout %}">logout</a> ::
+ <a href="{% url patchwork.views.help path="about/" %}">about</a>
{% else %}
<a href="{% url auth_login %}">login</a>
<br/>
<a href="{% url registration_register %}">register</a>
- <!--
<br/>
- <a href="/help/">help</a>
- -->
+ <a href="{% url patchwork.views.help path="about/" %}">about</a>
{% endif %}
</div>
<div style="clear: both;"></div>
diff --git a/templates/patchwork/help/about.html b/templates/patchwork/help/about.html
new file mode 100644
index 0000000..fa5094f
--- /dev/null
+++ b/templates/patchwork/help/about.html
@@ -0,0 +1,19 @@
+{% extends "base.html" %}
+
+{% block title %}About{% endblock %}
+{% block heading %} - About Patchwork{% endblock %}
+
+{% block body %}
+
+<p>Patchwork is free software, and is available from the
+<a href="http://ozlabs.org/~jk/projects/patchwork/">patchwork website</a>.</p>
+
+<p>Patchwork is built on the <a href="http://djangoproject.com/">django</a>
+web framework.</p>
+
+<p>Patchwork includes the <a
+href="http://code.google.com/p/django-registration/">django-registration</a>
+application.</a>
+
+{% endblock %}
+
diff --git a/templates/patchwork/help/index.html b/templates/patchwork/help/index.html
new file mode 100644
index 0000000..5cb6467
--- /dev/null
+++ b/templates/patchwork/help/index.html
@@ -0,0 +1,2 @@
+{% extends "base.html" %}
+