<!DOCTYPE html>
<html lang="%lang;">
<head>
  <!-- $Id: deslist_hr.txt v7.1 19/05/2024 23:50:44 $ -->
  <!-- Copyright (c) 1998-2007 INRIA -->
  <title>%nn;
    %apply;a_of_b_gr_eq_lev%with;
      [*descendants]%nn;
    %and;
      %if;(public_name != "")%public_name;%else;%first_name;%end;
      %if;(qualifier != "") %qualifier;%end;
      %sp;%surname;
    %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;
<div class="container-fluid">
%include;perso_utils
%if;not cancel_links;
  %include;menubar
  %include;buttons
%end;
%define;input(xx)
  <label class="sr-only mt-2" for="inputxx">Filtre xx</label>
  <input type="text" id="inputxx" placeholder="[surname/surnames]0xx" title="[filter by::surname/surnames]0xx" class="filter%if;(xx>1) extrafilter%end; form-control-sm mr-1%if;(xx!=1) d-none%end;" disabled>
%end;
%let;birth_symbol;%if;(bvar.birth_symbol != "")%bvar.birth_symbol;%else;&deg;%end;%in;
%let;death_symbol;%if;(bvar.death_symbol != "")%bvar.death_symbol;%else;&dagger;%end;%in;
%let;l_v0;%if;(e.v > static_max_desc_level)%static_max_desc_level;%else;%e.v;%end;%in;
%let;l_v;%if;(b.max_desc_level = "" or b.max_desc_level > l_v0)%l_v0;%else;%b.max_desc_level;%end;%in;

