[% IF has_refs && action != "editor" %]
<div class="card overflow-hidden w-full">
  <div class="head">
    <h3>References</h3>
  </div>
  <div>
    [% IF incoming.keys.size > 0 %]
      <h4 class="ml-2">Incoming:</h4>
      <ul class="ml-4 pr-2">
      [% FOREACH t = incoming.keys.sort %]
        [% FOREACH inc_ref = sort_by(incoming.$t, "name") %]
          <li>
            <a class="flexrow flex-nowrap gap-1 justify-between link" href="conf.cgi?sub=objects&amp;data.id=[% inc_ref.id %]">
              <span class="truncate max-w-[175px]">[% inc_ref.name | html %]</span>
              <span class="text-xs">([% t | html %])</span>
            </a>
          </li>
        [% END %]
      [% END %]
      </ul>
    [% END %]
    [% IF outgoing.keys.size > 0 %]
      [% IF incoming.keys.size > 0 %]
        <hr class="mt-0.5 pt-0.5">
      [% END %]
      <h4 class="ml-2">Outgoing:</h4>
      <ul class="ml-4 pr-2">
      [% FOREACH t = outgoing.keys.sort %]
        [% FOREACH name = outgoing.$t.keys.sort %]
          [% oid = outgoing.$t.$name %]
          <li>
            <a class="flexrow flex-nowrap gap-1 justify-between link" href="conf.cgi?sub=objects&amp;type=[% t | uri %]&amp;data.name=[% name | uri %]">
              <span class="truncate max-w-[175px]">[% name | html %]</span>
              <span class="text-xs">([% t | html %])</span>
            </a>
          </li>
        [% END %]
      [% END %]
      </ul>
    [% END %]
  </div>
</div>
[% END %]
