From 901c636a6bc4b1bd712b068456110a2bdd5845a7 Mon Sep 17 00:00:00 2001 From: "Nick Seidenman (N6)" Date: Fri, 17 Feb 2017 19:17:03 +1100 Subject: [PATCH] Made Intro field in content page optional. --- .../migrations/0021_auto_20170217_1857.py | 30 +++++++++++++++++++ cms_pages/models.py | 3 +- pinaxcon/settings.py | 2 +- .../cms_pages/abstract_content_page.html | 4 ++- static/src/pyconau2017/css/pyconau.css | 2 +- 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 cms_pages/migrations/0021_auto_20170217_1857.py diff --git a/cms_pages/migrations/0021_auto_20170217_1857.py b/cms_pages/migrations/0021_auto_20170217_1857.py new file mode 100644 index 00000000..ae8a0fcc --- /dev/null +++ b/cms_pages/migrations/0021_auto_20170217_1857.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-02-17 07:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms_pages', '0020_auto_20170217_1220'), + ] + + operations = [ + migrations.AlterField( + model_name='contentpage', + name='intro', + field=models.CharField(blank=True, max_length=250), + ), + migrations.AlterField( + model_name='newsindexpage', + name='intro', + field=models.CharField(blank=True, max_length=250), + ), + migrations.AlterField( + model_name='newspage', + name='intro', + field=models.CharField(blank=True, max_length=250), + ), + ] diff --git a/cms_pages/models.py b/cms_pages/models.py index b5e67961..0bded2b6 100644 --- a/cms_pages/models.py +++ b/cms_pages/models.py @@ -217,7 +217,7 @@ class AbstractContentPage(Page): class Meta: abstract = True - intro = models.CharField(max_length=250) + intro = models.CharField(max_length=250, blank=True) body = StreamField([ ("rich_text", blocks.RichTextBlock(required=False)), @@ -254,7 +254,6 @@ class ContentPage(AbstractContentPage): inset_illustration = models.CharField( choices=ILLUSTRATION_TYPES, max_length=256, - required=False, ) content_panels = AbstractContentPage.content_panels + [ diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 1c019346..d82767b0 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -245,7 +245,7 @@ DEBUG_TOOLBAR_PANELS = [ DEBUG_TOOLBAR_CONFIG = { 'INTERCEPT_REDIRECTS': False, - 'SHOW_TOOLBAR_CALLBACK': lambda x: True, + 'SHOW_TOOLBAR_CALLBACK': lambda x: False, } LOGGING = { diff --git a/pinaxcon/templates/cms_pages/abstract_content_page.html b/pinaxcon/templates/cms_pages/abstract_content_page.html index 037dea63..ffe54647 100644 --- a/pinaxcon/templates/cms_pages/abstract_content_page.html +++ b/pinaxcon/templates/cms_pages/abstract_content_page.html @@ -24,7 +24,9 @@
xxx
- {{ page.body }} +

{{ page.title }}

+

{{ page.intro }}

+ {{ page.body }}
diff --git a/static/src/pyconau2017/css/pyconau.css b/static/src/pyconau2017/css/pyconau.css index 0be0ff4e..e9c38185 100644 --- a/static/src/pyconau2017/css/pyconau.css +++ b/static/src/pyconau2017/css/pyconau.css @@ -67,7 +67,7 @@ nav { background-color: #000; width: 100%; padding-top: 10px; - padding-bottom: 10px; + /*padding-bottom: 10px;*/ padding-left: 20px; }