diff --git a/blog/static/css/blog.css b/blog/static/css/blog.css
index e69de29..e53ac34 100644
--- a/blog/static/css/blog.css
+++ b/blog/static/css/blog.css
@@ -0,0 +1,16 @@
+main > .container {
+ padding: 60px 15px 0;
+ }
+
+ .footer {
+ background-color: #f5f5f5;
+ }
+
+ .footer > .container {
+ padding-right: 15px;
+ padding-left: 15px;
+ }
+
+ code {
+ font-size: 80%;
+ }
\ No newline at end of file
diff --git a/blog/templates/base.html b/blog/templates/base.html
index 97a9752..0b22a07 100644
--- a/blog/templates/base.html
+++ b/blog/templates/base.html
@@ -1,7 +1,7 @@
{% load static wagtailuserbar %}
-
+
@@ -18,6 +18,7 @@
{# Global stylesheets #}
+
{% block extra_css %}
@@ -27,9 +28,45 @@
{% wagtailuserbar %}
+
- {% block content %}{% endblock %}
+
+
+ {% block content %}{% endblock %}
+
+
+
{# Global javascript #}
diff --git a/zapisnik/models.py b/zapisnik/models.py
index e0d9bc2..c859216 100644
--- a/zapisnik/models.py
+++ b/zapisnik/models.py
@@ -24,6 +24,13 @@ class BlogPage(Page):
intro = models.CharField(max_length=250)
body = RichTextField(blank=True)
+ def main_image(self):
+ gallery_item = self.gallery_images.first()
+ if gallery_item:
+ return gallery_item.image
+ else:
+ return None
+
search_fields = Page.search_fields + [
index.SearchField('intro'),
index.SearchField('body'),
diff --git a/zapisnik/templates/zapisnik/blog_index_page.html b/zapisnik/templates/zapisnik/blog_index_page.html
index 0f0b870..750ecd6 100644
--- a/zapisnik/templates/zapisnik/blog_index_page.html
+++ b/zapisnik/templates/zapisnik/blog_index_page.html
@@ -10,9 +10,16 @@
{{ page.intro|richtext }}
{% for post in page.get_children %}
-
- {{ post.specific.intro }}
- {# {{ post.specific.body|richtext }} #}
+ {% with post=post.specific %}
+
+
+ {% with post.main_image as main_image %}
+ {% if main_image %}{% image main_image fill-160x100 %}{% endif %}
+ {% endwith %}
+
+ {{ post.intro }}
+ {{ post.body|richtext }}
+ {% endwith %}
{% endfor %}
{% endblock %}
diff --git a/zapisnik/templates/zapisnik/blog_page.html b/zapisnik/templates/zapisnik/blog_page.html
index 150118c..3d10bbe 100644
--- a/zapisnik/templates/zapisnik/blog_page.html
+++ b/zapisnik/templates/zapisnik/blog_page.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
-{% load wagtailcore_tags %}
+{% load wagtailcore_tags wagtailimages_tags %}
{% block body_class %}template-blogpage{% endblock %}
@@ -12,6 +12,13 @@
{{ page.body|richtext }}
+ {% for item in page.gallery_images.all %}
+
+ {% image item.image fill-320x240 %}
+
{{ item.caption }}
+
+ {% endfor %}
+
Return to blog
-{% endblock %}
+{% endblock %}
\ No newline at end of file