<!DOCTYPE html>
<html lang="%lang;">
<head>
  <!-- $Id: dag.txt v7.1 04/02/2022 14:45:14 $ -->
  <!-- Copyright (c) 1998-2007 INRIA -->
  <title>%nn;
    %if;(e.slices = "on")[*display by slices/slice width/overlap/total width]0%nn;
    %else;%apply;capitalize(head_title)%end;
  </title>
  <meta name="robots" content="none">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png">
%include;css
</head>
<body%body_prop;>
%include;hed
%message_to_wizard;
%( TODO include;menubar %index, %foreach;family, do not work in this context %)
%let;prefix_a;%prefix_base_password&p=%e.p;&n=%e.n;%nn;
  %if;(e.oc!="")&oc=%e.oc;%end;%in; %(%access does not work %)
<div class="container-fluid">
%include;home
<h1 class="h3">
  %if;(e.slices="on")
    [*display by slices/slice width/overlap/total width]0
  %else;
    %if;(e.m="D")[*descendants tree]%if;(e.t="TV") [compact] ou réduit ?%( TODO %)%end;
    %elseif;(e.m="A")[*ascendants tree]
    %else;[*relation/relations]0 ([shortest path])%end;
    %if;(e.oi!="") [partial]%end;
    %if;(e.dag="on") + [dag]%end;
  %end;
</h1>
%if;(e.t="A" or e.t="C")
  <h2 class="h4">
    %if;(e.t = "A")[*male line/female line]0%nn;
    %elseif;(e.t = "C")[*male line/female line]1%nn;
    %end;
  </h2>
%end;
%if;not cancel_links;
  <div class="d-flex justify-content-center">
    %include;buttons_dag
  </div><hr>
