Getting the splash homepage to work via CMS.
Nearly there. Much rubbish / cruft ripped out of site_base.html and content_page.html. Had to modify cms_pages/models.py to accommodate a "simple" layout option in the homepage editor. Still some stuff to do. Styling not quite there yet, but want to checkpoint this.
This commit is contained in:
		
							parent
							
								
									fad9c76d8f
								
							
						
					
					
						commit
						6121ce79cc
					
				
					 13 changed files with 108 additions and 72 deletions
				
			
		
							
								
								
									
										29
									
								
								cms_pages/migrations/0018_auto_20170116_1050.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								cms_pages/migrations/0018_auto_20170116_1050.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| # Generated by Django 1.9.7 on 2017-01-15 23:50 | ||||
| from __future__ import unicode_literals | ||||
| 
 | ||||
| import cms_pages.models | ||||
| from django.db import migrations, models | ||||
| import wagtail.wagtailcore.blocks | ||||
| import wagtail.wagtailcore.fields | ||||
| import wagtail.wagtailimages.blocks | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('cms_pages', '0017_auto_20160918_0945_squashed_0018_auto_20160919_0125_squashed_0018_auto_20160919_0134'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='contentpage', | ||||
|             name='inset_illustration', | ||||
|             field=models.CharField(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')], max_length=256), | ||||
|         ), | ||||
|         migrations.AlterField( | ||||
|             model_name='homepage', | ||||
|             name='body', | ||||
|             field=wagtail.wagtailcore.fields.StreamField([('basic_content', wagtail.wagtailcore.blocks.StructBlock([(b'panel_type', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('blue_left', 'Left-aligned image, blue-filtered image BG'), ('white_right', 'Right-aligned image, white background')])), (b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'inset_illustration', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')])), (b'background_image', wagtail.wagtailimages.blocks.ImageChooserBlock(help_text="This is used as the background image of a blue-left block. It's not used for white-right.", required=False)), (b'body', wagtail.wagtailcore.blocks.RawHTMLBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([(b'page', wagtail.wagtailcore.blocks.PageChooserBlock(help_text='You must specify either this, or the URL.', required=False)), (b'url', wagtail.wagtailcore.blocks.CharBlock(help_text='You must specify either this, or the URL.', required=False)), (b'title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.ExternalLinksBlock)), (b'compact', wagtail.wagtailcore.blocks.BooleanBlock(help_text="True if this block is to be displayed in 'compact' mode", required=False))])), ('keynotes', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'speakers', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.KeynoteSpeakerBlock))]))]), | ||||
|         ), | ||||
|     ] | ||||
							
								
								
									
										24
									
								
								cms_pages/migrations/0019_auto_20170116_1334.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								cms_pages/migrations/0019_auto_20170116_1334.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| # Generated by Django 1.9.7 on 2017-01-16 02:34 | ||||
| from __future__ import unicode_literals | ||||
| 
 | ||||
| import cms_pages.models | ||||
| from django.db import migrations | ||||
| import wagtail.wagtailcore.blocks | ||||
| import wagtail.wagtailcore.fields | ||||
| import wagtail.wagtailimages.blocks | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('cms_pages', '0018_auto_20170116_1050'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='homepage', | ||||
|             name='body', | ||||
|             field=wagtail.wagtailcore.fields.StreamField([('basic_content', wagtail.wagtailcore.blocks.StructBlock([(b'panel_type', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('simple', 'Simple panel, no image.'), ('blue_left', 'Left-aligned image, blue-filtered image BG'), ('white_right', 'Right-aligned image, white background')])), (b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'inset_illustration', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')])), (b'background_image', wagtail.wagtailimages.blocks.ImageChooserBlock(help_text="This is used as the background image of a blue-left block. It's not used for white-right.", required=False)), (b'body', wagtail.wagtailcore.blocks.RawHTMLBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([(b'page', wagtail.wagtailcore.blocks.PageChooserBlock(help_text='You must specify either this, or the URL.', required=False)), (b'url', wagtail.wagtailcore.blocks.CharBlock(help_text='You must specify either this, or the URL.', required=False)), (b'title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.ExternalLinksBlock)), (b'compact', wagtail.wagtailcore.blocks.BooleanBlock(help_text="True if this block is to be displayed in 'compact' mode", required=False))])), ('keynotes', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'speakers', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.KeynoteSpeakerBlock))]))]), | ||||
|         ), | ||||
|     ] | ||||
|  | @ -106,9 +106,11 @@ class BasicContentBlock(blocks.StructBlock): | |||
|     class Meta: | ||||
|         template = "cms_pages/home_page_blocks/basic_content.html" | ||||
| 
 | ||||
|     PANEL_SIMPLE = "simple" | ||||
|     PANEL_BLUE_LEFT = "blue_left" | ||||
|     PANEL_WHITE_RIGHT = "white_right" | ||||
|     PANEL_TYPES = ( | ||||
|         (PANEL_SIMPLE, "Simple panel, no image."), | ||||
|         (PANEL_BLUE_LEFT, "Left-aligned image, blue-filtered image BG"), | ||||
|         (PANEL_WHITE_RIGHT, "Right-aligned image, white background"), | ||||
|     ) | ||||
|  | @ -127,7 +129,8 @@ class BasicContentBlock(blocks.StructBlock): | |||
|         help_text="This is used as the background image of a " | ||||
|                   "blue-left block. It's not used for white-right." | ||||
|     ) | ||||
|     body = blocks.RichTextBlock(required=True) | ||||
|     #body = blocks.RichTextBlock(required=True) | ||||
|     body = blocks.RawHTMLBlock(required=True) | ||||
|     link = BasicContentLink() | ||||
|     external_links = blocks.ListBlock(ExternalLinksBlock) | ||||
|     compact = blocks.BooleanBlock( | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir | |||
| PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) | ||||
| BASE_DIR = PACKAGE_ROOT | ||||
| 
 | ||||
| DEBUG = bool(int(os.environ.get("DEBUG", "1"))) | ||||
| DEBUG = True #bool(int(os.environ.get("DEBUG", "1"))) | ||||
| 
 | ||||
| DATABASES = { | ||||
|     "default": { | ||||
|  |  | |||
|  | @ -9,8 +9,15 @@ | |||
|   {% define "" as compact %} | ||||
| {% endif %} | ||||
| 
 | ||||
| {% if value.panel_type == "simple" %} | ||||
| 
 | ||||
| {% if value.panel_type == "blue_left" %} | ||||
| <div class="panel panel__bg {{ compact }}"> | ||||
|   <div class="panel--content"> | ||||
|     {% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %} | ||||
|   </div> | ||||
| </div> | ||||
| 
 | ||||
| {% elif value.panel_type == "blue_left" %} | ||||
| 
 | ||||
| <div class="panel panel__bg {{ compact }}"> | ||||
|   {% image value.background_image width-2000 as background_image %} | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ | |||
| 
 | ||||
|       <div style="background-image: url('{% block header_background_image %}{% endblock %}');" class="panel--bg"></div> | ||||
| 
 | ||||
|       <h1>Or is it here?</h1> | ||||
|       <div class="panel--content"> | ||||
|         <div class="panel--2-3"> | ||||
|           <h2>{% block header_title %}{% endblock %}</h2> | ||||
|  |  | |||
|  | @ -13,6 +13,9 @@ | |||
| 
 | ||||
|     <link rel="icon" type="image/png" href="http://2017.pycon-au.org/favicon.png"> | ||||
|     <link href="{% static 'pyconau2017/css/bootstrap.css' %}" rel="stylesheet"> | ||||
| 
 | ||||
|     <link rel="stylesheet" href="{% static 'pyconau2017/css/app.css' %}"> | ||||
|     <link rel="stylesheet" href="{% static 'pyconau2017/css/print.css' %}" media="print"> | ||||
|     <link href="{% static 'pyconau2017/css/pyconau.css' %}" rel="stylesheet"> | ||||
| 
 | ||||
|     <!-- Taken from site_base.html will need fixing --> | ||||
|  |  | |||
|  | @ -13,31 +13,27 @@ | |||
| {% block head_title %}{% endblock %} | ||||
| 
 | ||||
| {% block body %} | ||||
|   {% block heading_panel %} | ||||
|     <div class="panel panel__compact panel__bg"> | ||||
| 
 | ||||
|   {% block heading_panel %} | ||||
|     <div style="background-image: url('{% block header_background_image %}{% endblock %}');" class="panel--bg"></div> | ||||
| 
 | ||||
|       <div class="panel--content"> | ||||
|         <div class="panel--2-3"> | ||||
|           <h2>{% block header_title %}{% endblock %}</h2> | ||||
|           {% block header_title %}{% endblock %} | ||||
|           <p class="lede">{% block header_paragraph %}{% endblock %}</p> | ||||
|         </div> | ||||
|         {% block header_inset_image_base %} | ||||
|           <div class="panel--1-3"> | ||||
|             <div class="portrait"> | ||||
|               <div style="background-image: url('{% block header_inset_image %}{% endblock %}');" class="portrait--img"></div> | ||||
|             </div> | ||||
|           </div> | ||||
|         {% endblock %} | ||||
|     </div> | ||||
| 
 | ||||
|     </div> | ||||
| 
 | ||||
|   {% block topbar_base %} | ||||
|   {% endblock %} | ||||
|   {% endblock %} | ||||
| 
 | ||||
|   {% block content_base %} | ||||
|     <div class="l-content-page"> | ||||
|       <div class="l-content-page--richtext"> | ||||
|       <div class="l-content-page"> | ||||
|         {% block content %} | ||||
|         {% endblock %} | ||||
|       </div> | ||||
|  | @ -48,3 +44,4 @@ | |||
| {% block extra_script %} | ||||
|   <script src="{% static 'js/site-92ae8d0d6c.js' %}" type="text/javascript"></script> | ||||
| {% endblock %} | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,16 +9,25 @@ | |||
|     <meta charset="utf-8"> | ||||
|     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||
|     <meta name="description" content=""> | ||||
| 
 | ||||
|     <!-- disable browser cache (for now) --> | ||||
|     <meta http-equiv="cache-control" content="max-age=0" /> | ||||
|     <meta http-equiv="cache-control" content="no-cache" /> | ||||
|     <meta http-equiv="expires" content="0" /> | ||||
|     <meta http-equiv="expires" content="Tue, 01 Jan 1990 12:00:00 GMT" /> | ||||
| 
 | ||||
| 
 | ||||
| {% block viewport %} | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||||
| {% endblock %} | ||||
|     <title>{% block head_title_base %}{% if SITE_NAME %}{{ SITE_NAME }} | {% endif %}{% block head_title %}{% endblock %}{% endblock %}</title> | ||||
| {% block styles %} | ||||
|     <link rel="stylesheet" href="{% static 'pyconau2017/css/app.css' %}"> | ||||
|     <link rel="stylesheet" href="{% static 'pycon2017/css/print.css' %}" media="print"> | ||||
|     <link rel="stylesheet" href="{% static 'pyconau2017/css/print.css' %}" media="print"> | ||||
|     <link href="{% static 'pyconau2017/css/pyconau.css' %}" rel="stylesheet"> | ||||
|     <link href="{% static 'pyconau2017/css/bootstrap.css' %}" rel="stylesheet"> | ||||
| 
 | ||||
|     <link rel="icon" href="{% static 'pycon2017/images/favicon.ico' %}" | ||||
|     <!--FIXME: download--> | ||||
|     <link href="https://fonts.googleapis.com/css?family=Titillium+Web:700,900|Roboto:400italic,400,700,700italic" rel="stylesheet" type="text/css"> | ||||
|     <!--Meta tags--> | ||||
|     <meta name="theme-color" content="#0c486c"> | ||||
|     {% block extra_style %} | ||||
|  | @ -43,79 +52,37 @@ | |||
|             {% block extra_head %}{% endblock %} | ||||
|         {% endblock %} | ||||
|   </head> | ||||
|   <body class="{% block body_class %}{% endblock %}"> | ||||
|   <body class="{% block body_class %}{% endblock %}" | ||||
|       style="background-image: url({% static 'pyconau2017/images/pyconau-2016-collage.jpg' %});"> | ||||
| {% block topbar_base %} | ||||
|     <header role="banner" class="l-header"> | ||||
|       <div class="l-header--logo"> | ||||
|         {% block site_brand %} | ||||
|           <a href="/" | ||||
|             title="2017.pycon-au.org | 3-8 August, Melbourne | Python FTW!" | ||||
|           > | ||||
|             <img src="{% static 'pyconau2017/images/logo-mel-17.png' %}" | ||||
|               width="100%" | ||||
|               title="pycon-au.org | 3-8 August, Melbourne | Python FTW!" | ||||
|               /> | ||||
|           </a> | ||||
|         {% endblock %} | ||||
|       </div> | ||||
|     {# | ||||
|     {% block nav %} | ||||
|         {% sitetree_menu from "main" include "trunk" template "sitetree_header.html" %} | ||||
|       <a href="#" data-menu-opener="" class="l-header--menu-opener"></a> | ||||
|     </header> | ||||
|       {% sitetree_menu from "main" include "trunk" template "sitetree_opener.html" %} | ||||
|     {% endblock %} | ||||
|     #} | ||||
| {% endblock %} | ||||
| 
 | ||||
| {% block body_base %} | ||||
|   <div style="height: 100px;" /> | ||||
|     <main role="main"> | ||||
| <div class="l-content-page"> | ||||
|         <section id="content_body"> | ||||
|         <div class="container"> | ||||
|             {% include "_messages.html" %} | ||||
|             <div class="row"> | ||||
|                 <div class="col-md-9"> | ||||
|     {% block body %} | ||||
|       {% block content %} | ||||
|       {% endblock %} | ||||
|     {% endblock %} | ||||
|   </div> | ||||
|                 <div class="col-md-3"> | ||||
|                     {% block sidebar %} | ||||
|                         {% include "_default_sidebar.html" %} | ||||
|                     {% endblock %} | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </section> | ||||
| </div> | ||||
| {% endblock %} | ||||
| 
 | ||||
| {% block footer_base %} | ||||
|   <!-- https://gist.github.com/geedmo/5682742--> | ||||
|   <footer class="l-footer l-footer__alt"> | ||||
|     {% block footer %} | ||||
|       <div class="l-footer--text"> | ||||
|         <h3>Sponsors</h3> | ||||
|         <p class="lede">We thank our sponsors for their | ||||
|           generous contribution to Pycon Australia 2017.</p> | ||||
|         <a href="/sponsors" class="btn btn__white">Other Sponsors</a> | ||||
|       </div> | ||||
|       <div class="l-footer--logos"> | ||||
|         <div class="l-footer--logo"> | ||||
|           <img src="{% static 'lca2017/images/HPE.svg' %}"> | ||||
|         </div> | ||||
|         <div class="l-footer--logo"> | ||||
|           <img src="{% static 'lca2017/images/IBM.svg' %}"> | ||||
|         </div> | ||||
|         <br /> | ||||
|       </div> | ||||
| 
 | ||||
|       <p class="lede">©2016 Pycon Australia 2017. Linux is a registered trademark of Linus Torvalds. Site design by <a href="http://takeflight.com.au" >Takeflight</a>. Image credits can be found on our <a href="/about/colophon">Colophon</a>.</p> | ||||
| 
 | ||||
|     {% endblock %} | ||||
|   </footer> | ||||
| {% endblock %} | ||||
| 
 | ||||
|     </main> | ||||
|     {% block scripts %} | ||||
|     {% comment%} | ||||
|  |  | |||
|  | @ -12,9 +12,10 @@ | |||
| {% endblock %} | ||||
| 
 | ||||
| {% block scripts %} | ||||
| <script src="{% static 'lca2017/js/app.js' %}" type="text/javascript"></script> | ||||
| 
 | ||||
| <script src="{% static 'pyconau2017/js/app.js' %}" type="text/javascript"></script> | ||||
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> | ||||
| <script src="{% static 'lca2017/js/load_editors.js' %}" type="text/javascript"></script> | ||||
| <script src="{% static 'pyconau2017/js/load_editors.js' %}" type="text/javascript"></script> | ||||
| <script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js"></script> | ||||
| <script src="{{ STATIC_URL }}js/jquery.formset.js"></script> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1493,7 +1493,8 @@ table.alt tr:not(:last-of-type) { | |||
| 
 | ||||
| 
 | ||||
| .l-footer__alt { | ||||
|   background-color: #0c486c; | ||||
|   /* background-color: #0c486c; */ | ||||
|   background-color: transparent; | ||||
|   color: white; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1464,6 +1464,7 @@ table.alt tr:not(:last-of-type) { | |||
|   padding: 50px 40px; | ||||
|   padding: 3.125rem 40px; | ||||
|   width: 100%; | ||||
|   opacity: 0.0; | ||||
| } | ||||
| 
 | ||||
| .l-footer--logos { | ||||
|  | @ -1493,7 +1494,8 @@ table.alt tr:not(:last-of-type) { | |||
| 
 | ||||
| 
 | ||||
| .l-footer__alt { | ||||
|   background-color: #0c486c; | ||||
|   /*background-color: #0c486c; */ | ||||
|   background-color: #420045; | ||||
|   color: white; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -35,6 +35,7 @@ body { | |||
| .jumbotron h1 { | ||||
|     font-size: 3em; | ||||
|     font-family: 'Flux Regular'; | ||||
|     background-color: #000; | ||||
| } | ||||
| 
 | ||||
| #announcements { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Nick Seidenman (N6)
						Nick Seidenman (N6)