sections rendering + make view for existing section's items

This commit is contained in:
bkfox
2016-07-24 19:49:15 +02:00
parent 5ab731e866
commit 90021bc9f0
13 changed files with 395 additions and 94 deletions

View File

@ -26,7 +26,7 @@
{% if day == nav_dates.date %}class="today"{% endif %}>
{# you might like to hide it by default -- this more for sections #}
<h2>{{ day|date:'l d F' }}</h2>
{% with object_list=list list_date_format="H:i" %}
{% with object_list=list item_date_format="H:i" %}
{% for item in list %}
{% include "cms/snippets/list_item.html" %}
{% endfor %}

View File

@ -4,14 +4,19 @@ ListItem instance.
Options:
* item: item to render. Fields: title, summary, cover, url, date, info, css_class
* list_date_format: format passed to the date filter instead of default one
* item_date_format: format passed to the date filter instead of default one
* item_big_cover: cover should is big instead of thumbnail (width: 600)
{% endcomment %}
{% load wagtailimages_tags %}
<a {% if item.url %}href="{{ item.url }}" {% endif %}
class="item page_item{% if item.css_class %}{{ item.css_class }}{% endif %}">
{% image item.cover fill-64x64 class="cover item_cover" %}
{% if item_big_cover %}
{% image item.cover max-600 class="cover item_cover" %}
{% else %}
{% image item.cover fill-64x64 class="cover item_cover" %}
{% endif %}
<h3>{{ item.title }}</h3>
{% if item.summary %}<div class="summary">{{ item.summary }}</div>{% endif %}
{% if not item.show_in_menus and item.date %}