summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/blog/models.py1
-rw-r--r--app/builder/base.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/app/blog/models.py b/app/blog/models.py
index d2fe954..8ab28b6 100644
--- a/app/blog/models.py
+++ b/app/blog/models.py
@@ -69,6 +69,7 @@ class Entry(models.Model):
(5, 'bigimg-dark'),
)
template_name = models.IntegerField(choices=TEMPLATES, default=0)
+ home_page_banner = models.BooleanField(default=False)
class Meta:
ordering = ('-pub_date',)
diff --git a/app/builder/base.py b/app/builder/base.py
index 59dcef8..97140e5 100644
--- a/app/builder/base.py
+++ b/app/builder/base.py
@@ -139,8 +139,9 @@ 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, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL})
+ c = Context({'object_list': qs, 'banner':banner, '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)