diff options
Diffstat (limited to 'apps/build/base.py')
-rw-r--r-- | apps/build/base.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/build/base.py b/apps/build/base.py index 9ba6dfb..6021532 100644 --- a/apps/build/base.py +++ b/apps/build/base.py @@ -36,7 +36,7 @@ class BuildWriting(Build): ''' qs = self.get_model_querset() for entry in qs: - c = Context({'object':entry,'MEDIA_URL':settings.BAKED_MEDIA_URL}) + c = Context({'object':entry,'MEDIA_URL':settings.BAKED_MEDIA_URL, 'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('details/entry.html',c).encode('utf-8') path = '%s%s/%s/' %(settings.BAKED_ROOT, entry.pub_date.strftime("%Y/%b/%d").lower(), entry.slug) if not os.path.isdir(path): @@ -85,7 +85,7 @@ class BuildWriting(Build): def build_homepage(self): self.build_recent_entries() qs = get_model('blog', 'entry').objects.filter(status__exact=1).latest() - c = Context({'featured':qs,'MEDIA_URL':settings.BAKED_MEDIA_URL}) + c = Context({'featured':qs,'MEDIA_URL':settings.BAKED_MEDIA_URL, 'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('archives/homepage.html',c).encode('utf-8') fpath = '%s%s' %(settings.BAKED_ROOT,'index.html') self.write_file(fpath,t) @@ -109,7 +109,7 @@ class BuildPhotos(BuildWriting): Grab all the blog posts, render them to a template string and write that out to the filesystem ''' for photo in qs: - c = Context({'object':photo,'MEDIA_URL':settings.BAKED_MEDIA_URL}) + c = Context({'object':photo,'MEDIA_URL':settings.BAKED_MEDIA_URL, 'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('details/photo_galleries.html',c).encode('utf-8') path = '%sphotos/galleries/%s/' %(settings.BAKED_ROOT, photo.set_slug) if not os.path.isdir(path): @@ -125,7 +125,7 @@ class BuildAbout(Build): qs = model.objects.filter(key__in=['about_top','about_middle','about_bottom']) c = Context({ 'object_list': qs, - 'IMAGES_URL' : settings.IMAGES_URL, + 'IMAGES_URL' : settings.BAKED_IMAGES_URL, 'MEDIA_URL':settings.BAKED_MEDIA_URL }) t = render_to_string('details/about.html',c).encode('utf-8') @@ -143,18 +143,18 @@ class BuildMap(Build): cl = get_model('locations', 'Country').objects.filter(visited=True).exclude(name='default') rl = get_model('locations', 'Region').objects.all() rtl = get_model('locations', 'Route').objects.all() - c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl, 'MEDIA_URL':settings.BAKED_MEDIA_URL}) + c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl, 'MEDIA_URL':settings.BAKED_MEDIA_URL, 'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('bin/map_entry_list.html',c).encode('utf-8') fpath = '%s%s' %(settings.PROJ_ROOT,'media/js/mainmap.js') self.write_file(fpath,t) - c = Context({'country_list':cl,'region_list':rl,'route_list':rtl,'MEDIA_URL':settings.BAKED_MEDIA_URL}) + c = Context({'country_list':cl,'region_list':rl,'route_list':rtl,'MEDIA_URL':settings.BAKED_MEDIA_URL, 'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('bin/map_sidebar.html',c).encode('utf-8') fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_sidebar.html') self.write_file(fpath,t) def build(self): self.build_map_templates() - c = Context({'MEDIA_URL':settings.BAKED_MEDIA_URL,}) + c = Context({'MEDIA_URL':settings.BAKED_MEDIA_URL,'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('archives/map.html', c).encode('utf-8') path = '%smap/' %(settings.BAKED_ROOT) if not os.path.isdir(path): @@ -186,7 +186,7 @@ class BuildProjects(Build): def build_project_archive(self): qs = get_model('projects', 'Project').objects.filter(status__exact=1).order_by('-pub_date') - c = Context({'object_list': qs,'MEDIA_URL':settings.BAKED_MEDIA_URL,}) + c = Context({'object_list': qs,'MEDIA_URL':settings.BAKED_MEDIA_URL,'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('archives/projects.html', c).encode('utf-8') path = '%sprojects/' %(settings.BAKED_ROOT) if not os.path.isdir(path): @@ -202,7 +202,7 @@ class BuildProjects(Build): qs = model.objects.filter(visited__exact=True).order_by("-date_visited_begin") else: qs = model.objects.filter(status__exact=1) - c = Context({'object_list': qs,'MEDIA_URL':settings.BAKED_MEDIA_URL,}) + c = Context({'object_list': qs,'MEDIA_URL':settings.BAKED_MEDIA_URL,'IMAGES_URL':settings.BAKED_IMAGES_URL}) t = render_to_string('details/%s.html' %(proj['slug']), c).encode('utf-8') path = '%sprojects/%s/' %(settings.BAKED_ROOT, proj['slug']) if not os.path.isdir(path): |