<div i18n:domain="schooltool"
     tal:define="evdate python:context.dtstart.strftime('%Y-%m-%d')">

  <h3>
    <span tal:replace="context/title" />
    -
    <span tal:replace="view/day" />
    <a class="modify" href=""
       title="Change the details of this event"
       tal:condition="context/schooltool:can_edit"
       tal:attributes="href string:${context/@@absolute_url}/edit.html"
       i18n:attributes="title">
      <img tal:attributes="src context/++resource++schooltool.skin.flourish/edit-icon.png"
           alt="Edit"
           i18n:attributes="alt" />
    </a>
  </h3>
  <tal:if condition="context/allday">
    <div><strong i18n:translate="">All day event</strong></div>
  </tal:if>
  <p style="width:62%; font-size:85%" tal:content="structure context/description|nothing" />

  <div class="info-block">
    <h3 i18n:translate="">Details</h3>
    <table class="person-details">
      <tal:if condition="not:context/allday">
        <tr tal:condition="view/start">
          <td class="dr" i18n:translate="">Starts</td>
          <td class="dl" tal:content="view/start" />
        </tr>
        <tr tal:condition="view/end">
          <td class="dr" i18n:translate="">Ends</td>
          <td class="dl" tal:content="view/end" />
        </tr>
        <tr tal:condition="context/recurrence">
          <td colspan="2" class="dl" i18n:translate="">
            This is a recurring event.
          </td>
        </tr>
      </tal:if>
      <tr tal:condition="context/location|nothing">
        <td class="dr" i18n:translate="">Location</td>
        <td class="dl" tal:content="context/location" />
      </tr>
    </table>
  </div>

  <div class="info-block"
       tal:define="resources view/display/getBookedResources">

    <h3>
      <tal:block i18n:translate="">Reserved resources</tal:block>

      <a class="modify" href=""
         tal:condition="context/schooltool:can_edit"
         title="Change the resources reserved for this event"
         i18n:attributes="title"
         tal:attributes="href string:${context/@@absolute_url}/booking.html?date=${evdate}">
        <img tal:attributes="src context/++resource++schooltool.skin.flourish/edit-icon.png"
             alt="Edit"
             i18n:attributes="alt" />
      </a>
    </h3>

    <ul tal:condition="resources">
      <li tal:repeat="resource resources">
        <a href=""
           tal:attributes="href string:${resource/@@absolute_url}"
           tal:content="resource/title" />
      </li>
    </ul>
    <p tal:condition="not:resources" i18n:translate="">
      There are none.
    </p>
  </div>

</div>
