## mako

<%page expression_filter="h"/>

<%namespace name='static' file='../static_content.html'/>

<%!
from django.utils.translation import ugettext as _
%>
<h3 class="hd hd-6 handouts-header">${_("Important Course Dates")}</h3>
## Should be organized by date, last date appearing at the bottom

% for course_date in course_date_blocks:
    <div class="date-summary-container">
        <div class="date-summary date-summary-${course_date.css_class}">
            % if course_date.title:
                % if course_date.title == 'current_datetime':
                    <span class="hd hd-6 heading localized-datetime" data-datetime="${course_date.date}" data-string="${_(u'Today is {date}')}" data-timezone="${user_timezone}" data-language="${user_language}"></span>
                % else:
                    <span class="hd hd-6 heading">${course_date.title}</span>
                % endif
            % endif
            % if course_date.date and course_date.title != 'current_datetime':
                <p class="hd hd-6 date localized-datetime" data-format="shortDate" data-datetime="${course_date.date}" data-timezone="${user_timezone}" data-language="${user_language}" data-string="${_(course_date.relative_datestring)}"></p>
            % endif
            % if course_date.description:
                <p class="description">${course_date.description}</p>
            % endif
            % if course_date.link and course_date.link_text:
                <span class="date-summary-link">
                    <a href="${course_date.link}">${course_date.link_text}</a>
                </span>
            % endif
        </div>
    </div>
% endfor

<%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory">
    DateUtilFactory.transform('.localized-datetime');
</%static:require_module_async>
