Source

django-basic-events / events / templates / events / list.html

{% extends "base.html" %}
{% block title %}Events{% endblock %}
{% block content %}    
    {% if upcoming_events %}
        <h2 class='no-bottom'>Upcoming {{ current_category }} Events and Meetings
        {% if perms.events.change_event %}
            <a class='edit' href='{% url admin:events_event_changelist %}'>(Edit)</a>
        {% endif %}
        {% if current_category %}: {{ current_category }}{% endif %}</h2>
        <ul class='events'>
            {% for event in upcoming_events %}
                <li>
                    <h2 class='no-bottom'><a href='{% url view_event event.begin_date.year,event.begin_date.month,event.slug %}'>{{ event }}</a></h2>
                        <p class='date'>
                            {{ event.display_date }}{% if event.show_date %}.{% endif %}
                        </p>
                    <div class='description'>{{ event.description|safe|truncatewords_html:40 }}</div>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
    
    {% if previous_events %}
        <h2 class='no-bottom'>Previous {{ current_category }} Events and Meetings
        {% if perms.events.change_event %}
            <a class='edit' href='{% url admin:events_event_changelist %}'>(Edit)</a>
        {% endif %}
        {% if current_category %}: {{ current_category }}{% endif %}</h2>
        <ul class='events'>
            {% for event in previous_events %}
                <li>
                    <h2 class='no-bottom'><a href='{% url view_event event.begin_date.year,event.begin_date.month,event.slug %}'>{{ event }}</a></h2>
                        <p class='date'>
                            {{ event.display_date }}{% if event.show_date %}.{% endif %}
                        </p>
                    <div class='description'>{{ event.description|safe|truncatewords_html:40 }}</div>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
{% endblock %}