From d316f4b1975ee3c189e1df4087bea938bb43a377 Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Thu, 22 Jul 2010 14:07:50 -0600 Subject: Add a basic view for todo lists Dan: rename template and view to something a bit more concise. Signed-off-by: Dan McGee --- templates/todolists/public_list.html | 18 ++++++++++++++++++ todolists/views.py | 5 +++++ urls.py | 1 + 3 files changed, 24 insertions(+) create mode 100644 templates/todolists/public_list.html diff --git a/templates/todolists/public_list.html b/templates/todolists/public_list.html new file mode 100644 index 00000000..78e5b511 --- /dev/null +++ b/templates/todolists/public_list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} +{% block title %}Arch Linux - Todo Lists{% endblock %} + +{% block content %} +
+ {% for list in todo_lists %} +

{{list.name}}

+
+

{{list.description}}

+
    + {% for pkg in list.packages %} +
  • {{pkg.pkg.pkgname}}
  • + {% endfor %} +
+
+ {% endfor %} +
+{% endblock %} diff --git a/todolists/views.py b/todolists/views.py index 83dd87d6..6f1c6ed8 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -154,5 +154,10 @@ def send_todolist_email(todo): [m.email for m in maints], fail_silently=True) +def public_list(request): + todo_lists = Todolist.objects.incomplete() + return render_to_response("todolists/public_list.html", + RequestContext(request, {"todo_lists": todo_lists})) + # vim: set ts=4 sw=4 et: diff --git a/urls.py b/urls.py index 3de1d9cf..74c439fc 100644 --- a/urls.py +++ b/urls.py @@ -56,6 +56,7 @@ urlpatterns = patterns('', (r'^todo/delete/(?P\d+)/$', 'todolists.views.delete_todolist'), (r'^todo/$', 'todolists.views.list'), + (r'^todolists/$', 'todolists.views.public_list'), (r'^news/(\d+)/$', 'news.views.view'), (r'^news/add/$', 'news.views.add'), -- cgit v1.2.3-55-g3dc8