<div class="manage-view" i18n:domain="schooltool"
     tal:condition="view/has_schoolyear"
     tal:define="timetables_link string:${context/@@absolute_url}/timetables;
                 timetables view/timetables">
  <h3>
    <a title="Manage timetables"
       tal:attributes="href timetables_link"
       i18n:attributes="title"
       i18n:translate="">
      Timetables
    </a>
  </h3>
  <table>
    <thead>
      <tr>
        <th i18n:translate="">Timetable</th>
        <th i18n:translate="">Starts</th>
        <th i18n:translate="">Ends</th>
      </tr>
    </thead>
    <tbody>
      <tr tal:condition="not:timetables">
        <td colspan="3" i18n:translate="">
          There are no
          <a tal:attributes="href timetables_link"
             i18n:translate="" i18n:name="timetables">timetables</a> set up.
        </td>
      </tr>
      <tr tal:repeat="timetable view/timetables"
          tal:condition="timetables">
        <td>
          <a tal:content="timetable/title"
             tal:attributes="href timetable/@@absolute_url">
            [link]
          </a>
        </td>
        <td tal:content="timetable/first/@@mediumDate">
          [number]
        </td>
        <td tal:content="timetable/last/@@mediumDate">
          [number]
        </td>
      </tr>
    </tbody>
  </table>
</div>
