Skip to content

Commit c0725f8

Browse files
committed
Revert "Add content streamfield and blocks (#8)"
This reverts commit b2c5b5c. Never use squash merge, what a mess.
1 parent 453af14 commit c0725f8

File tree

14 files changed

+43
-108
lines changed

14 files changed

+43
-108
lines changed

app/alloydflanagan/home/blocks/__init__.py

Whitespace-only changes.

app/alloydflanagan/home/blocks/header.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/alloydflanagan/home/blocks/menu_link.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/alloydflanagan/home/migrations/0005_homepage_content.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/alloydflanagan/home/models.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
from django.db.models import FileField
22

33
from wagtail.admin.panels import FieldPanel
4-
from wagtail.blocks import RichTextBlock
5-
from wagtail.images.blocks import ImageChooserBlock
64
from wagtail.models import Page
7-
from wagtail.fields import RichTextField, StreamField
8-
9-
from alloydflanagan.home.blocks.header import HeaderBlock
10-
5+
from wagtail.fields import RichTextField
116

127
class HomePage(Page):
138
intro = RichTextField()
149
# may move resume to AboutPage model if/when we have one
1510
resume = FileField(blank=True)
16-
content = StreamField([
17-
('text', RichTextBlock()), #probably will use custom type later
18-
('image', ImageChooserBlock()),
19-
('header', HeaderBlock()),
20-
], use_json_field=True, blank=True)
2111

2212
content_panels = Page.content_panels + [
2313
FieldPanel("intro", classname="full"),
2414
FieldPanel("resume", classname="full"),
25-
FieldPanel("content", classname="full"),
2615
]

app/alloydflanagan/home/templates/home/blocks/header.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/alloydflanagan/home/templates/home/blocks/menu_link.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/alloydflanagan/home/templates/home/home_page.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
{% block body_class %}template-homepage{% endblock %}
55

6-
{% block content %}
7-
<!-- home_page.html -->
6+
{% block extra_css %}
7+
{% endblock extra_css %}
8+
9+
{% block header %}
10+
{% include 'components/header.html' %}
11+
{% endblock header %}
812

9-
{# include_block page.content #}
10-
<article>
11-
<header>
12-
{{ page.header }}
13-
</header>
14-
<section id="intro">
13+
{% block content %}
14+
<div class="home-intro">
1515
{{ page.intro|richtext }}
16-
</section>
17-
<main id="content">
18-
{{ page.content }}
19-
</main>
20-
</article>
16+
</div>
2117
{% endblock content %}
18+
19+
{% block footer %}
20+
{% include 'components/footer.html' %}
21+
{% endblock footer %}

app/alloydflanagan/settings/base.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@
4949
]
5050

5151
MIDDLEWARE = [
52-
"django.middleware.security.SecurityMiddleware",
53-
"whitenoise.middleware.WhiteNoiseMiddleware",
5452
"django.contrib.sessions.middleware.SessionMiddleware",
5553
"django.middleware.common.CommonMiddleware",
5654
"django.middleware.csrf.CsrfViewMiddleware",
5755
"django.contrib.auth.middleware.AuthenticationMiddleware",
5856
"django.contrib.messages.middleware.MessageMiddleware",
5957
"django.middleware.clickjacking.XFrameOptionsMiddleware",
58+
"django.middleware.security.SecurityMiddleware",
6059
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
6160
]
6261

@@ -133,19 +132,12 @@
133132
# ManifestStaticFilesStorage is recommended in production, to prevent outdated
134133
# JavaScript / CSS assets being served from cache (e.g. after a Wagtail upgrade).
135134
# See https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#manifeststaticfilesstorage
136-
# STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
135+
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
137136
# this should contain any static files that aren't specific to an app
138137
STATICFILES_DIRS = [os.path.join(PROJECT_DIR, "static")]
139138
STATIC_ROOT = os.path.join(BASE_DIR, "static")
140139
STATIC_URL = "/static/"
141-
STORAGES = {
142-
"staticfiles": {
143-
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
144-
},
145-
"default": {
146-
"BACKEND": "django.core.files.storage.FileSystemStorage",
147-
},
148-
}
140+
149141
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
150142
MEDIA_URL = "/media/"
151143

app/alloydflanagan/templates/base.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@
4040

4141
<div id="app">
4242
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
43+
{% block header %}
44+
{% endblock header %}
4345
{% block content %}
4446
{% endblock content %}
47+
{% block footer %}
48+
{% endblock footer %}
4549
</div>
4650
</div>
4751

4852
{# Global javascript #}
49-
{# <script type="text/javascript" src="{% static 'main.js' %}"></script> #}
53+
<script type="text/javascript" src="{% static 'main.js' %}"></script>
5054

5155
{% block extra_js %}
5256

0 commit comments

Comments
 (0)