<!DOCTYPE html>
<html lang="%lang;">
<head>
  <!-- $Id: dag.txt v7.1 18/08/2023 15:06:13 $ -->
  <!-- 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="%images_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
%define;of(xxx)
  [of%s:::xxx]
%end;
<div class="d-flex">
<h3 class="mt-2 ml-3 text-no-wrap">%nn;
  %if;(e.m="D")
    %if;(e.t="TV")[*compact descendants tree]
    %else;[*descendants tree]
    %end;
  %elseif;(e.m="A")[*ascendants tree]
  %elseif;(e.m="RLM")[*multi relations graph]
  %elseif;(e.m="DAG")[*surnames branch][:] %e.sn;
  %elseif;(e.em="R")[*path between]
      %person_index.e.first_name; %person_index.e.surname;
      %sp;[and]
      %if;(e.select="input" and e.pn!="" and e.p="" and e.n="")%apply;capitalize_words(e.pn)
      %elseif;(e.select="input" and e.pn="" and (e.p!="" or e.n!=""))%apply;capitalize_words(e.p) %apply;capitalize_words(e.n)
      %elseif;(e.select!="") %person_index.select.first_name; %person_index.select.surname;
      %else;%person_index.x.first_name; %person_index.x.surname;%end;
  %( TODO reorganise evar so that main person is always i= %)
  %elseif;(e.m="RL")[*path between]
      %person_index.1.first_name; %person_index.1.surname;
      %sp;[and]
      %person_index.2.first_name; %person_index.2.surname;
  %else;[*shortest path]
  %end;
  %if;(e.m="A" or e.m="D")
    %apply;of%with;%person_index.x.first_name; %person_index.x.surname;%end;
    %( note that a_of_b/self/to_gend are unavailable on dag %)
    %if;(e.v=1)[to the children]%nn;
    %elseif;(e.v=2)[to the grandchildren]%nn;
    %elseif;(e.v=3)[to the great-grandchildren]%nn;
    %else;[up to] %e.v; [generation/generations]1%end;
    %if;(e.oi!=""), [partial]%elseif;(e.dag="on"), [dag]%end;
  %end;
</h3>

%if;(e.m="DAG")
<div class="ml-auto">
  %include;buttons_dag
</div>
%end;
</div>
%if;(not cancel_links)
  %if;(e.m="A" or e.m="D")
    <div class="d-flex justify-content-center">
      %include;buttons_dag
    </div>
  %elseif;(e.m="RL" or e.m="RLM")
    <div class="row">
      %include;buttons_rel
    </div>
  %end;
%end;
%( TODO how to write ind name on navigation link? %dag_cell.index; seems empty?! %)
%if;(link_next!="" and not cancel_links)
  %include;buttons_rel
%end;
<table id="dag" class="mt-2 mb-6 ml-4">
%foreach;dag_line;
  <tr align="left">
  %foreach;dag_cell;
    <td class="%if;(e.m="D" or e.m="RL")align-top%elseif;(e.m="A")align-bottom%end; px-0"
      %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%else;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)
         %( added em!=R here condition because first button_rel is static and does the same
           No! each vbar has a different action, suppressing a particular path %)
        <a href="%dag_cell.bar_link;" title="[*suppress this path]">│</a>%nn;
      %else;│%end;
    %elseif;(dag_cell.text!="")%dag_cell.text;
    %elseif;(dag_cell.item!="")
      %if;(line_nbr!=0 and dag_cell.index!="-1")
        %if;(e.m="RLM" or e.dag="on" or e.em="R")
          <a href="%prefix;i=%dag_cell.index;" title="[*open this individual page]"></a>
        %else;
          %if;(not cancel_links)
            <div class="position-relative">
              <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 with this individual]"></a>
            </div>
          %end;
        %end;
      %end;
      <div class="d-flex-row flex-column justify-content-between
        %if;(dag_cell.item!="") mx-1%end;">%dag_cell.item;</div>
    %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>

%include;trl
</div>
%include;js
%query_time;
</body>
</html>
