%nn; %if;(e.t = "F")- [*surnames branch] -%nn; %else; %apply;a_of_b%with; %if;(e.t = "M")[*missing ancestors]%else;[*ancestor/ancestors]1%end; %and; %if;(public_name != "")%public_name;%else;%first_name;%end; %if;(qualifier != "") %qualifier;%end; %sp;%surname; %end; %end;

%include;css %include;hed %message_to_wizard;
%include;perso_utils %if;not cancel_links; %include;menubar %include;buttons %end; %let;lvl; %if;(b.max_anc_level = "")%apply;min(e.v, max_anc_level, 7) %else;%apply;min(e.v, max_anc_level, b.max_anc_level)%end; %in;

### %nn; %if;(e.t = "F") %apply;a_of_b%with;[*surnames branch]%and; %if;(public_name != "")%public_name;%else;%first_name;%end; %if;(qualifier != "") %qualifier;%end; %sp;%surname; %if;(alias != "") (%alias;)%end;
%end; %elseif;(e.t = "E") %apply;a_of_b%with;[*list eclair]%and; %if;(public_name != "")%public_name;%else;%first_name;%end; %if;(qualifier != "") %qualifier;%end; %sp;%surname; %end; %else; %apply;a_of_b%with;[*ancestor/ancestors]1%and; %if;(public_name!="")%public_name;%else;%first_name;%end; %surname; %end; %if;(e.t="D")[up to] %pvar.1; %end; %end;%nn; %if;(e.t="H" or e.t="F" or e.t="E") %apply;togena(lvl)%end;

%( implex count %) %if;(has_parents) %reset_count; %foreach;ancestor_level %if;(e.v!="" and level<=e.v) %foreach;ancestor %if;(ancestor.same != "")%incr_count;%end; %end; %end; %end; %end; %let;implex_cnt;%count;%in; %define;ancestors_by_list(xx, nnn) %if;(xx.has_parents and nnn > 0)

- %xx.father;%xx.father.title;%xx.father.dates;%nl; %apply;ancestors_by_list("xx.father", nnn - 1)
- %xx.mother;%xx.mother.title;%xx.mother.dates;%nl; %apply;ancestors_by_list("xx.mother", nnn - 1)

%end; %end; %define;anc_row_hr(pp, vv, zz, ss1, ss2, ss3) %if;(vv>=0) %if;(pp.has_parents or (pp.sosa.v!=zz and e.same!="")) %apply;anc_row_hr("pp.father", vv-1, zz*2, "ss1 ", "ss1 ┌──╴", "ss1 | ") %end; ss2%nn; %nn; %if;(not cancel_links)%pp;%nn; %else;%pp;%end;%pp.title;%pp.dates;%nn; %if;(pp.sosa.v!="" and pp.sosa.v!=zz) %if;(not cancel_links) %end; (==) %if;(not cancel_links)%end; %end;
%if;(pp.has_parents or (e.same!="" and pp.sosa.v!=zz)) %apply;anc_row_hr("pp.mother", vv-1, zz*2+1, "ss3 | ", "ss3 └──╴", "ss3 ") %end; %end; %end; %define;input(xx) Filtre xx %end; %define;iz(i)%url_set_pz.i;%end; %define;pnocz(pp,nn,oo)%url_set_pz.pp.nn.oo;%end; %define;definecujus(pp,nn) %if;(nn=0)[*define Cujus:::pp]0%elseif;(nn=1)[*define Cujus:::pp]1%end; %end; %if;(e.v="" and e.v=0) [*specify::generation/generations]0. %else; %if;(e.t="L") %( by list %)

%apply;togena(lvl).

