Merge branch 'master' of github.com:wagtail/bakerydemo

pull/20/head
Edd Baldry 2017-02-10 16:25:35 +00:00
commit 9f2ca052a1
13 zmienionych plików z 121 dodań i 35 usunięć

Wyświetl plik

@ -1,2 +1,2 @@
release: yes "yes" | python manage.py migrate
web: uwsgi --http :$PORT --module bakerydemo.heroku_wsgi --master --offload-threads 1
web: gunicorn bakerydemo.heroku_wsgi --log-file -

Wyświetl plik

@ -40,7 +40,7 @@ class BlockQuote(StructBlock):
"""
Custom `StructBlock` that allows the user to attribute a quote to the author
"""
text = TextBlock(),
text = TextBlock()
attribute_name = CharBlock(
blank=True, required=False, label='e.g. Guy Picciotto')
@ -54,6 +54,7 @@ class BaseStreamBlock(StreamBlock):
"""
Define the custom blocks that `StreamField` will utilize
"""
intro_block = TextBlock()
heading_block = HeadingBlock()
paragraph_block = RichTextBlock(
icon="fa-paragraph",

Wyświetl plik

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-10 15:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0004_auto_20170210_1445'),
('base', '0004_auto_20170210_1420'),
]
operations = [
]

Wyświetl plik

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-10 15:56
from __future__ import unicode_literals
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
dependencies = [
('base', '0005_merge_20170210_1539'),
]
operations = [
migrations.AlterField(
model_name='aboutpage',
name='body',
field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='About page detail'),
),
migrations.AlterField(
model_name='formpage',
name='body',
field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))]),
),
migrations.AlterField(
model_name='homepage',
name='body',
field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='Home page detail'),
),
]

Wyświetl plik

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-10 15:56
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='blogpage',
name='subtitle',
field=models.CharField(blank=True, max_length=255),
),
migrations.AlterField(
model_name='blogpage',
name='body',
field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='Blog post'),
),
]

Wyświetl plik

@ -46,6 +46,7 @@ class BlogPage(Page):
"""
A Blog Page (Post)
"""
subtitle = models.CharField(blank=True, max_length=255)
image = models.ForeignKey(
'wagtailimages.Image',
null=True,
@ -64,6 +65,7 @@ class BlogPage(Page):
)
content_panels = Page.content_panels + [
FieldPanel('subtitle'),
ImageChooserPanel('image'),
StreamFieldPanel('body'),
FieldPanel('date_published'),

Wyświetl plik

@ -1,6 +1,5 @@
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
from .wsgi import application as _application
application = DjangoWhiteNoise(_application)
application = get_wsgi_application()
application = DjangoWhiteNoise(application)

Wyświetl plik

@ -15,8 +15,13 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# BASE_URL required for notification emails
BASE_URL = 'http://localhost:8000'
DATABASES = {'default': dj_database_url.config(default='postgres://postgres@localhost:5432/wagtaildemo')}
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
try:
from .local import *

Wyświetl plik

@ -0,0 +1,5 @@
.hero{
height: 600px;
background-size: cover;
background-position: center;
}

Wyświetl plik

@ -32,6 +32,8 @@
<!-- Theme CSS -->
{# <link href="css/clean-blog.min.css" rel="stylesheet">#}
<link rel="stylesheet" type="text/css" href="{% static 'css/main.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/main2.css' %}">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
@ -90,15 +92,8 @@
{% endblock %}
<content>
<div class="container">
<div class="row">
<div class="col-lg-2"></div>
<div class="col-lg-7">
{% block content %}
{% endblock %}
</div>
</div>
</div>
{% block content %}
{% endblock %}
</content>
<hr>

Wyświetl plik

@ -0,0 +1 @@
intro_block.html

Wyświetl plik

@ -2,20 +2,18 @@
{% load wagtailimages_tags %}
{% block content %}
<h1>{{ page.title }}</h1>
<figure>
{% image self.image fill-600x600 %}
</figure>
{% for tag in page.get_tags %}
<a href="{{ tag.url }}">{{ tag }}</a>
{% endfor %}
<date>{{ page.date_published }}</date>
{% for author in page.authors %}
<li>{{ author }}</li>
{% endfor %}
{{ page.body }}
{% image self.image fill-1920x600 as hero_img %}
<div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
<div class="container">
<h1>{{ page.title }}</h1>
<h2>{{ page.subtitle }}</h2>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-7 col-md-offset-2">
{{ page.body }}
</div>
</div>
</div>
{% endblock content %}

Wyświetl plik

@ -5,6 +5,7 @@ wagtailfontawesome
Pillow
# Dependencies for Heroku deployment
dj-database-url==0.3.0
whitenoise>=3.1,<4.0
uwsgi>=2.0,<2.1
dj-database-url==0.4.1
whitenoise==3.2.2
gunicorn==19.6.0
psycopg2==2.6.2