Add subtitle field
This commit is contained in:
parent
75cdab4b7b
commit
d7a894bd80
5 changed files with 78 additions and 1 deletions
25
project/blog/migrations/0005_auto_20180803_2106.py
Normal file
25
project/blog/migrations/0005_auto_20180803_2106.py
Normal 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,
|
||||
),
|
||||
]
|
|
@ -13,6 +13,8 @@ SHORT_BODY_LENGTH = 30
|
|||
class Entity(MetadataPageMixin, Page):
|
||||
is_home = False
|
||||
|
||||
subtitle = models.CharField(max_length=255)
|
||||
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
modified = models.DateTimeField(auto_now=True)
|
||||
post_date = models.DateTimeField(null=True, blank=True)
|
||||
|
@ -27,6 +29,10 @@ class Entity(MetadataPageMixin, Page):
|
|||
], 'Common page configuration'),
|
||||
]
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel('subtitle'),
|
||||
]
|
||||
|
||||
@property
|
||||
def image(self):
|
||||
return self.search_image
|
||||
|
|
19
project/home/migrations/0006_homepage_subtitle.py
Normal file
19
project/home/migrations/0006_homepage_subtitle.py
Normal 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,
|
||||
),
|
||||
]
|
25
project/pages/migrations/0004_auto_20180803_2106.py
Normal file
25
project/pages/migrations/0004_auto_20180803_2106.py
Normal 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,
|
||||
),
|
||||
]
|
|
@ -7,7 +7,9 @@
|
|||
{% endif %}
|
||||
{% include "common/breadcrumbs/index.html" %}
|
||||
<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>
|
||||
<hr />
|
||||
<div class="content mt-3">
|
||||
|
|
Reference in a new issue