Changed the way active shows are elected on the company page.

This commit is contained in:
David Soulayrol 2020-08-22 09:47:45 +02:00
commit a2635996e1
3 changed files with 8 additions and 3 deletions

View file

@ -85,14 +85,18 @@
{% macro iterate_shows(collections, category, config) %}
{% set shows = collections[category] %}
{% for show in shows %}
{% if config != null and config.before %}
{% if config.before %}
{% if moment(show.lastDate).isBefore(config.before) %}
{{ config.render(show, config) }}
{% endif %}
{% elif config != null and config.after %}
{% elif config.after %}
{% if moment(show.lastDate).isAfter(config.after) %}
{{ config.render(show, config) }}
{% endif %}
{% elif config.ongoing != undefined %}
{% if show.ongoing %}
{{ config.render(show, config) }}
{% endif %}
{% else %}
{{ config.render(show, config) }}
{% endif %}

View file

@ -30,7 +30,7 @@
</div>
<div>
{{ macros.iterate_shows(collections, "troupe_shows", {
'no_display_date': true, 'after': date, 'render': macros.expose_show })
'no_display_date': true, 'ongoing': true, 'render': macros.expose_show })
}}
</div>
</div>

View file

@ -179,6 +179,7 @@ function plugin () {
author: get('author'),
creation: data.creation,
company: data.company,
ongoing: data.ongoing || false,
layout: data.layout || 'show.njk',
poster: get('poster') || path.basename(filename, 'md') + 'jpg',
lastDate: lastDate,