{% load base_filters %}
{% if events %}
    <h3 style="font-size: 24px; font-family: Helvetica, Arial, sans-serif; margin: 0px;">
    {# named area for jump links #}
    <a name="events" id="events"></a>
    {% if start_dt %}
        {% blocktrans with start_dt|date:"M d, Y" as startdate and end_dt|date:"M d, Y" as enddate %}Events for {{ startdate }} to {{ enddate }}{% endblocktrans %}
    {% else %}
        {% trans "All Events" %}
    {% endif %}
    </h3>

    {% for event in events %}

        {# leverage the functions in the object #}

        <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="body_copy">
        <tr><td>&nbsp;</td></tr>
        <tr><td align="left" valign="top">
        <a href="{{ SITE_GLOBAL_SITEURL }}{% url 'event' event.pk %}" >
        <font face="Arial" size="2"><b> {% blocktrans with t=event.title %}{{ t }}{% endblocktrans %}
        </b></font></a>

        {# show member icon if not allowanonymousview/allowsiteuserview #}
        {% if not event.allow_anonymous_view and event.allow_user_view   %}
            &nbsp;&nbsp;<img src="{{ SITE_GLOBAL_SITEURL }}{% static 'images/icons/member.gif' %}" height="13" width="15"
            border="0" alt="{% trans 'Member View Only' %}" title="{% trans 'Member View Only' %}">
        {% endif %}
        </td></tr>

        {% if not simplified  %}
            <tr><td align="left"><font face="Arial" size="2" color="#000000">
			<strong>{% trans 'Date and Time:' %}</strong>
            {% for span in event.date_spans %}
		        {% if span.same_date %}
			        {{ span.start_dt|date:"D, N j, Y" }}
			        {% if not forloop.last %} and {% endif %}
		        {% else %}
			        {{ span.start_dt|date:"D, M. j" }} - {{ span.end_dt|date:"D, M. j, Y" }}
			        {% if not forloop.last %} and {% endif %}
		        {% endif %}
	        {% endfor %}
	        
          {% if not event.all_day %}
            {{ event.start_dt|date:"P" }} - {{ event.end_dt|date:"P" }} {{ event.timezone.zone|timezone_label }}
         {% endif %}

            </font>
            </td></tr>
        {% endif %}

        <tr><td align="left" valign="top"><div>
        <font face="Arial" size="2" color="#000000">

        {% blocktrans with d=event.description|striptags|safe|truncatewords:60 %}{{ d }}{% endblocktrans %}
         <a href="{{ SITE_GLOBAL_SITEURL }}{% url 'event' event.pk %}">[More Info]</a>
        </font>

        {#  posted by #}
        {% if not simplified  %}
            <font face="Arial" size="2" color="#000000">
            <br><b>{% blocktrans with event.owner.first_name as eventfirst and event.owner.last_name as eventlast %}Posted by</b>:
            {{ eventfirst }} {{ eventlast }}{% endblocktrans %}
            </font>
        {% endif %}
        <br>

        </div></td></tr>
        </table>

    {% endfor %}
    <hr>
{% endif %}
