<!DOCTYPE html>
<html lang="%lang;">
<head>
  <!-- $Id: cousins.txt,v 5.9 2018/04/02 13:15:19 hg Exp $ -->
  <!-- Copyright (c) 1998-2017 INRIA -->
  <title>%nn;
    %first_name; %surname; %if;(occ!="0")(%occ;)%end;[:] [cousins]
  </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%if;(evar.wide="on")-fluid%end;">
%include;perso_utils
%include;menubar

%define;title(xxx)
  <h3>[*xxx]</h3>
  <div class="tips">
    <table><tr><td>[*select person to compute relationship]</td></tr></table>
  </div>
  <br />
%end;

%reset_count;
%if;(evar.v1=1 and evar.v2=1)
  %apply;title("siblings")
  %if;(has_parents)
    %let;my_father;%self.father;%in;
    %let;my_mother;%self.mother;%in;
    %let;my_first_name_key;%first_name_key;%in;
    %let;my_surname_key;%surname_key;%in;
    %if;father.has_children;
    <ul>
      %foreach;father.family;
        %if;(has_children and father.spouse = my_mother)
          <li>From %father; and %father.spouse;
            <ul>
              %foreach;child;
                %incr_count;
                <li>
                  %( what is the logic of b1 and b2 ?? sosa_of_branche? %)
                  <a href="%prefix;;m=RL&p1=%my_first_name_key;&n1=%my_surname_key;&b1=2%nn;
                    &p2=%child.first_name_key;&n2=%child.surname_key;&b2=2%nn;
                    %if;(evar.image="off")&image=off;%end;%nn;
                    %if;(evar.spouse!="")&spouse=%evar.spouse;%end;%nn;
                    %if;(evar.long!="")&long=%evar.long;%end;">
                    %(test if not self manqunt%)%child;</a>
              %end;
            </ul>
        %end;
      %end;
      %foreach;father.family;
        %if;(has_children and father.spouse != my_mother)
          <li>From %father; and %father.spouse;
            <ul>
              %foreach;child;
                %incr_count;
                <li>
                  <a href="%prefix;;m=RL&p1=%my_first_name_key;&n1=%my_surname_key;&b1=2%nn;
                    &p2=%child.first_name_key;&n2=%child.surname_key;&b2=2%nn;
                    %if;(evar.image="off")&image=off;%end;%nn;
                    %if;(evar.spouse!="")&spouse=%evar.spouse;%end;%nn;
                    %if;(evar.long!="")&long=%evar.long;%end;">
                    %child;</a>
              %end;
            </ul>
        %end;
      %end;
      </ul>
    %end;
    %if;mother.has_children;
    <ul>
      %foreach;mother.family;
        %if;(has_children and mother.spouse != my_father)
          <li>From %mother; and %mother.spouse;
            <ul>
              %foreach;child;
                %incr_count;
                <li>
                  <a href="%prefix;;m=RL&p1=%my_first_name_key;&n1=%my_surname_key;&b1=3%nn;
                    &p2=%child.first_name_key;&n2=%child.surname_key;&b2=3%nn;
                    %if;(evar.image="off")&image=off;%end;%nn;
                    %if;(evar.spouse!="")&spouse=%evar.spouse;%end;%nn;
                    %if;(evar.long!="")&long=%evar.long;%end;">
                %child;</a>
              %end;
            </ul>
        %end;
      %end;
    </ul>
    %end;
  %end;
%elseif;(evar.v1=0)
  %if;(evar.v2=0 or evar.v2="")
    %apply;title("self")
    <a href="%prefix;;m=RL&p1=%my_first_name_key;&n1=%my_surname_key;&b1=2%nn;
              &p2=%my_first_name_key;&n2=%my_surname_key;&b2=2%nn;
              %if;(evar.image="off")&image=off;%end;%nn;
              %if;(evar.spouse!="")&spouse=%evar.spouse;%end;%nn;
              %if;(evar.long!="")&long=%evar.long;%end;">%self;</a>
  %else;
    %if;(evar.v2=1)%apply;title("children")
    %elseif;(evar.v2=2)%apply;title("grandchildren")
    %elseif;(evar.v2=3)%apply;title("great-grandchildren")
    %elseif;(evar.v2=4)%apply;title("great-great-grandchildren")
    %else;
      %let;lev_dn;%evar.v2; generations below%in
      %apply;title(lev_dn)
    %end;
    descendants: tbd<br>
  %end;
%elseif;(evar.v2=0)
  %if;(evar.v1=1)%apply;title("parents")
  %elseif;(evar.v1=2)%apply;title("grandparents")
  %elseif;(evar.v1=3)%apply;title("great-grandparents")
  %elseif;(evar.v1=4)%apply;title("great-great-grandparents")
  %else;
    %let;lev_up;%evar.v1; generations above%in
    %apply;title(lev_up)
  %end;
  ascendants: tbd<br>
%else;
 Should not happen!!
%end;

<div class="my-3">Total[:] %count; %if;(count=1)[person/persons]0%else;[person/persons]1%end;.</div>

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