diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/builder/base.py | 3 | ||||
-rw-r--r-- | app/builder/views.py | 124 | ||||
-rw-r--r-- | app/lib/upload/urls.py | 2 | ||||
-rw-r--r-- | app/links/urls.py | 2 | ||||
-rw-r--r-- | app/locations/admin.py | 4 | ||||
-rw-r--r-- | app/locations/urls.py | 2 | ||||
-rw-r--r-- | app/projects/views.py | 14 |
7 files changed, 74 insertions, 77 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index 56d4149..9d219d4 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -3,7 +3,6 @@ from math import ceil from decimal import Decimal from django.test.client import Client from django.template.loader import render_to_string -from django.conf import settings from django.template import Context from django.db.models import get_model from django.conf import settings @@ -274,5 +273,5 @@ class BuildAbout(Build): fpath = '%sindex.html' %(path) self.write_file(fpath,t) -class BuildCodeSite(Build): +#class BuildCodeSite(Build): diff --git a/app/builder/views.py b/app/builder/views.py index 9926ff8..f7a4392 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -5,72 +5,72 @@ from django.shortcuts import render_to_response,get_object_or_404,redirect from django.template import RequestContext from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPages, BuildPhotos,BuildAbout,BuildProjects,BuildSitemap,BuildContact + def do_build(request): - section = request.GET.get('id', '') - if section != '': - - #build writing archives - if section == 'writing': - BuildWriting().build() - context = {'message': 'Writing Posts to Disk',} + section = request.GET.get('id', '') + if section != '': + + #build writing archives + if section == 'writing': + BuildWriting().build() + context = {'message': 'Writing Posts to Disk',} - #build photo galleries - elif section == 'photos': - BuildPhotos().build() - context = {'message': 'Writing Photo Galleries to Disk',} - - #build project pages - elif section == 'projects': - BuildProjects().build() - context = {'message': 'Writing Project pages to Disk',} - - #build pages - elif section == 'pages': - BuildPages().build() - context = {'message': 'Writing Pages to Disk',} - - #build map - elif section == 'map': - BuildMap().build() - context = {'message': 'Writing Map to Disk',} - - #build Writing RSS Feed - elif section == 'feed': - BuildWritingFeed().build() - context = {'message': 'Writing RSS Feed to Disk',} - - #build Sitemap - elif section == 'sitemap': - BuildSitemap().build() - context = {'message': 'Writing Sitemap to Disk',} + #build photo galleries + elif section == 'photos': + BuildPhotos().build() + context = {'message': 'Writing Photo Galleries to Disk',} + + #build project pages + elif section == 'projects': + BuildProjects().build() + context = {'message': 'Writing Project pages to Disk',} + + #build pages + elif section == 'pages': + BuildPages().build() + context = {'message': 'Writing Pages to Disk',} + + #build map + elif section == 'map': + BuildMap().build() + context = {'message': 'Writing Map to Disk',} + + #build Writing RSS Feed + elif section == 'feed': + BuildWritingFeed().build() + context = {'message': 'Writing RSS Feed to Disk',} + + #build Sitemap + elif section == 'sitemap': + BuildSitemap().build() + context = {'message': 'Writing Sitemap to Disk',} - #build Everything need for new post - elif section == 'newpost': - #build writing archives/details pages/homepage - BuildWriting().build() - #build map - BuildMap().build() - #build feed - BuildWritingFeed().build() - #build sitemap - BuildSitemap().build() - context = {'message': 'Publishing New Post',} - - #build Homepage - elif section == 'home': - BuildWriting().build_homepage() - context = {'message': 'Writing Homepage to Disk',} - """ - elif section == 'all': - g.build_entire_site() - context = {'message': 'Writing Entire Site to disk',} - """ + #build Everything need for new post + elif section == 'newpost': + #build writing archives/details pages/homepage + BuildWriting().build() + #build map + BuildMap().build() + #build feed + BuildWritingFeed().build() + #build sitemap + BuildSitemap().build() + context = {'message': 'Publishing New Post',} + + #build Homepage + elif section == 'home': + BuildWriting().build_homepage() + context = {'message': 'Writing Homepage to Disk',} + """ + elif section == 'all': + g.build_entire_site() + context = {'message': 'Writing Entire Site to disk',} + """ - else: - context = {} - #return redirect('/admin/', message='test') - return render_to_response('admin/message.html', context, context_instance = RequestContext(request)) - #return HttpResponseRedirect(reverse('admin:index')) + else: + context = {} + #return redirect('/admin/', message='test') + return render_to_response('admin/message.html', context, context_instance = RequestContext(request)) diff --git a/app/lib/upload/urls.py b/app/lib/upload/urls.py index 0e96b11..c95d71f 100644 --- a/app/lib/upload/urls.py +++ b/app/lib/upload/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import * import views as upload_views urlpatterns = patterns('', url(r'download/$', upload_views.download), diff --git a/app/links/urls.py b/app/links/urls.py index 5a16d6e..fa8e042 100644 --- a/app/links/urls.py +++ b/app/links/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import * from django.views.generic import list_detail from django.views.generic.simple import redirect_to from links.models import Link diff --git a/app/locations/admin.py b/app/locations/admin.py index a23ef28..0d1c57a 100644 --- a/app/locations/admin.py +++ b/app/locations/admin.py @@ -1,12 +1,12 @@ from django.contrib import admin from django.contrib.gis.admin import OSMGeoAdmin from locations.models import Region,Country,Location,State,Route -from django.contrib import databrowse + from django.contrib.gis.maps.google import GoogleMap from django.conf import settings GMAP = GoogleMap(key=settings.GOOGLE_MAPS_API_KEY) -databrowse.site.register(Region) + class RegionAdmin(OSMGeoAdmin): # Standard Django Admin Options diff --git a/app/locations/urls.py b/app/locations/urls.py index 0a2a462..8bc86aa 100644 --- a/app/locations/urls.py +++ b/app/locations/urls.py @@ -1,5 +1,5 @@ -from django.conf.urls.defaults import * +from django.conf.urls import * urlpatterns = patterns('', (r'data/(?P<id>\d+)/$', 'locations.views.data_json'), diff --git a/app/projects/views.py b/app/projects/views.py index 90db6ba..e9c755f 100644 --- a/app/projects/views.py +++ b/app/projects/views.py @@ -1,6 +1,5 @@ from django.shortcuts import render_to_response,get_object_or_404 from django.template import RequestContext -from django.views.generic.list_detail import object_list from django.db.models import get_model from django.http import HttpResponse from django.core import serializers @@ -10,7 +9,7 @@ from projects.models.base import Project from projects.models.fiveby import FiveBy from projects.models.natparks import NationalParks from projects.models.gifs import AnimatedGif -from projects.models.code import CodeBlogEntry + projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks','code':'Code'} """ @@ -23,18 +22,17 @@ def detail(request,slug): qs = model.objects.filter(visited__exact=True).order_by("-date_visited_begin") else: qs = model.objects.filter(status__exact=1) + context = { + "object_list" : qs, + } template = 'details/%s.html' %(slug) - return object_list(request, queryset=qs, template_name=template,) + return render_to_response(template, context, context_instance = RequestContext(request)) + def gif_detail(request,slug): obj = get_object_or_404(AnimatedGif, slug__exact=slug) return render_to_response('details/gifs.html', {'object': obj}, context_instance=RequestContext(request)) -def code_entry_detail(request, year, month, day, slug): - obj = get_object_or_404(CodeBlogEntry, slug__exact=slug) - return render_to_response('details/code_blog.html', {'object': obj}, context_instance=RequestContext(request)) - - def data_json(request, id): qs = NationalParks.objects.filter(pk=id) |