diff --git a/.gitignore b/.gitignore
index 13d1490..8346735 100644
--- a/.gitignore
+++ b/.gitignore
@@ -129,3 +129,4 @@ dmypy.json
# Pyre type checker
.pyre/
+media/
\ No newline at end of file
diff --git a/blog/settings/base.py b/blog/settings/base.py
index bc8f8e5..95f0f94 100644
--- a/blog/settings/base.py
+++ b/blog/settings/base.py
@@ -121,7 +121,7 @@ DATABASES = {
LANGUAGE_CODE = 'cs'
-TIME_ZONE = 'europe/Prague'
+TIME_ZONE = 'Europe/Prague'
USE_I18N = True
diff --git a/blog/static/css/blog.css b/blog/static/css/blog.css
index e69de29..45cd297 100644
--- a/blog/static/css/blog.css
+++ b/blog/static/css/blog.css
@@ -0,0 +1,17 @@
+
+main > .container {
+ padding: 60px 15px 0;
+}
+
+.footer {
+ background-color: #f5f5f5;
+}
+
+.footer > .container {
+ padding-right: 15px;
+ padding-left: 15px;
+}
+
+code {
+ font-size: 80%;
+}
diff --git a/blog/templates/base.html b/blog/templates/base.html
index 97a9752..d53d141 100644
--- a/blog/templates/base.html
+++ b/blog/templates/base.html
@@ -1,7 +1,7 @@
{% load static wagtailuserbar %}
-
+
@@ -15,20 +15,59 @@
{% endblock %}
-
+
{# Global stylesheets #}
+
-
+
{% block extra_css %}
{# Override this in templates to add extra stylesheets #}
{% endblock %}
-
- {% wagtailuserbar %}
+
+
+
+
+
+
+
+ {% block content %}{% endblock %}
+
+
- {% block content %}{% endblock %}
+
{# Global javascript #}
diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html
index 0ace58d..679b29f 100644
--- a/home/templates/home/home_page.html
+++ b/home/templates/home/home_page.html
@@ -7,8 +7,6 @@
{% endblock extra_css %}
-
-
{% block content %}
{{ page.body|richtext }}
diff --git a/zapisnik/migrations/0002_blogpage.py b/zapisnik/migrations/0002_blogpage.py
index 5240d1e..8b3559d 100644
--- a/zapisnik/migrations/0002_blogpage.py
+++ b/zapisnik/migrations/0002_blogpage.py
@@ -1,4 +1,4 @@
-# Generated by Django 3.1.2 on 2020-10-21 09:11
+# Generated by Django 3.1.2 on 2020-10-21 09:04
from django.db import migrations, models
import django.db.models.deletion
diff --git a/zapisnik/migrations/0003_blogpagegalleryimage.py b/zapisnik/migrations/0003_blogpagegalleryimage.py
index 2e3c8ac..5a6ffdc 100644
--- a/zapisnik/migrations/0003_blogpagegalleryimage.py
+++ b/zapisnik/migrations/0003_blogpagegalleryimage.py
@@ -1,4 +1,4 @@
-# Generated by Django 3.1.2 on 2020-10-23 09:11
+# Generated by Django 3.1.2 on 2020-10-23 09:03
from django.db import migrations, models
import django.db.models.deletion
diff --git a/zapisnik/models.py b/zapisnik/models.py
index aa275d5..2a21b1c 100644
--- a/zapisnik/models.py
+++ b/zapisnik/models.py
@@ -1,19 +1,12 @@
from django.db import models
-# Create your models here.
-
-
-from wagtail.core.fields import RichTextField
-from wagtail.admin.edit_handlers import FieldPanel
-from wagtail.search import index
from modelcluster.fields import ParentalKey
+
from wagtail.core.models import Page, Orderable
+from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
from wagtail.images.edit_handlers import ImageChooserPanel
-
-
-g
-
+from wagtail.search import index
class BlogIndexPage(Page):
@@ -23,12 +16,12 @@ class BlogIndexPage(Page):
FieldPanel('intro', classname="full")
]
+
class BlogPage(Page):
-
date = models.DateField("Post date")
intro = models.CharField(max_length=250)
body = RichTextField(blank=True)
-
+
def main_image(self):
gallery_item = self.gallery_images.first()
if gallery_item:
@@ -45,8 +38,9 @@ class BlogPage(Page):
FieldPanel('date'),
FieldPanel('intro'),
FieldPanel('body', classname="full"),
- InlinePanel('gallery_images', label="Gallery images"),
- ]
+ InlinePanel('gallery_images', label="Obrázky"),
+ ]
+
class BlogPageGalleryImage(Orderable):
page = ParentalKey(BlogPage, on_delete=models.CASCADE, related_name='gallery_images')
@@ -59,4 +53,3 @@ class BlogPageGalleryImage(Orderable):
ImageChooserPanel('image'),
FieldPanel('caption'),
]
-
diff --git a/zapisnik/templates/zapisnik/blog_index_page.html b/zapisnik/templates/zapisnik/blog_index_page.html
index 8aa0a94..ce9aedd 100644
--- a/zapisnik/templates/zapisnik/blog_index_page.html
+++ b/zapisnik/templates/zapisnik/blog_index_page.html
@@ -9,18 +9,17 @@
{{ page.intro|richtext }}
-
-
{% for post in page.get_children %}
{% 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 %}
\ No newline at end of file
+
+{% endblock %}
diff --git a/zapisnik/templates/zapisnik/blog_page.html b/zapisnik/templates/zapisnik/blog_page.html
index 471b3a9..33929c3 100644
--- a/zapisnik/templates/zapisnik/blog_page.html
+++ b/zapisnik/templates/zapisnik/blog_page.html
@@ -18,7 +18,7 @@
{{ item.caption }}
{% endfor %}
-
+
Return to blog
{% endblock %}
\ No newline at end of file