{% extends "core/base.jinja" %} {% from 'core/macros.jinja' import tweet_quick, fb_quick %} {% block title %} {% trans %}News{% endtrans %} {% endblock %} {% block content %}
{% if user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) %}
{% trans %}Administrate news{% endtrans %}
{% endif %}
{% trans %}Agenda{% endtrans %}
{% for d in NewsDate.objects.filter(end_date__gte=timezone.now(), news__is_moderated=True, news__type__in=["WEEKLY", "EVENT"]).order_by('start_date', 'end_date') %}
{{ d.start_date|localtime|date('D d M Y') }}
{{ d.start_date|localtime|time(DATETIME_FORMAT) }} - {{ d.end_date|localtime|time(DATETIME_FORMAT) }}
{{ d.news.summary|markdown }}
{% endfor %}
{% trans %}Birthdays{% endtrans %}
    {% for d in birthdays.dates('date_of_birth', 'year', 'DESC') %}
  • {% trans age=timezone.now().year - d.year %}{{ age }} year old{% endtrans %}
  • {% endfor %}
{% for news in object_list.filter(type="NOTICE") %}

{{ news.title }}

{{ news.summary|markdown }}
{% endfor %} {% for news in object_list.filter(dates__start_date__lte=timezone.now(), dates__end_date__gte=timezone.now(), type="CALL") %}

{{ news.title }}

{{ news.dates.first().start_date|localtime|date(DATETIME_FORMAT) }} {{ news.dates.first().start_date|localtime|time(DATETIME_FORMAT) }} - {{ news.dates.first().end_date|localtime|date(DATETIME_FORMAT) }} {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }}
{{ news.summary|markdown }}
{% endfor %} {% set events_dates = NewsDate.objects.filter(end_date__gte=timezone.now(), start_date__lte=timezone.now()+timedelta(days=5), news__type="EVENT", news__is_moderated=True).datetimes('start_date', 'day') %}

{% trans %}Events today and the next few days{% endtrans %}

{% if events_dates %} {% for d in events_dates %}
{{ d|localtime|date('D') }}
{{ d|localtime|date('d') }}
{{ d|localtime|date('b') }}
{% for news in object_list.filter(dates__start_date__gte=d, dates__start_date__lte=d+timedelta(days=1), type="EVENT").exclude(dates__end_date__lt=timezone.now()) .order_by('dates__start_date') %}

{{ news.title }}

{{ news.dates.first().start_date|localtime|time(DATETIME_FORMAT) }} - {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }}
{{ news.summary|markdown }}
{{ fb_quick(news) }} {{ tweet_quick(news) }}
{% endfor %}
{% endfor %} {% else %}
{% trans %}Nothing to come...{% endtrans %}
{% endif %} {% set coming_soon = object_list.filter(dates__start_date__gte=timezone.now()+timedelta(days=5), type="EVENT").order_by('dates__start_date') %} {% if coming_soon %}

{% trans %}Coming soon... don't miss!{% endtrans %}

{% for news in coming_soon %}
{{ news.title }} {{ news.dates.first().start_date|localtime|date(DATETIME_FORMAT) }} {{ news.dates.first().start_date|localtime|time(DATETIME_FORMAT) }} - {{ news.dates.first().end_date|localtime|date(DATETIME_FORMAT) }} {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }}
{% endfor %} {% endif %}
{% endblock %}