<div i18n:domain="schooltool">
<h2 i18n:translate="">Sections</h2>
<div>
<div tal:define="schoolyears view/instructorOf"
     tal:condition="view/isTeacher">
  <h3 i18n:translate="">Sections taught</h3>
  <table class="person-view-sections">
    <thead>
      <tr>
        <th i18n:translate="">Section</th>
        <th i18n:translate="">Term</th>
        <th i18n:translate="">School Year</th>
      </tr>
    </thead>
    <tal:block repeat="schoolyear schoolyears">
      <tal:block repeat="term schoolyear/terms">
        <tal:block repeat="section_data term/sections">
          <tr>
            <td>
              <a tal:attributes="href section_data/obj/@@absolute_url;
                                 title section_data/title"
                 tal:content="section_data/title"></a>
            </td>
            <td>
              <a tal:attributes="href term/obj/@@absolute_url;
                                 title term/obj/title"
                 tal:content="term/obj/title"></a>
            </td>
            <td>
              <a tal:attributes="href schoolyear/obj/@@absolute_url;
                                 title schoolyear/obj/title"
                 tal:content="schoolyear/obj/title"></a>
            </td>
          </tr>
        </tal:block>
      </tal:block>
    </tal:block>
  </table>
</div>

<div tal:define="schoolyears view/learnerOf"
     tal:condition="view/isLearner">
  <h3 i18n:translate="">Sections attended</h3>
  <table class="person-view-sections">
    <thead>
      <tr>
        <th i18n:translate="">Section</th>
        <th i18n:translate="">Term</th>
        <th i18n:translate="">School Year</th>
      </tr>
    </thead>
    <tal:block repeat="schoolyear schoolyears">
      <tal:block repeat="term schoolyear/terms">
        <tal:block repeat="section_data term/sections">
          <tr>
            <td>
              <a tal:attributes="href section_data/obj/@@absolute_url;
                                 title section_data/title"
                 tal:content="section_data/title"></a>
            </td>
            <td>
              <a tal:attributes="href term/obj/@@absolute_url;
                                 title term/obj/title"
                 tal:content="term/obj/title"></a>
            </td>
            <td>
              <a tal:attributes="href schoolyear/obj/@@absolute_url;
                                 title schoolyear/obj/title"
                 tal:content="schoolyear/obj/title"></a>
            </td>
          </tr>
        </tal:block>
      </tal:block>
    </tal:block>
  </table>
</div>

<div tal:condition="python: not(view.isTeacher() or view.isLearner())">
  <h3 i18n:translate="">This person has no sections.</h3>
</div>
</div>
</div>

