1
Fork 0

Add subtitle field

This commit is contained in:
Jake Howard 2018-08-03 22:23:16 +01:00
parent 75cdab4b7b
commit d7a894bd80
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 78 additions and 1 deletions

View file

@ -0,0 +1,25 @@
# Generated by Django 2.0.7 on 2018-08-03 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20180730_1721'),
]
operations = [
migrations.AddField(
model_name='blogindexpage',
name='subtitle',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='blogpage',
name='subtitle',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
]

View file

@ -13,6 +13,8 @@ SHORT_BODY_LENGTH = 30
class Entity(MetadataPageMixin, Page): class Entity(MetadataPageMixin, Page):
is_home = False is_home = False
subtitle = models.CharField(max_length=255)
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)
post_date = models.DateTimeField(null=True, blank=True) post_date = models.DateTimeField(null=True, blank=True)
@ -27,6 +29,10 @@ class Entity(MetadataPageMixin, Page):
], 'Common page configuration'), ], 'Common page configuration'),
] ]
content_panels = Page.content_panels + [
FieldPanel('subtitle'),
]
@property @property
def image(self): def image(self):
return self.search_image return self.search_image

View file

@ -0,0 +1,19 @@
# Generated by Django 2.0.7 on 2018-08-03 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20180730_1721'),
]
operations = [
migrations.AddField(
model_name='homepage',
name='subtitle',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
]

View file

@ -0,0 +1,25 @@
# Generated by Django 2.0.7 on 2018-08-03 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0003_auto_20180730_1721'),
]
operations = [
migrations.AddField(
model_name='sectionindexpage',
name='subtitle',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='simplecontentpage',
name='subtitle',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
]

View file

@ -7,7 +7,9 @@
{% endif %} {% endif %}
{% include "common/breadcrumbs/index.html" %} {% include "common/breadcrumbs/index.html" %}
<h1 class="display-5">{{ page.title }}</h1> <h1 class="display-5">{{ page.title }}</h1>
<h5 class="my-3">Subtitle</h5> {% if page.subtitle %}
<h5 class="my-3">{{ page.subtitle }}</h5>
{% endif %}
<p>{% include "common/content-details.html" with page=page %}</p> <p>{% include "common/content-details.html" with page=page %}</p>
<hr /> <hr />
<div class="content mt-3"> <div class="content mt-3">