%apply;ancestors_by_list("self", lvl) %elseif;(e.t="H") %( horizontal ascendency %)
[*filter by][:]%nn; %apply;input(1)%apply;input(2)%apply;input(3)%apply;input(4)%apply;input(5)
%let;sosa_v;%if;(sosa.v!="")%sosa.v;%else;1%end;%in; %if;((e.same="" or e.same=0) and self=sosa_ref) %apply;anc_row_hr("self", lvl, 1, " ", "──╴", " ") %else; %apply;anc_row_hr("self", lvl, sosa_v, " ", "──╴", " ") %end;
%let;pnocz_old;%if;(e.iz!="")izb=%e.iz;%elseif;(e.pz!="" or e.nz!="")pzb=%e.pz;&nzb=%e.nz;%if;(e.ocz!="" and e.ocz!="0")&oczb=%e.ocz;%end;%end;%in; %if;(not cancel_links) %if;(implex_cnt>0 and not (e.iz=index or self=sosa_ref)) %nn; %apply;definecujus(self,0) %end; %if;(e.same!="" and (e.izb!="" or (e.pzb!="" and e.nzb!=""))) %apply;definecujus%with;%apply;capitalize(e.pzb) %apply;capitalize(e.nzb)%(TODO get name form e.izb%)%and;1%end; %end; %end; %elseif;(e.t="E") %( list eclair by alphabetic/place/date/ind/event order %) %empty_sorted_list; %foreach;ancestor_surname(e.v) %apply;add_in_sorted_list%with; %if;(e.sort="ind") -%ancestor.nb_ind; %elseif;(e.sort="evt") -%ancestor.nb_events; %elseif;(e.sort="plc") %ancestor.place; %elseif;(e.sort="date") %ancestor.date_begin.year; %else;%ancestor.surname_end; %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;
%if;(not cancel_links)
[*sort by/date begin/alphabetic order/nb individuals/nb events]0 [sort by/date begin/alphabetic order/nb individuals/nb events]2 [places] [sort by/date begin/alphabetic order/nb individuals/nb events]1 [sort by/date begin/alphabetic order/nb individuals/nb events]3 [sort by/date begin/alphabetic order/nb individuals/nb events]4
%end;

[*surname/surnames]0 | [*place] | [*date begin] | [*date end] | #[*person/persons]1 | #[*event/events]1
--- | --- | --- | --- | --- | ---
%foreach;sorted_list_item;
%item.2;%item.3 | %item.4; | %if;(item.5 = "<") /%item.6; %elseif;(item.5 = ">") %item.6;/ %elseif;(item.5 = "|" or item.5 = "..") %item.6; %else; %item.5;%item.6; %end; | %if;(item.7 = "<") /%item.7; %elseif;(item.7 = ">") %item.8;/ %elseif;(item.7 = "|" or item.7 = "..") %item.8; %else; %item.7;%item.8; %end; | %item.9; | %item.10;
%end;

%elseif;(e.t="F" and e.sort="on") %( surnames branch sorted by number of branches %) %empty_sorted_list; %reset_count; %foreach;ancestor_surname(e.v) %incr_count; %let;neg_ancestor_nb_times;%expr(0-ancestor.nb_times)%in; %apply;add_in_sorted_list( neg_ancestor_nb_times, 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(e.v, max_anc_level)%in; %if;(count > 100)

[*number of branches] : %foreach;sorted_list_item; %if;(prev_item.2 != item.2) %item.2; %end; %end;

%end;

[*help surname branch].

%if;(not cancel_links)

[*sort by/branch/alphabetic order]0 |  | [sort by/branch/alphabetic order]1 |  | [sort by/branch/alphabetic order]2

%end;

%if;(count <= 100)
- %nn;

  [*surname/surnames]0 | [*nb branches] | [*place] | [*date/dates]0
  --- | --- | --- | ---
  %end; %foreach;sorted_list_item; %if;(prev_item.2 != item.2 and count > 100)

- %nn; %item.2;

  [*surname/surnames]0 | [*nb branches] | [*place] | [*date/dates]0
  --- | --- | --- | ---
  %end;
  %item.3;%item.4; | %if;(e.cgl != "on") %item.2; %else; %item.2; %end; | %item.6; | %if;(item.7 = "<") /%item.8; %elseif;(item.7 = ">") %item.8;/ %elseif;(item.7 = "|" or item.7 = "..") %item.8; %else; %item.7;%item.8; %end;%nn; -%nn; %if;(item.9 = "<") /%item.10; %elseif;(item.9 = ">") %item.10;/ %elseif;(item.9 = "|" or item.9 = "..") %item.10; %else; %item.9;%item.10; %end;
  %if;(item.2 != next_item.2 and count > 100)

%end; %end; %if;(count <= 100) %end;

%elseif;(e.t="F") %( surnames branch %) %let;nb_gen;%apply;min(e.v, max_anc_level)%in;

[*help surname branch].

%if;(not cancel_links)

[*sort by/branch/alphabetic order]0 |  | [sort by/branch/alphabetic order]1 |  | [sort by/branch/alphabetic order]2

%end;

[*surname/surnames]0 | [*nb branches] | [*place] | [*date/dates]0
--- | --- | --- | ---
%foreach;ancestor_surname(e.v)
%ancestor.surname_end;%ancestor.surname_begin; | %if;(e.cgl != "on") %ancestor.nb_times; %else; %ancestor.nb_times; %end; | %ancestor.place; | %if;(ancestor.date_begin.prec = "<") /%ancestor.date_begin.year;%nn; %elseif;(ancestor.date_begin.prec = ">") %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 = "<") /%ancestor.date_end.year;%nn; %elseif;(ancestor.date_end.prec = ">") %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;
%end;

%end; %end; %base_trailer; %include;copyr
%include;js