From 31a252c2a556acb655f603d7c4b852987d64ef05 Mon Sep 17 00:00:00 2001 From: Will Larson Date: Mon, 7 Jul 2008 13:20:46 +0900 Subject: [PATCH] Can now edit current `site` within LifeFlow Editor. Cannot edit other sites, however. --- editor/urls.py | 1 + editor/views.py | 10 +++++++++- templates/lifeflow/editor/site.html | 30 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 templates/lifeflow/editor/site.html diff --git a/editor/urls.py b/editor/urls.py index 6e6d37d..744cc1f 100644 --- a/editor/urls.py +++ b/editor/urls.py @@ -8,6 +8,7 @@ (r'^admin/blogroll/$', 'blogroll'), (r'^admin/sites_to_ping/$', 'sites_to_notify'), + (r'^admin/site_config/$', 'site_config'), (r'^authors/$', 'authors'), diff --git a/editor/views.py b/editor/views.py index 626b318..17d0627 100644 --- a/editor/views.py +++ b/editor/views.py @@ -27,6 +27,7 @@ from django.contrib.auth import login as auth_login from django.contrib.auth import views, authenticate from django.core.paginator import QuerySetPaginator +from django.contrib.sites.models import Site CHARACTERS_TO_STRIP = """ .,!?'";:/\+=# """ @@ -108,6 +109,13 @@ def sites_to_notify(request): {'sites_to_notify':sites}, RequestContext(request,{})) +@login_required +def site_config(request): + site = Site.objects.get_current() + return render_to_response('lifeflow/editor/site.html', + {'sites_to_notify':site}, + RequestContext(request,{})) + @login_required def files(request): resources = Resource.objects.all() @@ -196,7 +204,7 @@ def update(request): return HttpResponse("success") -API_CLASSES = {"comment":Comment, "project":Project, "flow":Flow, "tag":Tag, "series":Series, "draft":Draft, "entry":Entry, "author":Author, "resource":Resource, "recommendedsite":RecommendedSite,'site_to_notify':SiteToNotify} +API_CLASSES = {"comment":Comment, "project":Project, "flow":Flow, "tag":Tag, "series":Series, "draft":Draft, "entry":Entry, "author":Author, "resource":Resource, "recommendedsite":RecommendedSite,'site_to_notify':SiteToNotify,'site':Site} def get_class(str): return API_CLASSES[str] diff --git a/templates/lifeflow/editor/site.html b/templates/lifeflow/editor/site.html new file mode 100644 index 0000000..86a992f --- /dev/null +++ b/templates/lifeflow/editor/site.html @@ -0,0 +1,30 @@ +{% extends "lifeflow/editor/admin_base.html" %} + +{% block body2 %} + + +
+
+ + + +{% endblock %} \ No newline at end of file