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

meilleure gestion des dates

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