diff --git a/home/migrations/0003_homepage_body.py b/home/migrations/0003_homepage_body.py new file mode 100644 index 0000000000000000000000000000000000000000..21b519a3e5d35f0b73de0fa974415f8a73dab463 --- /dev/null +++ b/home/migrations/0003_homepage_body.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.5 on 2020-04-16 15:07 + +import wagtail.core.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("home", "0002_create_homepage"), + ] + + operations = [ + migrations.AddField( + model_name="homepage", + name="body", + field=wagtail.core.fields.RichTextField(blank=True), + ), + ] diff --git a/home/models.py b/home/models.py index c73914118e2531bf5d22d9ec8936d15a6d92cba1..faebe99e0ccfa860cf2098581c83248fc84ac117 100644 --- a/home/models.py +++ b/home/models.py @@ -1,6 +1,11 @@ -from django.db import models +from wagtail.admin.edit_handlers import FieldPanel +from wagtail.core.fields import RichTextField from wagtail.core.models import Page class HomePage(Page): - pass + body = RichTextField(blank=True) + + content_panels = Page.content_panels + [ + FieldPanel("body", classname="full"), + ] diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index db9e9b0366c49051aa07f704dc2e31938a5ad365..d1a2f6d698872849c03f8a8d1c19ac5c25e4fbd3 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -1,21 +1,9 @@ {% extends "base.html" %} -{% load static %} -{% block body_class %}template-homepage{% endblock %} - -{% block extra_css %} +{% load wagtailcore_tags %} -{% comment %} -Delete the line below if you're just getting started and want to remove the welcome screen! -{% endcomment %} -<link rel="stylesheet" href="{% static 'css/welcome_page.css' %}"> -{% endblock extra_css %} +{% block body_class %}template-homepage{% endblock %} {% block content %} - -{% comment %} -Delete the line below if you're just getting started and want to remove the welcome screen! -{% endcomment %} -{% include 'home/welcome_page.html' %} - -{% endblock content %} + {{ page.body|richtext }} +{% endblock %}