Add description to chapter
This commit is contained in:
parent
551f20544a
commit
e425122455
|
|
@ -2,6 +2,10 @@
|
||||||
<div class="chapter">
|
<div class="chapter">
|
||||||
<h3>{{chapter.title}}</h3>
|
<h3>{{chapter.title}}</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{chapter.description}}
|
||||||
|
</p>
|
||||||
|
|
||||||
<add-content-block-button :parent="chapter.id"></add-content-block-button>
|
<add-content-block-button :parent="chapter.id"></add-content-block-button>
|
||||||
|
|
||||||
<content-block :contentBlock="contentBlock"
|
<content-block :contentBlock="contentBlock"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ query ModulesQuery($slug: String!) {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
|
description
|
||||||
contentBlocks {
|
contentBlocks {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 2.0.6 on 2018-10-03 16:44
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('book', '0006_auto_20181002_1359'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='chapter',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(blank=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from django.db import models
|
||||||
from wagtail.admin.edit_handlers import FieldPanel, TabbedInterface, ObjectList
|
from wagtail.admin.edit_handlers import FieldPanel, TabbedInterface, ObjectList
|
||||||
|
|
||||||
from core.wagtail_utils import StrictHierarchyPage
|
from core.wagtail_utils import StrictHierarchyPage
|
||||||
|
|
@ -12,8 +13,11 @@ class Chapter(StrictHierarchyPage):
|
||||||
verbose_name = 'Kapitel'
|
verbose_name = 'Kapitel'
|
||||||
verbose_name_plural = 'Kapitel'
|
verbose_name_plural = 'Kapitel'
|
||||||
|
|
||||||
|
description = models.TextField(blank=True)
|
||||||
|
|
||||||
content_panels = [
|
content_panels = [
|
||||||
FieldPanel('title', classname="full title"),
|
FieldPanel('title', classname="full title"),
|
||||||
|
FieldPanel('description', classname="full description"),
|
||||||
]
|
]
|
||||||
|
|
||||||
settings_panels = [
|
settings_panels = [
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class ChapterNode(DjangoObjectType):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Chapter
|
model = Chapter
|
||||||
only_fields = [
|
only_fields = [
|
||||||
'slug', 'title',
|
'slug', 'title', 'description',
|
||||||
]
|
]
|
||||||
filter_fields = [
|
filter_fields = [
|
||||||
'slug', 'title',
|
'slug', 'title',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue