diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/blog/admin.py | 5 | ||||
-rw-r--r-- | app/blog/views.py | 2 | ||||
-rw-r--r-- | app/builder/base.py | 5 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/blog/admin.py b/app/blog/admin.py index aa8d427..7124b1d 100644 --- a/app/blog/admin.py +++ b/app/blog/admin.py @@ -33,7 +33,7 @@ class EntryAdmin(OSMGeoAdmin): field = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs) return field - list_display = ('title', 'pub_date', 'template_name', 'status', 'region', 'location', 'photo_gallery') + list_display = ('title', 'pub_date', 'home_page_banner', 'template_name', 'status', 'region', 'location', 'photo_gallery') search_fields = ['title', 'body_markdown'] prepopulated_fields = {"slug": ('title',)} list_filter = ('pub_date', 'enable_comments', 'status', 'location__state__country__lux_region') @@ -58,7 +58,8 @@ class EntryAdmin(OSMGeoAdmin): 'dek', 'meta_description', ('image', 'thumbnail'), - 'template_name' + 'template_name', + 'home_page_banner' ), }), ) diff --git a/app/blog/views.py b/app/blog/views.py index 34402b0..93d7488 100644 --- a/app/blog/views.py +++ b/app/blog/views.py @@ -11,7 +11,7 @@ from photos.models import Photo def home(request): context = { - 'object_list': Entry.objects.filter(status__exact=1).select_related()[:4] + 'object_list': Entry.objects.filter(status__exact=1,home_page_banner=1).select_related()[:4], } return render_to_response('archives/homepage.html', context, context_instance=RequestContext(request)) diff --git a/app/builder/base.py b/app/builder/base.py index 97140e5..c27c599 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -139,9 +139,8 @@ class BuildWriting(Build): self.write_file(fpath, t) def build_homepage(self): - banner = get_model('blog', 'entry').objects.filter(status__exact=1, home_page_banner=1)[:1] - qs = get_model('blog', 'entry').objects.filter(status__exact=1)[:4] - c = Context({'object_list': qs, 'banner':banner, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) + qs = get_model('blog', 'entry').objects.filter(status__exact=1,home_page_banner=1)[:4] + c = Context({'object_list': qs, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) t = render_to_string('archives/homepage.html', c).encode('utf-8') self.write_file('', t) |