Skip to content

Commit

Permalink
Merge master with about page style. Workson wagtail-nest#15
Browse files Browse the repository at this point in the history
  • Loading branch information
hminnovation committed Feb 28, 2017
2 parents 2dda668 + bf83e01 commit 1696ac1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 33 deletions.
26 changes: 26 additions & 0 deletions bakerydemo/base/migrations/0013_auto_20170228_0714.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-28 07:14
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('base', '0012_auto_20170222_0756'),
]

operations = [
migrations.RemoveField(
model_name='aboutlocationrelationship',
name='locations',
),
migrations.RemoveField(
model_name='aboutlocationrelationship',
name='page',
),
migrations.DeleteModel(
name='AboutLocationRelationship',
),
]
22 changes: 0 additions & 22 deletions bakerydemo/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,6 @@ class Meta:
verbose_name_plural = 'Footer Text'


class AboutLocationRelationship(Orderable, models.Model):
"""
This defines the relationship between the `LocationPage` within the `locations`
app and the About page below allowing us to add locations to the about
section.
"""
page = ParentalKey(
'AboutPage', related_name='location_about_relationship'
)
locations = models.ForeignKey(
'locations.LocationPage', related_name='about_location_relationship'
)
panels = [
PageChooserPanel('locations')
]


class AboutPage(Page):
"""
The About Page
Expand All @@ -150,11 +133,6 @@ class AboutPage(Page):
content_panels = Page.content_panels + [
ImageChooserPanel('image'),
StreamFieldPanel('body'),
InlinePanel(
'location_about_relationship',
label='Locations',
min_num=None
),
]

# parent_page_types = [
Expand Down
14 changes: 14 additions & 0 deletions bakerydemo/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,20 @@ span.outline {
margin-bottom: 30px;
}

/* Generic title image header include */
.base-header img {
height: auto;
margin-top: 20px;
max-width: 100%;
width: auto;
}

@media (max-width: 970px) {
.base-header img {
width: 100%;
}
}

/* No gutters */
.row.no-gutters {
margin-right: 0;
Expand Down
8 changes: 7 additions & 1 deletion bakerydemo/templates/base/about_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
{% block content %}
{% include "base/include/header.html" %}

{{ page.body }}
<div class="container">
<div class="row">
<div class="col-md-7">
{{ page.body }}
</div>
</div>
</div>
{% endblock content %}
20 changes: 10 additions & 10 deletions bakerydemo/templates/base/include/header.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load wagtailcore_tags wagtailimages_tags %}

<div class="container">

<div class="image">
{% image page.image width-500 as photo %}
<img src="{{ photo.url }}" width="{{ photo.width }}" height="{{ photo.height }}" alt="{{ photo.alt }}" />
</div>

<div class="row">
<div class="col-md-7 col-md-offset-2">
<h2>{{ page.title }}</h2>
<div class="col-md-7 base-header">
{% if page.image %}
<div class="image">
{% image page.image width-500 as photo %}
<img src="{{ photo.url }}" width="{{ photo.width }}" height="{{ photo.height }}" alt="{{ photo.alt }}" />
</div>
{% endif %}

<h1>{{ page.title }}</h1>
</div>
</div>
</div>

0 comments on commit 1696ac1

Please sign in to comment.