diff --git a/blog/settings/base.py b/blog/settings/base.py index c7e4305..a6825f6 100644 --- a/blog/settings/base.py +++ b/blog/settings/base.py @@ -29,6 +29,7 @@ INSTALLED_APPS = [ 'wagtail.contrib.forms', 'wagtail.contrib.redirects', + 'wagtail.contrib.modeladmin', 'wagtail.embeds', 'wagtail.sites', 'wagtail.users', diff --git a/requirements.txt b/requirements.txt index 699e23d..1561311 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Django>=3.1,<3.2 wagtail>=2.10,<2.12 + diff --git a/stranky/migrations/0001_initial.py b/stranky/migrations/0001_initial.py index 228b1f4..0781d39 100644 --- a/stranky/migrations/0001_initial.py +++ b/stranky/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.3 on 2020-11-06 10:27 +# Generated by Django 3.1.3 on 2020-11-10 20:29 from django.db import migrations, models import django.db.models.deletion diff --git a/stranky/models.py b/stranky/models.py index 2d5c0fe..c70364c 100644 --- a/stranky/models.py +++ b/stranky/models.py @@ -8,6 +8,7 @@ from wagtail.admin.edit_handlers import FieldPanel, InlinePanel from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index + class StrankaPage(Page): body = RichTextField(blank=True) @@ -20,6 +21,7 @@ class StrankaPage(Page): InlinePanel('gallery_images', label="Obrázky"), ] + class StrankaPageGalleryImage(Orderable): page = ParentalKey(StrankaPage, on_delete=models.CASCADE, related_name='gallery_images') image = models.ForeignKey( @@ -30,4 +32,4 @@ class StrankaPageGalleryImage(Orderable): panels = [ ImageChooserPanel('image'), FieldPanel('caption'), - ] \ No newline at end of file + ] diff --git a/stranky/stanka_page.html b/stranky/templates/stranky/stranka_page.html similarity index 84% rename from stranky/stanka_page.html rename to stranky/templates/stranky/stranka_page.html index f87c078..76747f8 100644 --- a/stranky/stanka_page.html +++ b/stranky/templates/stranky/stranka_page.html @@ -2,10 +2,11 @@ {% load wagtailcore_tags wagtailimages_tags %} -{% block body_class %}template-blogpage{% endblock %} +{% block body_class %}template-strankapage{% endblock %} {% block content %}