%define;desc1(z1,z2,z3,z4,curlev,maxlev,sp_index)
  %let;l_v1;%if;(l_v0>=curlev)%expr(l_v0-curlev)%else;%e.v;%end;%in;
  %let;l1;%if;(z3z4 = "00" or z3z4 = "01")  ┊%else;   %end;%in;
  %let;l2;
    %if;(curlev != 0)
      %if;(z2 = 0)
        %if;(z4 = 1)%l1;┗%elseif;(z4 = 0)%l1;┣%end;%if;(child_cnt < 10)━%end;%nn;
      %else;
        %if;(z4 = 1)%l1;└%elseif;(z4 = 0)%l1;├%end;%if;(child_cnt < 10)─%end;%nn;
      %end;
    %end;
  %in;
  %let;zl1;
    %if;(curlev != 0)
      %if;(z2 = 0)
        %if;(z4 = 1)z1%l1; %else;z1%l1;┃%end;
      %else;
        %if;(z4 = 1)z1%l1; %else;z1%l1;│%end;
      %end;
    %end;
  %in;
  %let;zl2;%sex;%in;
  %if;(has_families)
    %let;l21;
      %if;(curlev != 0)
        %if;(not cancel_links)
          <a href="%prefix;%access;&m=D&t=D&v=%l_v1;"  title="[navigate on tree] [with] %child;">%child_cnt;</a>%nn;
        %else;
          %child_cnt;%nn;
        %end;
      %end;
    %in;
    %let;l22;
      %if;(browsing_with_sosa_ref and has_sosa)
        %if;(has_siblings)▶%else;▷%end;
      %end;
    %in;
    %foreach;family;
      %let;l211;%if;(is_male)━%else;─%end;%in;
      %let;l212;%if;(is_male)%if;(curlev < maxlev and has_children)┳%else;━%end;%else;%if;(curlev < maxlev and has_children)┬%else;─%end;%end;%in;
      %let;ifam;%family.index;%in;
      %let;zl3;%if;(family_cnt = nb_families)1%else;0%end;%in;
      <span data-surname="_%surname;" class="text-nowrap"><span class="tt">
      %if;(nb_families > 1)
        %let;l3;
          %if;(curlev != 0 and family_cnt > 1)
            %if;(z2 = 0)
              %if;(z4 = 1)%l1; %elseif;(z4 = 0)%l1;┃%end;%if;(child_cnt <10) %end;%child_cnt;%nn;
            %else;
              %if;(z4 = 1)%l1; %elseif;(z4 = 0)%l1;│%end;%if;(child_cnt <10) %end;%child_cnt;%nn;
            %end;
          %else;
            %l2;%l21;%nn;
          %end;
        %in;
        z1%l3;%if;(family_cnt>0)%apply;letter(family_cnt)%end;%l212;%l22;%nn;
      %else;
        z1%l2;%l21;%l211;%l212;%l22;%nn;
      %end;
        </span>
      %apply;add_in_sorted_list(index)
      %apply;add_in_sorted_listc(index)
      %if;(family_cnt > 1 or cancel_links)
        %self; %dates;%if;(self.title!=""), %self.title;%end;%nn;
      %elseif;(not cancel_links)
        <a href="%prefix;%access;" data-index="%index;">%self;</a>
        %if;wizard;<a href="%prefix;m=MOD_IND&i=%index;"
        title="[modify::person/persons]0">%dates;</a>%else;%dates;%end;
        %if;(self.title!=""), %self.title;%end;%nn;
      %end;%sp;
      %if;(wizard and not cancel_links)
        <a href="%prefix&m=MOD_FAM&i=%family.index;&ip=%index;" title="[modify::family/families]0">
      %end;
        <span class="small text-muted text-nowrap">%nn;
          %if;(are_engaged or are_married)&%elseif;are_not_married;X%end;
          %if;(on_marriage_date!="")%family.date_s;%end;
        </span>
      %if;(wizard and not cancel_links)</a>%end;%sp;
      %if;(not cancel_links)
        <a href="%prefix;%spouse.access;">%spouse;</a>
        %if;wizard;<a href="%prefix;m=MOD_IND&i=%spouse.index;" title="[modify::person/persons]0">%spouse.dates;</a>%else;%spouse.dates;%end;
        %if;(spouse.title!=""), %spouse.title;%end;%nn;
      %else;
       %spouse; %spouse.dates;%if;(spouse.title!=""), %spouse.title;%end;%nn;
      %end;
      %if;(spouse.first_name!="?" and spouse.surname!="?" and not spouse.is_descendant)
        %apply;add_in_sorted_list(spouse.index)
      %end;
      %if;(spouse.is_descendant and evar.implx="")
        %if;(not cancel_links)
          <a role="button" onclick="implexdesc('%index;')" title="[*implex/implexes]0"><i class="fa fa-shuffle fa-fw ml-1" aria-hidden="true"></i><span class="sr-only"> (==)</span></a>
        %else;
          <i class="fa fa-shuffle fa-fw ml-1" aria-hidden="true"></i><span class="sr-only"> (==)</span>
        %end;
      %end;
      </span>
      <br data-surname="_%surname;">
      %if;(curlev+1 < maxlev)
        %reset_count;
        %foreach;sorted_listb_item;
          %if;("item.1"="ifam")%incr_count;%end;
        %end;
        %reset_count1;
        %foreach;sorted_listc_item;
          %if;("item.1"="index")%incr_count1;%end;
        %end;
        %if;has_children;
          %foreach;child;
            %reset_count2;
            %foreach;sorted_listc_item;
              %if;("item.1"="child.index")%incr_count2;%end;
            %end;
            %if;(count=0 or count1=0 or count2=0 or evar.implx="")
              %let;zl4;%if;(child_cnt = nb_children)1%else;0%end;%in;
              %apply;desc1(zl1,zl2,zl3,zl4,curlev+1,maxlev,spouse.index)
            %else;
              %apply;desc2(zl1,zl2,zl3,zl4,curlev+1,maxlev,spouse.index)
            %end;
          %end;
        %end;
      %end;
      %apply;add_in_sorted_listb(ifam)
    %end;
  %else;
    %let;l23;
      %if;(curlev != 0)
        %if;(not cancel_links)
          <a href="%prefix;%access;&m=D&t=D&v=%l_v1;" title="[navigate on tree] [with] %child;">%child_cnt;</a>%nn;
        %else;
          %child_cnt;%nn;
        %end;
      %end;
    %in;
    %let;l231;%if;(is_male)━━%elseif;(is_female)──%else;╍%end;%in;
    %let;l24;
      %if;(browsing_with_sosa_ref and has_sosa)
        %if;(has_siblings)◀%else;◁%end;
      %end;
    %in;
    <span data-surname="_%surname;" class="text-nowrap">
      <span class="tt">z1%l2;%l23;%l231;%l24;%nn;
        %reset_count;
        %foreach;sorted_listc_item;
          %if;("item.1"="index")%incr_count;%end;
        %end;
        %if;(count>0)
          %l231;%nn;
        %end;
      </span>
      %apply;add_in_sorted_list(index)
      %apply;add_in_sorted_listc(index)
      %if;(not cancel_links)
        <a href="%prefix;%access;" data-index="%index;">%self;</a>%if;(self.title!=""), %self.title;%end;
      %else;
        %self;
      %end; %dates;%nn;
    </span>
    <br data-surname="_%surname">
  %end;
%end;
%define;desc2(z1,z2,z3,z4,curlev,maxlev,sp_index)
  %let;l1;%if;(z3z4 = "00" or z3z4 = "01")  ┊%else;   %end;%in;
  %let;l2;
    %if;(curlev != 0)
      %if;(z2 = 0)
        %if;(z4 = 1)%l1;┗%elseif;(z4 = 0)%l1;┣%end;%if;(child_cnt < 10)━%end;%nn;
      %else;
        %if;(z4 = 1)%l1;└%elseif;(z4 = 0)%l1;├%end;%if;(child_cnt < 10)─%end;%nn;
      %end;
    %end;
  %in;
  %let;zl1;
    %if;(curlev != 0)
      %if;(z2 = 0)
        %if;(z4 = 1)z1%l1; %else;z1%l1;┃%end;
      %else;
        %if;(z4 = 1)z1%l1; %else;z1%l1;│%end;
      %end;
    %end;
  %in;
  %let;zl2;%sex;%in;
  %let;l231;%if;(is_male)━%elseif;(is_female)─%else;━%end;%in;
  <span>
    <span class="tt">z1%l2;</span>
    %( when there is an offset between implex generations, some descendants may be missing %)
    %( case: first occurence at generation n is married to generation n-1 spouse and has children %)
    %( these children will not appear even though asking for desc up to generation n %)
    %if;(not cancel_links)
      <a role="button" onclick="implexdesc('%index;')" title="[*implex/implexes]0"><i class="fa fa-shuffle fa-fw ml-1" aria-hidden="true"></i>%nn;
        <span class="sr-only"> (==)</span></a>
    %else;
      <i class="fa fa-shuffle fa-fw ml-1" aria-hidden="true"></i>%nn;
      <span class="sr-only"> (==)</span></a>
    %end;
  </span>
  <br>
