<!DOCTYPE html>
<html lang="%lang;">
<head>
  <!-- $Id: anclist.txt,v 7.00 2018-04-28 13:15:18 ddr Exp $ -->
  <title>%nn;
    %if;(evar.t = "F")- [*surnames branch] -%nn;
    %else
      %apply;a_of_b%with;
        %if;(evar.t = "M")[*missing ancestors]%else;[*ancestors]%end;
      %and;
        %if;(public_name != "")%public_name;%else;%first_name;%end;
        %if;(qualifier != "") %qualifier;%end;
        %sp;%surname;
      %end;
    %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
%include;hed
</head>
<body%body_prop;>
%message_to_wizard;
<div class="container-fluid">
%include;perso_utils
%if;not cancel_links;
  %include;menubar
%end;

<script type="text/javascript">
  <!--
  function over1(xx)
  {
   document.getElementById(xx).style.backgroundColor="#CBFECE";
   return false;
  }
  function out1(xx)
  {
   document.getElementById(xx).style.backgroundColor="";
   return false;
  }
  -->
</script>

%define;implex1(xx)
  onmouseover="over1('xx')" onmouseout="out1('xx')" %nn;
%end;

<h1>%nn;
  %if;(evar.t = "F")
    %if;(public_name != "")%public_name;%else;%first_name;%end;
    %if;(qualifier != "") <em>%qualifier;</em>%end;
    %sp;%surname;
    %if;(alias != "") <em>(%alias;)</em>%end;<br>
    - [*surnames branch] -
  %elseif;(evar.t = "E")
    %if;(public_name != "")%public_name;%else;%first_name;%end;
    %if;(qualifier != "") <em>%qualifier;</em>%end;
    %sp;%surname;
    %if;(alias != "") <em>(%alias;)</em>%end;<br>
    - [*list eclair] -
  %else;
    %apply;a_of_b%with;[*ancestors]%and;
      %if;(public_name != "")%public_name;%else;%first_name;%end;
      %if;(qualifier != "") <em>%qualifier;</em>%end;
      %sp;%surname;
      %if;(alias != "") <em>(%alias;)</em>%end;
    %end;
    %if;(evar.t = "D") [up to] %pvar.1;%end;
  %end;
</h1>

%if;not cancel_links;
  %include;buttons
%end;

%define;ancestors_by_list(xx, nnn)
  %if;(xx.has_parents and nnn > 1)
    <ul>
    <li class="male"><a href="%prefix;
    %xx.father.access;">%xx.father;</a>%xx.father.title;%xx.father.dates;%nl;
    %apply;ancestors_by_list("xx.father", nnn - 1)</li>
    <li class="female"><a href="%prefix;
    %xx.mother.access;">%xx.mother;</a>%xx.mother.title;%xx.mother.dates;%nl;
    %apply;ancestors_by_list("xx.mother", nnn - 1)</li>
    </ul>
  %end;
%end;

%define;ancestors_horizontally(pp, xx, ss1, ss2, ss3, zz)
  %if;(xx > 0)
    %if;(pp.sosa=zz or (not browsing_with_sosa_ref) or evar.implx="")
      %if;(pp.has_parents)
        %apply;ancestors_horizontally(
          "pp.father", xx - 1, "ss1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
          "ss1&nbsp;┌──&nbsp;", "ss1&nbsp;|&nbsp;&nbsp;&nbsp;", zz*2)
      %end;
      <samp>ss2</samp>%nn;
      %if;(not cancel_links)
        <a id="sosa_%pp.sosa;" href="%prefix;%pp.access;">%pp;</a>
      %else;
        %pp;%nn;
      %end;
      %pp.title;%pp.dates;<br>
      %if;(pp.has_parents)
        %apply;ancestors_horizontally(
          "pp.mother", xx - 1, "ss3&nbsp;|&nbsp;&nbsp;&nbsp;",
          "ss3&nbsp;└──&nbsp;", "ss3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", zz*2+1)
      %end;
    %else;
      %let;sss;sosa_%pp.sosa;%in;
      <samp>ss2</samp>%nn;
      %if;(not cancel_links)
        <a href="%prefix;%pp.access;">%pp;</a>
        <a href="#%sss;" %apply;implex1(sss)
          title="[implex/implexes]0, [see above] zz">%nn;
        <i class="fa fa-random  fa-fw mx-0" aria-hidden="true"></i>
        <span class="sr-only">%sp;(==)%sp;</span></a><br>
      %else;
        %pp;<i class="fa fa-random  fa-fw mx-0" aria-hidden="true"></i>%nn;
        <span class="sr-only">%sp;(==)%sp;</span><br>
      %end;
    %end;
  %end;
