Skip to content
Snippets Groups Projects
Commit f5392cf1 authored by Emmanuel Godard's avatar Emmanuel Godard
Browse files

meilleure gestion des dates

parent 744191d6
Branches
No related tags found
No related merge requests found
......@@ -15,14 +15,16 @@
<article>
<h1>{{ article.title }}</h1>
{% if article.author %}
<h2>{{ article.author }}</h2>
<h2>{{ article.author }} ({% if article.institution %}{{ article.institution }}{% else %}{{ DEFAULT_INSTITUTION }}{% endif %})</h2>
{% endif %}
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
<aside>
<ul>
<li>
<time datetime="{{ article.date }}">{{ article.date|strftime('%b %d, %Y') }}</time>
<time datetime="{{ article.date }}">{{ article.date|strftime('%b %d, %Y') }},
{% if article.time %}{{ article.time }}{% else %}{{ DEFAULT_TIME }}{% endif %}</time>
{% if article.location %}{{ article.location }}{% else %}{{ DEFAULT_LOCATION }}{% endif %}
</li>
{% if article.modified %}
<li>
......
......@@ -7,27 +7,19 @@
<section id="list">
<h2>{{ category }}</h2>
<ul>
{% set new = namespace(p=0) %}
{% set current = 0 %}
{% for article in articles_page.object_list %}
{% set period = article.date | strftime('%Y') %}
{% if period != new.p %}
{% if period != current %}
<h3>{{ period }}</h3>
<li>
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}
{% if article.author %}
-- {{ article.author }}
{% set current = period %}
{% endif %}
</a>
<time>{{ article.date|strftime('%b %Y') }}</time>
</li>
{% set new.p = article.date | strftime('%Y') %}
{% elif period == new.p %}
<li>
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
<time>{{ article.date|strftime('%b %Y') }}</time>
<time>{{ article.date|strftime('%d %b %Y') }}</time><span>&nbsp;&nbsp;</span>
<a href="{{ SITEURL }}/{{ article.url }}"><strong>{{ article.title }}</strong>
{{ article.author }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</section>
......
......@@ -6,19 +6,16 @@
<ul>
{% for article in articles_page.object_list %}
<li>
{% if article.date.isocalendar() >= article.date.today().isocalendar() %}
<h1><time datetime="{{ article.date }}">{{ article.date|strftime('%b %d, %Y') }}</time></h1>
<h2><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
{% if article.author %}
<h3>{{ article.author }}</h3>
{% if NOT_FUTURE_ONLY or article.date.isocalendar() >= article.date.today().isocalendar() %}
<h2>
<time datetime="{{ article.date }}">{{ article.date|strftime('%d %b %Y') }}</time>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
</h2>
<h3>{{ article.author }} ({% if article.institution %}{{ article.institution }}{% else %}{{ DEFAULT_INSTITUTION }}{% endif %})
</h3>
{% endif %}
<p>
{{ article.summary }}
<a href="{{ SITEURL }}/{{ article.url }}"><em>Read more...</em></a>
</p>
</li>
{% endif %}
{% endfor %}
</ul>
{% if articles_page.has_other_pages() %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment