Merge pull request #125 from wagtail/88_pep8

PEP-8 and template cleanup
pull/127/head^2
Edd Baldry 2017-03-30 08:49:18 +01:00 zatwierdzone przez GitHub
commit 9cd39c3d83
8 zmienionych plików z 114 dodań i 128 usunięć

Wyświetl plik

@ -8,7 +8,6 @@ from modelcluster.fields import ParentalKey
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, StreamFieldPanel
from wagtail.wagtailcore.models import Orderable, Page
from wagtail.wagtailsearch import index
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel

Wyświetl plik

@ -118,11 +118,3 @@
</div>
</div>
{% endblock content %}
HERO
----
promo | bread
-----
Blog x3
-----
Location x 6

Wyświetl plik

@ -1,7 +1,5 @@
{% load wagtailimages_tags %}
<blockquote><p class="text">{{ self.text }}</p>
<footer><p class="attribute_name">{{ self.attribute_name}}</p></footer>
</blockquote>

Wyświetl plik

@ -1,3 +1,8 @@
{% comment %}
Content is coming from the StandardBlock StreamField
class within `blocks.py`
{% endcomment %}
{% if self.size == 'h2' %}
<h2>{{ self.heading_text }}</h2>
@ -8,8 +13,3 @@
<h4>{{ self.heading_text }}</h4>
{% endif %}
{% comment %}
Content is coming from the StandardBlock StreamField
class within `blocks.py`
{% endcomment %}

Wyświetl plik

@ -3,41 +3,42 @@
{% block content %}
{% image self.image fill-1920x600 as hero_img %}
{% include "base/include/header-hero.html" %}
{% image self.image fill-1920x600 as hero_img %}
{% include "base/include/header-hero.html" %}
<div class="container">
<div class="row">
<div class="col-md-8">
{% if page.introduction %}
<p class="intro">{{ page.introduction }}</p>
{% endif %}
<div class="blog-meta">
{% if page.authors %}
<div class="blog-avatars">
{% for author in page.authors %}
<div class="author">{% image author.image fill-50x50-c100 class="blog-avatar" %} {{ author.first_name }} {{ author.last_name }}</div>
{% endfor %}
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
{% if page.introduction %}
<p class="intro">{{ page.introduction }}</p>
{% endif %}
{% if page.date_published %}
<div class="blog-byline">
{{ page.date_published }}
</div>
<div class="blog-meta">
{% if page.authors %}
<div class="blog-avatars">
{% for author in page.authors %}
<div class="author">{% image author.image fill-50x50-c100 class="blog-avatar" %}
{{ author.first_name }} {{ author.last_name }}</div>
{% endfor %}
</div>
{% endif %}
{% if page.date_published %}
<div class="blog-byline">
{{ page.date_published }}
</div>
{% endif %}
</div>
{{ page.body }}
{% if page.get_tags %}
Tagged with:<br />
{% for tag in page.get_tags %}
<a href="{{ tag.url }}" class="btn btn-sm">{{ tag }}</a>
{% endfor %}
{% endif %}
</div>
{{ page.body }}
{% if page.get_tags %}
Tagged with:<br />
{% for tag in page.get_tags %}
<a href="{{ tag.url }}" class="btn btn-sm">{{ tag }}</a>
{% endfor %}
{% endif %}
</div>
</div>
</div>
{% endblock content %}

Wyświetl plik

@ -2,66 +2,63 @@
{% load wagtailimages_tags %}
{% block content %}
<div class="container bread-detail">
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<div class="row">
<h1>{{ page.title }}</h1>
<figure class="hidden-md-up">
{% image page.image width-500 %}
</figure>
{% if page.introduction %}
<p class="introduction">
{{ page.introduction }}
</p>
{% endif %}
<div class="container bread-detail">
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<div class="row">
<h1>{{ page.title }}</h1>
{{ page.body }}
<figure class="hidden-md-up">
{% image page.image width-500 %}
</figure>
{% if page.introduction %}
<p class="introduction">
{{ page.introduction }}
</p>
{% endif %}
{{ page.body }}
</div>
</div>
</div>
<div class="col-md-5 col-md-offset-1">
<div class="row">
<figure class="hidden-md-down">
{% image page.image width-500 %}
</figure>
<ul class="bread-meta">
{% if page.origin %}
<li>
<h4>Origin</h4>
<p>{{ page.origin }}</p>
</li>
{% endif %}
{% if page.bread_type %}
<li>
<h4>Type</h4>
<p>{{ page.bread_type }}</p>
</li>
{% endif %}
{% with ingredients=page.ingredients.all %}
{% if ingredients %}
<div class="col-md-5 col-md-offset-1">
<div class="row">
<figure class="hidden-md-down">
{% image page.image width-500 %}
</figure>
<ul class="bread-meta">
{% if page.origin %}
<li>
<h4>Ingredients</h4>
<ul>
{% for ingredient in ingredients %}
<li>
{{ ingredient.name }}
</li>
{% endfor %}
</ul>
<h4>Origin</h4>
<p>{{ page.origin }}</p>
</li>
{% endif %}
{% endwith %}
</ul>
{% if page.bread_type %}
<li>
<h4>Type</h4>
<p>{{ page.bread_type }}</p>
</li>
{% endif %}
{% with ingredients=page.ingredients.all %}
{% if ingredients %}
<li>
<h4>Ingredients</h4>
<ul>
{% for ingredient in ingredients %}
<li>
{{ ingredient.name }}
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endwith %}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}

Wyświetl plik

@ -2,27 +2,27 @@
{% load wagtailcore_tags navigation_tags wagtailimages_tags %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>{{ page.title }}</h1>
<p>{{ page.introduction}}</p>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>{{ page.title }}</h1>
<p>{{ page.introduction}}</p>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row bread-list">
{% for bread in breads %}
<div class="container">
<div class="row bread-list">
{% for bread in breads %}
<div class="col-xs-12 col-md-6 bread-list-item">
<div class="row">
<div class="col-xs-4 col-sm-4 image">
<a href="{% pageurl bread %}">
{% image bread.image fill-180x180-c100 as image %}
<img src="{{ image.url }}" width="{{ image.width }}" height="{{ image.height }}" alt="{{ image.alt }}" class="" />
</div>
</a>
<a href="{% pageurl bread %}">
{% image bread.image fill-180x180-c100 as image %}
<img src="{{ image.url }}" width="{{ image.width }}"
height="{{ image.height }}" alt="{{ image.alt }}" class="" />
</a>
</div>
<div class="col-xs-6 col-sm-7">
<a href="{% pageurl bread %}">
<h2>{{ bread.title }}</h2>
@ -32,25 +32,23 @@
<li><span>Origin</span> {{ bread.origin }}</li>
{% endif %}
{% if bread.bread_type %}
<li><span>Type</span> {{ bread.bread_type }}</li>
<li><span>Type</span> {{ bread.bread_type }}</li>
{% endif %}
</ul>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
</div>
{% if breads.paginator.count > 1 %}
<div class="container">
<div class="row">
<div class="col-md-12">
{% include "includes/pagination.html" with subpages=breads %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if breads.paginator.count > 1 %}
<div class="container">
<div class="row">
<div class="col-md-12">
{% include "includes/pagination.html" with subpages=breads %}
</div>
</div>
</div>
{% endif %}
{% endblock content %}

Wyświetl plik

@ -1,4 +1,5 @@
{% load navigation_tags %}
<div class="header clearfix" role="banner">
<div class="container">
<div class="row">