{% extends "index.html" %}
{% block banner %}
	{% if category == 'curriculum' %}
	    <header id="banner">
	    {% for p in pages %}
	        {% if p.title == 'curriculum' %}
	            <div id="title">
	                {{ p.content }}
	            </div>      
	        {% endif %}
	    {% endfor %}
	    </header>
	{% else %}
		{{ super() }}
	{% endif %}
{% endblock %}

{% block content %}
{% set glob={} %}
	{% if DEFAULT_LANG == 'nl' %}
	    {% set _ = glob.update({'published_at': 'Gepubliceerd op '}) %}
	    {% set _ = glob.update({'related_to': ' Gerelateerd aan '}) %}
	    {% set _ = glob.update({'written_by': 'Geschreven door '}) %}
	    {% set _ = glob.update({'read_more': 'lees meer '}) %}
	    {% set _ = glob.update({'upcoming': 'Aankomende workshops '}) %}
	    {% set _ = glob.update({'past': 'Eerdere workshops '}) %}
	{% endif %}
	{% if DEFAULT_LANG == 'en' %}
	    {% set _ = glob.update({'published_at': 'Published at '}) %}
	    {% set _ = glob.update({'related_to': ' Relating to '}) %}
	    {% set _ = glob.update({'written_by': 'Written by '}) %}
	    {% set _ = glob.update({'read_more': 'read more'}) %}
	    {% set _ = glob.update({'upcoming': 'Upcoming workshops '}) %}
	    {% set _ = glob.update({'past': 'Past workshops '}) %}
	{% endif %}
	{% if category == 'curriculum' %}
 		<div id="post-list">
 		<h2>{{glob.upcoming}}</h2>
 		<hr>
		{% for article in articles_page.object_list %}
		    {% set thumb_size = '/thumb' %}      
	        {% if article.event_start %}
	            {% set event_status = '' %}
	            {% if article.event_start < article.date.now() %}
	                {% set event_status = ' past' %}
	            {% endif %}
	            {% if article.event_start >= article.date.now() %}
	                {% set event_status = ' current' %}
	                {% set thumb_size = '/thumb2x' %}
	            {% endif %}    
	        {% endif %}
	        {% if event_status == ' current' %}
    		<article class="hentry {{article.category}} current">
        	<div class="article-info">
            <span class="entry-title"><a href="/{% if article.lang == 'en' %}en/{% endif %}{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></span>
            <div class="event-details">
                {{ article.event_start  | strftime('%d %B %Y') }}
            </div>
            <div class="featured-image current">
                    <a href="/{% if article.lang == 'en' %}en/{% endif %}{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
                        {% if article.featured_image.endswith('.gif') %}
                            {% set thumb_size =''%}
                        {% endif %}
                        <img src="{{ article.featured_image | replace('images','images'+thumb_size) }}">
                    </a>
            </div>
       		</div>
   
	        <div class="summary {{ article.category }}">{{ article.summary }}
	            <span class="read_more">
	                {% if DEFAULT_LANG == 'en' %}
	                    <a href="/en/{{ article.url }}">{{ glob.read_more }}</a>
	                {% elif DEFAULT_LANG == 'nl' %}
	                    <a href="/{{ article.url }}">{{ glob.read_more }}</a>
	                {% endif %}
	            </span>
	        </div>
	        <div class="separator"><hr></div>
	        <div class="post-info">
	            {% if article.tags %}
	                <span class="tags">
	                    {{ glob.related_to }}
	                    {% for tag in article.tags %}
	                    <span itemprop="keywords">
	                        <a href="/{{ tag.url }}" rel="tag">{{ tag }}</a>
	                    </span> {% endfor %}
	                </span>
	            {% endif %}
	        {% endif %}
	        </div>
    		</article>
		{% endfor %}
		</div>
 		<h2>{{glob.past}}</h2>
 		<hr>
		{% for article in articles_page.object_list %}
		    {% set thumb_size = '/thumb' %}      
	        {% if article.event_start %}
	            {% set event_status = '' %}
	            {% if article.event_start < article.date.now() %}
	                {% set event_status = ' past' %}
	            {% endif %}
	            {% if article.event_start >= article.date.now() %}
	                {% set event_status = ' current' %}
	                {% set thumb_size = '/thumb2x' %}
	            {% endif %}    
	        {% endif %}
	        {% if event_status == ' past' %}
	        <article class="hentry curriculum past">
        		<div class="article-info">
            		<span class="entry-title"><a href="/{% if article.lang == 'en' %}en/{% endif %}{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></span>
            		<div class="event-details">
                		{{ article.event_start  | strftime('%d %B %Y') }}
            		</div>
            		<div class="featured-image current">
                    		<a href="/{% if article.lang == 'en' %}en/{% endif %}{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
                       		 {% if article.featured_image.endswith('.gif') %}{% set thumb_size =''%}{% endif %}
                        <img src="{{ article.featured_image | replace('images','images'+thumb_size) }}">
                    </a>
            		</div>
       			</div>
       			<div class="summary {{ article.category }}">{{ article.summary }}
	            	<span class="read_more">
	                	{% if DEFAULT_LANG == 'en' %}<a href="/en/{{ article.url }}">{{ glob.read_more }}</a>
	                	{% elif DEFAULT_LANG == 'nl' %}<a href="/{{ article.url }}">{{ glob.read_more }}</a>{% endif %}</span>
	            </div>
	        	<div class="separator"><hr></div>
       		{% endif %}
    		</article>
       		{% endfor %}

	{% else %}
		{{ super() }}
	{% endif %}
{% endblock %}


{% block content_title %}
<h1>Category: {{ category }}</h1>
<hr>
{% endblock %}