<div metal:use-macro="request.sdiapi.main_template" i18n:domain="substanced">

  <div metal:fill-slot="main"
       tal:define="root_url request.sdiapi.mgmt_url(request.virtual_root)">

    <div tal:repeat="(title, ids) [('As source', targets), ('As target', sources)]">
      <div class="panel panel-default">
        <div class="panel-heading">${title}</div>
        <div class="panel-body">
          <div tal:condition="ids">
            <table class="table table-striped">
              
              <thead>
                <tr>
                  <th i18n:translate="">Relationship type</th>
                  <th i18n:translate="">Objects</th>
                </tr>
              </thead>
              
              <tbody>
                <tr tal:repeat="(reftype, paths) ids">
                  <td>${reftype}</td>
                  <td>
                    <span tal:repeat="path paths">
                      <a href="${root_url+path}">${path or '/'}</a>${repeat.path.end and ' ' or ','}
                    </span>
                  </td>
                </tr>
              </tbody>
            </table>

          </div>

          <div tal:condition="not ids">
            <div>(none)</div>
          </div>

        </div>

      </div>
    </div>
  </div>

</div>