%end;

%if;(evar.v = "" or evar.v <= 1)
  [*specify::generation/generations]0.
%else;
  %if;(evar.t = "L")
    %( by list %)
    %let;xx;
      %if;(bvar.max_anc_level = "")%apply;min(evar.v, max_anc_level, 7)
      %else;%apply;min(evar.v, max_anc_level, bvar.max_anc_level)%end;
    %in;
    <p>%apply;togena(xx).</p>
    %apply;ancestors_by_list("self", xx)

  %elseif;(evar.t = "H")
    %( horizontally %)
    %let;xx;
      %if;(bvar.max_anc_level = "")%apply;min(evar.v, max_anc_level, 7)
      %else;%apply;min(evar.v, max_anc_level, bvar.max_anc_level)%end;
    %in;
    <p>%apply;togena(xx).</p>
    <table><tr><td style="font-family:monospace;white-space:nowrap;line-height:1.2em;">
    %apply;ancestors_horizontally(
      "self", xx, "&nbsp;&nbsp;&nbsp;", "──&nbsp;", "&nbsp;&nbsp;&nbsp;", 1)
    </td></tr></table>

  %elseif;(evar.t = "E" and evar.sort != "")
    %( list eclair sorted by date begin or number of individuals or number of events %)
    %empty_sorted_list;
    %foreach;ancestor_surname(evar.v)
      %apply;add_in_sorted_list%with;
        %if;(evar.sort = "ind")
          %ancestor.nb_ind;
        %elseif;(evar.sort = "evt")
          %ancestor.nb_events;
        %else;
          %ancestor.date_begin.year;
        %end;
        %and;%ancestor.surname_end;
        %and;%ancestor.surname_begin;
        %and;%ancestor.place;
        %and;%ancestor.date_begin.prec;
        %and;%ancestor.date_begin.year;
        %and;%ancestor.date_end.prec;
        %and;%ancestor.date_end.year;
        %and;%ancestor.nb_ind;
        %and;%ancestor.nb_events;
      %end;
    %end;

    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togena(nb_gen).</p>
    <div class="not_printable" style="margin-bottom:15px;">
      %if;(not cancel_links)
      <table class="display_search">
        <tr>
          <td><b>[*sort by/date begin/alphabetic order/nb individuals/nb events]0</b></td>
          <td><img src="%image_prefix;/picto_calendar.png"%/></td>
          <td>
            %if;(evar.sort = "date")
              [sort by/date begin/alphabetic order/nb individuals/nb events]1
            %else;
              <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=date">
                [sort by/date begin/alphabetic order/nb individuals/nb events]1
              </a>
            %end;
          </td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;">
            [sort by/date begin/alphabetic order/nb individuals/nb events]2
            </a>
          </td>
          <td><img src="%image_prefix;/picto_numeric_order.png"%/></td>
          <td>
            %if;(evar.sort = "ind")
              [sort by/date begin/alphabetic order/nb individuals/nb events]3
            %else;
              <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=ind">
                [sort by/date begin/alphabetic order/nb individuals/nb events]3%nn;
              </a>
            %end;
            [or]
            %if;(evar.sort = "evt")
              [sort by/date begin/alphabetic order/nb individuals/nb events]4
            %else;
              <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=evt">
                [sort by/date begin/alphabetic order/nb individuals/nb events]4
              </a>
            %end;
          </td>
        </tr>
      </table>
      %end;
    </div>

    <table class="list_eclair_table">
      <thead>
      <tr class="list_eclair_table_header">
        <th>[*surname/surnames]0</th>
        <th>[*place]</th>
        <th>[*date begin]</th>
        <th>[*date end]</th>
        <th>[*nb individuals]</th>
        <th>[*nb events]</th>
      </tr>
      </thead>
      <tbody>
      %foreach;sorted_list_item;
        <tr>
          <td>%item.2;%item.3</td>
          <td>%item.4;</td>
          <td align="center">
            %if;(item.5 = "&lt;")
              /%item.6;
            %elseif(item.5 = "&gt;")
              %item.6;/
            %elseif;(item.5 = "|" or item.5 = "..")
              %item.6;
            %else;
              %item.5;%item.6;
            %end;
          </td>
          <td align="center">
            %if;(item.7 = "&lt;")
              /%item.7;
            %elseif(item.7 = "&gt;")
              %item.8;/
            %elseif;(item.7 = "|" or item.7 = "..")
              %item.8;
            %else;
              %item.7;%item.8;
            %end;
          </td>
          <td align="center">%item.9;</td>
          <td align="center">%item.10;</td>
        </tr>
      %end;
      </tbody>
    </table>

  %elseif;(evar.t = "E")
    %( list eclair by alphabetic order %)
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togena(nb_gen).</p>
    <div class="not_printable" style="margin-bottom:15px;">
      %if;(not cancel_links)
      <table class="display_search">
        <tr>
          <td><b>[*sort by/date begin/alphabetic order/nb individuals/nb events]0</b></td>
          <td><img src="%image_prefix;/picto_calendar.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=date">
              [sort by/date begin/alphabetic order/nb individuals/nb events]1
            <a>
          </td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>[sort by/date begin/alphabetic order/nb individuals/nb events]2</td>
          <td><img src="%image_prefix;/picto_numeric_order.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=ind">
              [sort by/date begin/alphabetic order/nb individuals/nb events]3%nn;
            </a>
            [or]
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=evt">
              [sort by/date begin/alphabetic order/nb individuals/nb events]4
            </a>
          </td>
        </tr>
      </table>
      %end;
    </div>

    <table class="list_eclair_table">
      <thead>
      <tr class="list_eclair_table_header">
        <th>[*surname/surnames]0</th>
        <th>[*place]</th>
        <th>[*date begin]</th>
        <th>[*date end]</th>
        <th>[*nb individuals]</th>
        <th>[*nb events]</th>
      </tr>
      </thead>
      <tbody>
      %foreach;ancestor_surname(evar.v)
        <tr>
          <td>
            %ancestor.surname_end;%ancestor.surname_begin;
          </td>
          <td>
            %ancestor.place;
          </td>
          <td align="center">
            %if;(ancestor.date_begin.prec = "&lt;")
              /%ancestor.date_begin.year;%nn;
            %elseif;(ancestor.date_begin.prec = "&gt;")
              %ancestor.date_begin.year;/%nn;
            %elseif;(ancestor.date_begin.prec = "|" or ancestor.date_begin.prec = "..")
              %ancestor.date_begin.year;%nn;
            %else;
              %ancestor.date_begin.prec;%ancestor.date_begin.year;%nn;
            %end;
          </td>
          <td align="center">
            %if;(ancestor.date_end.prec = "&lt;")
              /%ancestor.date_end.year;%nn;
            %elseif;(ancestor.date_end.prec = "&gt;")
              %ancestor.date_end.year;/%nn;
            %elseif;(ancestor.date_end.prec = "|" or ancestor.date_end.prec = "..")
              %ancestor.date_end.year;%nn;
            %else;
              %ancestor.date_end.prec;%ancestor.date_end.year;%nn;
            %end;
          </td>
          <td align="center">%ancestor.nb_ind;</td>
          <td align="center">%ancestor.nb_events;</td>
        </tr>
      %end;
      </tbody>
    </table>

  %elseif;(evar.t = "F" and evar.sort = "on")
    %( surnames branch sorted by number of branches %)
    %empty_sorted_list;
    %reset_count;
    %foreach;ancestor_surname(evar.v)
      %incr_count;
      %apply;add_in_sorted_list(
        ancestor.nb_times,
        ancestor.surname_end,
        ancestor.surname_begin,
        ancestor.sosa_access,
        ancestor.place,
        ancestor.date_begin.prec,
        ancestor.date_begin.year,
        ancestor.date_end.prec,
        ancestor.date_end.year)
    %end;

    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togena(nb_gen).</p>

    %if;(count > 100)
      <p>
        <span>[*number of branches] : </span>
        %foreach;sorted_list_item;
          %if;(prev_item.1 != item.1)
            <a href="#a_%apply;hexa(item.1)">%item.1;</a>
          %end;
        %end;
      </p>
    %end;

    <p>[*help surname branch].</p>
    <div class="not_printable">
      %if;(not cancel_links)
      <table class="display_search">
        <tr>
          <td><b>[*sort by/branch/alphabetic order]0</b></td>
          <td><img src="%image_prefix;/picto_branch.png"%/></td>
          <td>[sort by/branch/alphabetic order]1</td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;sosab=%evar.sosab;&amp;t=%evar.t;&amp;v=%evar.v;">
              [sort by/branch/alphabetic order]2
            </a>
          </td>
        </tr>
      </table>
      %end;
    </div>
    <ul class="surname_branch_sort">
      %if;(count <= 100)
        <li>%nn;
        <table class="surname_branch_table">
          <tr class="surname_branch_table_header">
            <th width="30%%">[*surname/surnames]0</th>
            <th width="10%%">[*nb branches]</th>
            <th width="45%%">[*place]</th>
            <th width="15%%">[*date/dates]0</th>
          </tr>
      %end;
      %foreach;sorted_list_item;
        %if;(prev_item.1 != item.1 and count > 100)
          <li>%nn;
          <a name="a_%apply;hexa(item.1)">%item.1;</a>
          <table class="surname_branch_table">
            <tr class="surname_branch_table_header">
              <th width="30%%">[*surname/surnames]0</th>
              <th width="10%%">[*nb branches]</th>
              <th width="45%%">[*place]</th>
              <th width="15%%">[*date/dates]0</th>
            </tr>
        %end;
        <tr>
          <td>
            %item.2;%item.3;
          </td>
          <td align="center">
            %if;(evar.cgl != "on")
              <a href="%prefix;m=DAG;%item.4;">%item.1;</a>
            %else;
              %item.1;
            %end;
          </td>
          <td>
            %item.5;
          </td>
          <td>
            %if;(item.6 = "&lt;")
              /%item.7;
            %elseif(item.6 = "&gt;")
              %item.7;/
            %elseif;(item.6 = "|" or item.6 = "..")
              %item.7;
            %else;
              %item.6;%item.7;
            %end;%nn;
            -%nn;
            %if;(item.8 = "&lt;")
              /%item.9;
            %elseif(item.8 = "&gt;")
              %item.9;/
            %elseif;(item.8 = "|" or item.8 = "..")
              %item.9;
            %else;
              %item.8;%item.9;
            %end;
          </td>
        </tr>
        %if;(item.1 != next_item.1 and count > 100)
          </table>
          </li>
        %end;
      %end;
      %if;(count <= 100)
        </table>
        </li>
      %end;
    </ul>
    <p style="clear:both"></p>

  %elseif;(evar.t = "F")
    %( surnames branch %)
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togena(nb_gen).</p>
    <p>[*help surname branch].</p>
    <div class="not_printable" style="margin-bottom:25px;">
      %if;(not cancel_links)
      <table class="display_search">
        <tr>
          <td><b>[*sort by/branch/alphabetic order]0</b></td>
          <td><img src="%image_prefix;/picto_branch.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;sosab=%evar.sosab;&amp;t=%evar.t;&amp;v=%evar.v;&amp;sort=on">
              [sort by/branch/alphabetic order]1
            </a>
          </td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>[sort by/branch/alphabetic order]2</td>
        </tr>
      </table>
      %end;
    </div>
    <table class="surname_branch_table">
      <thead>
      <tr class="surname_branch_table_header">
        <th>[*surname/surnames]0</th>
        <th>[*nb branches]</th>
        <th>[*place]</th>
        <th>[*date/dates]0</th>
      </tr>
      </thead>
      <tbody>
      %foreach;ancestor_surname(evar.v)
        <tr>
          <td>
            %ancestor.surname_end;%ancestor.surname_begin;
          </td>
          <td align="center">
            %if;(evar.cgl != "on")
              <a href="%prefix;m=DAG;%ancestor.sosa_access;">%ancestor.nb_times;</a>
            %else;
              %ancestor.nb_times;
            %end;
          </td>
          <td>
            %ancestor.place;
          </td>
          <td>
            %if;(ancestor.date_begin.prec = "&lt;")
              /%ancestor.date_begin.year;%nn;
            %elseif;(ancestor.date_begin.prec = "&gt;")
              %ancestor.date_begin.year;/%nn;
            %elseif;(ancestor.date_begin.prec = "|" or ancestor.date_begin.prec = "..")
              %ancestor.date_begin.year;%nn;
            %else;
              %ancestor.date_begin.prec;%ancestor.date_begin.year;%nn;
            %end;
            -%nn;
            %if;(ancestor.date_end.prec = "&lt;")
              /%ancestor.date_end.year;%nn;
            %elseif;(ancestor.date_end.prec = "&gt;")
              %ancestor.date_end.year;/%nn;
            %elseif;(ancestor.date_end.prec = "|" or ancestor.date_end.prec = "..")
              %ancestor.date_end.year;%nn;
            %else;
              %ancestor.date_end.prec;%ancestor.date_end.year;%nn;
            %end;
          </td>
        </tr>
      %end;
      </tbody>
    </table>
  %end;
%end;

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