From: Jeremy Kerr Date: Sat, 23 Aug 2008 02:29:12 +0000 (+0800) Subject: Add simple help infrastructure, with an 'about' page. X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=commitdiff_plain;h=8252a61e73126c2b89c97e4195c635bc3d60a3e9 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 --- 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.*)$', '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 @@ profile :: todo ({{ user.get_profile.n_todo_patches }})
- logout + logout :: + about {% else %} login
register - + about {% endif %}
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 %} + +

Patchwork is free software, and is available from the +patchwork website.

+ +

Patchwork is built on the django +web framework.

+ +

Patchwork includes the django-registration +application. + +{% 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" %} +