%end;
%mark_descendants;
%empty_sorted_list;%( persons %)
%empty_sorted_listb;%( families %)
%empty_sorted_listc;%( descendants %)
%let;maxlvl;%if;(static_max_anc_level>4)4%else;%static_max_anc_level;%end;%in;
%if;(has_parents and evar.templ="")
  <div class="modal" id="switch_modal" tabindex="-1" aria-labelledby="switch-ancestor-modal" aria-hidden="true">
    <div class="modal-dialog modal-xl modal-dialog-scrollable">
      <div class="modal-content">
        <div class="modal-header align-self-center py-2">
          <h5 class="modal-title font-weight-bold" id="switch-ancestor-modal">[*choose an ancestor]</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body py-2">
          %reset_count2;
          %foreach;ancestor_level(maxlvl)
            %if;(level!=0)
              <div class="text-center font-weight-bold mb-2">%nn;
                %if;(level=1)[*parents]
                %elseif;(level=2)[*grand-parents]
                %elseif;(level=3)[*great-grand-parents]
                %elseif;(level=4)[*great-great-grandparents]
                %end;%nn;
              </div>
              %reset_count;
              %foreach;ancestor;
                %incr_count;
                %incr_count2;
                %if;(count%2!=0)
                  <div class="d-flex align-items-center mx-0">
                %end;
                <div class="col-6%if;(count%2!=0) pl-1 pr-0 mr-1%else; pl-0 pr-1 ml-1%end; mb-2">
                  <a role="button"
                    class="%if;(ancestor.first_name="?" and ancestor.surname="?") d-none border-0
                      %else;btn bg-gradient-success btn-outline-%if;(count2%4=1 or count2%4=2)primary%else;success%end; w-100 px-1 text-center%end;"
                    title="[*select] %ancestor" href="%prefix;%ancestor.access;%nn;
                    %foreach;env_binding;
                      %if;(env.key!="p" and env.key!="n" and env.key!="oc"
                       and env.key!="i" and env.key!="v" and env.key!="")
                        &%env.key=%env.val;%nn;
                      %end;
                    %end;%nn;
                    &v=%expr(evar.v+level)">%nn;
                    %if;(ancestor.first_name!="?" and ancestor.surname!="?")
                      %ancestor.first_name; %ancestor.surname;%if;(ancestor.dates!="") %ancestor.dates;%end;
                    %end;
                  </a>
                </div>
                %if;(count%2=0)
                  </div>
                %end;
              %end;
            %end;
          %end;
         %(<div class="text-center font-weight-bold mb-2">%if;(static_max_anc_level>5)+ %expr(static_max_anc_level-maxlvl-1) [generation/generations]1%end;</div>%)
        </div>
      </div>
    </div>
  </div>
%end;
<h3 class="ml-2">%nn;
  %let;slf;%if;(public_name!="")%public_name;%else;%first_name;%end; %surname; %dates%in;
  %if;(l_v=0)%slf;%else;
    %apply;a_of_b_gr_eq_lev%with;[*descendants]%and;%slf;<small class="font-weight-lighter text-muted"> %apply;togend(l_v)</small>%end;
  %end;
</h3>
<form id="filterbysurname" class="form-inline ml-2 d-none">
  <div class="form-row">
    <span class="form-control-sm">[*filter by][:]</span>%nn;
    %apply;input(1)%apply;input(2)%apply;input(3)%apply;input(4)%apply;input(5)
    <button id="btnplus" type="button" class="btn btn-primary btn-sm" title="[*add filter] (max 5)"><i class="fa fa-plus fa-fw"></i></button>
    <button id="btnclear" type="button" class="btn btn-danger btn-sm ml-1" title="[*clear filters]"><i class="fa fa-xmark fa-fw"></i></button>
  </div>
</form>
<div class="deslist">
  %if;(has_parents and evar.templ="" and not cancel_links)
    <div><a role="button" class="text-primary" data-toggle="modal" data-target="#switch_modal" title="[*extend]">  ^</a></div>
  %end;
  %apply;desc1(" 0",sex,"0","0","0",l_v+1,0)
</div>
%reset_count;
%foreach;sorted_list_item;
  %incr_count;
%end;
%if;(l_v>0)
  <div id="total" class="mt-2 ml-2" title="[unfiltered total]">[*total][:]
    %apply;desc_count(max_desc_level) [descendants] (%count; [person/persons]1 [with] [spouse/spouses]1)</div>
%end;
%base_trailer;
%include;copyr
</div>
%include;js
</body>
</html>
