Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix 28/blog layout #89

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/static/css/littleweaverweb.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@import modules/base

// Alphabetical order, unless otherwise necessary:
@import modules/blog
@import modules/browser
@import modules/buttons
@import modules/grid
Expand Down
6 changes: 0 additions & 6 deletions core/static/css/modules/_blog.sass

This file was deleted.

6 changes: 6 additions & 0 deletions core/static/css/modules/_margins.sass
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@
.m-b-2-xs-down
+media-breakpoint-only(xs)
margin-bottom: 2*$spacer-y

.m-t-1-tiny
margin-top: .2rem

.m-b-1-tiny
margin-bottom: .2rem
30 changes: 26 additions & 4 deletions core/templates/core/_blog_summary.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
{% load wagtailcore_tags wagtailimages_tags %}

<article class="m-b-3 {{ extra_classes }}">
{# {% if entry.teaser_image %}#}
{# {% image entry.teaser_image fill-500x250 class="img-fluid m-b-2" %}#}
{# {% endif %}#}
{% include "core/_blog_summary_text.html" %}
{% if entry.teaser_image %}
<a href="{{ entry.url }}">
{% image entry.teaser_image max-500x500 class="img-fluid m-b-1" %}
</a>
{% endif %}
<header class="blog-post-header m-b-0">
<h2 class="blog-post-title card-title">
<a href="{{ entry.url }}" class="color-black-almost">{{ entry.title }}</a>
</h2>
<div class="blog-post-byline-dateline m-b-1-tiny">
{% if entry.author %}
<span class="color-black-almost">
{{ entry.author.name }}
</span>
{% endif %}
<span class="dateline">
<time datetime="{{ entry.publication_date|date:"c" }}">{{ entry.publication_date|date:"N j, Y" }}</time>
</span>
</div>
</header>
<div class="entry-summary">
{{ entry.summary }}
</div>
<footer>
<a href="{{ entry.url }}" class="btn btn-sm btn-secondary m-t-1">Read <i class="fa fa-fw fa-chevron-right"></i></a>
</footer>
</article>
16 changes: 0 additions & 16 deletions core/templates/core/_blog_summary_first.html

This file was deleted.

23 changes: 0 additions & 23 deletions core/templates/core/_blog_summary_text.html

This file was deleted.

20 changes: 8 additions & 12 deletions core/templates/core/blog_index_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ <h1 class="color-white">{{ page.title }}</h1>
</div>
{% endif %}

<div class="container">
{% include "core/_blog_summary_first.html" with extra_classes="blog-post--large m-t-3" entry=blog_entries.0 %}
<div class="row">
{% for entry in blog_entries|slice:"1:" %}
<div class="col-md-6 col-lg-4">
<div class="container m-y-3">
<div class="grid row" data-isotope='{ "itemSelector": ".grid-item", "layoutMode": "masonry" }'>
{% for entry in blog_entries %}
<div class="grid-item col-md-6 col-lg-4">
{% include "core/_blog_summary.html" with extra_classes="blog-post" %}
</div>
{# The following divs break up the grid rows at the right locations depending on screen size: #}
{% if forloop.counter|divisibleby:"3" %}
<div class="clearfix hidden-md-down"></div>
{% endif %}
{% if forloop.counter|divisibleby:"2" %}
<div class="clearfix hidden-lg-up"></div>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}

{% block extra_js %}
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
{% endblock %}