Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed AllPublishedPagesView return specific pages to fix correct temp…
…late name Fixed get method in WagtailBakeryView to serve wagtail compatible response Update example site with fixtures, templates, custom pages and styling
- Loading branch information
1 parent
71c9ff5
commit e4c3ff3
Showing
18 changed files
with
399 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.3 on 2016-11-22 14:31 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.wagtailcore.blocks | ||
import wagtail.wagtailcore.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('wagtailcore', '0030_index_on_pagerevision_created_at'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='BlogListPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), | ||
('body', wagtail.wagtailcore.fields.StreamField([(b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock())])), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
migrations.CreateModel( | ||
name='BlogPostPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), | ||
('body', wagtail.wagtailcore.fields.StreamField([(b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock())])), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
migrations.CreateModel( | ||
name='GenericPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), | ||
('body', wagtail.wagtailcore.fields.StreamField([(b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock())])), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
migrations.CreateModel( | ||
name='HomePage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), | ||
('body', wagtail.wagtailcore.fields.StreamField([(b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock())])), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from wagtail.wagtailcore import blocks | ||
from wagtail.wagtailcore.fields import StreamField | ||
from wagtail.wagtailcore.models import Page | ||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel | ||
|
||
|
||
class AbstractExamplePage(Page): | ||
body = StreamField([ | ||
('paragraph', blocks.RichTextBlock()) | ||
]) | ||
|
||
content_panels = [ | ||
FieldPanel('title'), | ||
StreamFieldPanel('body') | ||
] | ||
|
||
class Meta: | ||
abstract = True | ||
|
||
class HomePage(AbstractExamplePage): | ||
pass | ||
|
||
|
||
class GenericPage(AbstractExamplePage): | ||
pass | ||
|
||
|
||
class BlogListPage(AbstractExamplePage): | ||
pass | ||
|
||
|
||
class BlogPostPage(AbstractExamplePage): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
body { | ||
background-color: #333333; | ||
color: #ffffff; | ||
margin: 0; | ||
padding: 100px; | ||
} | ||
|
||
ul.navigation { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
ul.navigation > li { | ||
display: inline-block; | ||
} | ||
|
||
ul.navigation > li > a { | ||
border: 1px solid #ff574a; | ||
border-radius: 4px; | ||
padding: 5px 10px; | ||
} | ||
|
||
h1 { | ||
color: #43b1b0; | ||
} | ||
|
||
a,a:active,a:link,a:visited { | ||
color: #ff574a; | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% load static %} | ||
|
||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="{% static "example/css/main.css" %}"> | ||
<title>{{ self.title }}</title> | ||
</head> | ||
<body> | ||
{% block navigation %} | ||
<ul class="navigation"> | ||
{% for item in page.get_site.root_page.get_children %} | ||
<li> | ||
<a href="{{ item.url }}">{{ item.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock %} | ||
{% block title %} | ||
<h1>{{ self.title }}</h1> | ||
{% endblock %} | ||
{% block content %}{% endblock %} | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
examples/site/example/templates/example/blog_list_page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
{{ self.body }} | ||
<ul> | ||
{% for item in page.get_children %} | ||
<li> | ||
<a href="{{ item.url }}">{{ item.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
{{ self.body }} | ||
<p> | ||
<a href="{{ page.get_parent.url }}">Go back to blog overview</a> | ||
</p> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
{{ self.body }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
{{ self.body }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.