summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/urls.py3
-rw-r--r--apps/patchwork/views/base.py11
2 files changed, 13 insertions, 1 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
+