Add homepage tagline to DB
This commit is contained in:
parent
ebb44cc372
commit
29a05febdb
3 changed files with 21 additions and 2 deletions
18
project/home/migrations/0004_auto_20180725_0741.py
Normal file
18
project/home/migrations/0004_auto_20180725_0741.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.0.7 on 2018-07-25 07:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('home', '0003_auto_20180724_1934'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='homepage',
|
||||
name='body',
|
||||
field=models.CharField(max_length=255),
|
||||
),
|
||||
]
|
|
@ -2,12 +2,13 @@ from wagtail.core.models import Page
|
|||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from project.common.models import Entity
|
||||
from django.db import models
|
||||
|
||||
|
||||
class HomePage(Entity):
|
||||
is_home = True
|
||||
|
||||
body = RichTextField()
|
||||
body = models.CharField(max_length=255)
|
||||
|
||||
content_panels = Entity.content_panels + [
|
||||
FieldPanel('body', classname="full")
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<header id="index-header" class="d-flex align-items-center image" data-image="{% static 'img/header.jpg' %}">
|
||||
<div class="text-center m-auto text-light">
|
||||
<h1 class="display-1">{{ settings.WAGTAIL_SITE_NAME|title }}</h1>
|
||||
<h2 class="lead"></h2>
|
||||
<h2 class="lead">{{ self.body }}</h2>
|
||||
</div>
|
||||
</header>
|
||||
{% endblock %}
|
||||
|
|
Reference in a new issue