{% extends "core/base.jinja" %} {% from 'core/macros.jinja' import tweet_quick, fb_quick %} {% block title %} {% trans %}News{% endtrans %} {% endblock %} {% block additional_css %} {# Atom feed discovery, not really css but also goes there #} {% endblock %} {% block additional_js %} {% endblock %} {% block content %}
{% set events_dates = NewsDate.objects.filter(end_date__gte=timezone.now(), start_date__lte=timezone.now()+timedelta(days=5), news__is_moderated=True).datetimes('start_date', 'day') %}

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

{% if user.is_authenticated and (user.is_com_admin or user.memberships.board().ongoing().exists()) %} {% trans %}Create news{% endtrans %} {% endif %} {% if user.is_com_admin %} {% trans %}Administrate news{% endtrans %}
{% endif %} {% 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)).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 %}

{% trans %}All coming events{% endtrans %}

{% trans %}Birthdays{% endtrans %}

{%- if user.was_subscribed -%}
    {%- for year, users in birthdays -%}
  • {% trans age=timezone.now().year - year %}{{ age }} year old{% endtrans %}
  • {%- endfor -%}
{%- else -%}

{% trans %}You need to subscribe to access this content{% endtrans %}

{%- endif -%}
{% endblock %}