%end;
%if;(e.m="A" or e.m="D")
  %if;(e.slices = "on")
    <form method="GET" action="%action;">
    <p>
    %hidden;
    %foreach;env_binding;
      %if;(env.key != "slices")
        <input type="hidden" name="%env.key;" value="%env.val.decoded;"%/>
      %end;
    %end;
    </p>
    <table>
    <tr align="%left;">
      <td align="%right;">
        <label>
        [*don't group the common branches together]
        <input type="checkbox" name="nogroup" value="on"%/>
        </label>
      </td>
    </tr>
    <tr align="%left;">
      <td align="%right;">
        <label>
        [*display by slices/slice width/overlap/total width]1
        <input name="dpos" size="5" value="78"%/>
        </label>
      </td>
    </tr>
    <tr align="%left;">
      <td align="%right;">
        <label>
        [*display by slices/slice width/overlap/total width]2
        <input name="overlap" size="5" value="10"%/>
        </label>
      </td>
    </tr>
    <tr align="%left;">
      <td align="%right;">
        <label>
        [*display by slices/slice width/overlap/total width]3
        (%dag.min_wid;-%dag.max_wid;)
        <input name="width" size="5" value="%nn;
          %if;(dag.max_wid <= 78)%dag.max_wid;
          %elseif;(dag.min_wid >= 78)%dag.min_wid;
          %else;78%end;"%/>
        </label>
      </td>
    </tr>
    </table>
    <p><input type="submit" value="Ok"%/></p>
    </form>
  %end;
%end;
%( TODO how to write ind name on navigation link? %dag_cell.index; seems empty?! %)
%if;(e.slices!="on")
  %if;(link_next!="" and not cancel_links)
    %include;buttons_rel
  %end;
  %if;(e.notab = "on" or e.pos2 != "")
    %let;dpos;%if;(e.dpos != "")%e.dpos;%else;78%end;%in;
    %let;pos1;%if;(e.pos1 != "")%e.pos1;%else;0%end;%in;
    %let;pos2;%if;(e.pos2 != "")%e.pos2;%else;%dpos;%end;%in;
    %let;overlap;%if;(e.overlap != "")%e.overlap;%else;10%end;%in;
    %if;(pos1 != 0 or pos2 < dag.ncol)
      <div style="text-align:right">
        %if;(pos1 = 0)&nbsp;%nn;
        %else;
          <a href="%prefix_base_password;%nn;
            %foreach;env_binding;%nn;
              %if;(env.key != "pos1" and env.key != "pos2")%env.key;=%env.val;;%end;%nn;
            %end;%nn;
            pos1=%expr(pos1 + overlap - dpos);%nn;
            pos2=%expr(pos1 + overlap);">&lt;&lt;</a>
        %end;%nl
        %if;(pos2 >= dag.ncol)&nbsp;%nn;
        %else;
          <a href="%prefix_base_password;%nn;
            %foreach;env_binding;%nn;
              %if;(env.key != "pos1" and env.key != "pos2")%env.key;=%env.val;;%end;%nn;
            %end;%nn;
            pos1=%expr(pos2 - overlap);%nn;
            pos2=%expr(pos2 - overlap + dpos);">&gt;&gt;</a>
        %end;%nl;
      </div>
    %end;
    <pre>
    %foreach;dag_line;
      %foreach;dag_line_pre;
        %foreach;dag_cell_pre;
          %dag_cell_pre;%nn;
        %end;%nl;
      %end;
    %end;
    </pre>
  %else;
    <table id="dag" class="mx-auto">
    %foreach;dag_line;
      <tr align="left">
      %foreach;dag_cell;
        <td class="%if;(e.m="D")align-top%elseif;(e.m="A")align-bottom%end; px-0 text-monopace"
          %if;(dag_cell.colspan>1) colspan="%dag_cell.colspan;"%end;
          style="line-height:%if;(dag_cell.item!="")1%nn;
                             %elseif;dag_cell.is_bar;1%nn;
                             %elseif;dag_cell.is_nothing;0%end;;"%nn;
        %if;(e.im="") valign="bottom"%end;
        align="%dag_cell.align;">
        %if;dag_cell.is_nothing;&nbsp;%nn;
        %elseif;dag_cell.is_bar;
          %if;(dag_cell.bar_link != "" and not cancel_links and e.em!="R")
             %( added em!=R here condition because first button_rel is static and does the same %)
            <a href="%dag_cell.bar_link;%if;(e.im=0)&im=0%end;" title="[*navigate on tree]">│</a>%nn;
          %else;│%end;
        %elseif;(dag_cell.text != "")%dag_cell.text;
        %elseif;(dag_cell.item != "")
          %if;(line_nbr!=0 and dag_cell.index!="-1")
            <div class="position-relative list-group-item-action">
              %if;(e.m="RLM")
              <a href="%prefix;i=%dag_cell.index;"
                class="stretched-link"
                title="[*open this individual page]" style="line-height:1rem"></a>
              %else;
              <a href="%prefix_set.pmod;i=%dag_cell.index;&m=D&t=TV&%foreach;env_binding;%nn;
                %if;(not (env.key="i" or env.key="p" or env.key="n" or env.key="oc" or
                          env.key="m" or env.key="t"))%env.key;=%env.val;&%end;%end;"
                class="stretched-link"
                title="[*navigation] on tree [with] this individual" style="line-height:1rem"></a>
              %end;
          %end;
          <div class="d-flex-row flex-column justify-content-between%if;(dag_cell.item!="") mx-1%end;">%dag_cell.item;</div>
          %if;(line_nbr!=0 and dag_cell.index!="-1")
            </div>
          %end;
        %else;
          %( TODO : trouver une condition pour un hr stylisé pour les conjoints %)
          %if;dag_cell.is_hr_left;
            <hr class="%left;">%nn;
          %elseif;dag_cell.is_hr_right;
            <hr class="%right;">%nn;
          %else;
            <hr class="full">%nn;
          %end;
        %end;
        </td>
      %end;
      </tr>
    %end;
    </table>
  %end;
%end;
%base_trailer;
%include;copyr
</div>
%include;js
</body>
</html>
