summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/blog/admin.py5
-rw-r--r--app/blog/views.py2
-rw-r--r--app/builder/base.py5
-rw-r--r--design/templates/archives/homepage.html4
4 files changed, 8 insertions, 8 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)
diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html
index 1cd7347..c423c4c 100644
--- a/design/templates/archives/homepage.html
+++ b/design/templates/archives/homepage.html
@@ -3,7 +3,7 @@
{%block htmlclass%}class="black"{%endblock%}
{%block bodyid%}id="home" class="has-hero"{%endblock%}
-{% block primary %}<section class="banner">{% for object in banner %}{% if forloop.counter == 1 %}
+{% block primary %}<section class="banner">{% for object in object_list %}{% if forloop.counter == 1 %}
<article class="h-entry hentry {% cycle 'odd' 'even' %} {% cycle 'first' 'second' 'third' %}">
<div class="post--image">
<a href="{{object.get_absolute_url}}" title="{{object.title}}">
@@ -40,7 +40,7 @@
</div>
<div class="homepage--section">
<section class="archive homepage--archives">
- <h1 class="homepage--arc-header">Archives</h1>
+ <h1 class="homepage--arc-header">Most Popular</h1>
{% for object in object_list %}{%if forloop.counter > 1 %}
<article class="h-entry hentry">
<div class="post--image">