<!-- $Id: modules/individu.txt v 7.00 07/05/2018 07:54:32 hg -->
%( options
0: skip
1: standard
2: centered
3: two columns
%)
%let;op_m;%if;(op_m!="")%op_m;%else;1%end;%in;

%define;link(xxx,zzz)
  %if;(not cancel_links)<a href="%prefix;m=zzz;v=%sq;
    %if;("xxx"=first_name)%first_name_key;%sq;
    %elseif;("xxx"=surname)%surname_key;%sq;
    %( how to get (first/sur)_name_alias_keys? %)
    %else;xxx%sq;
    %end;">%sq;
  %end;xxx%if;(not cancel_links)</a>%end;
%end;

%define;detailed_names()
  %if;(has_qualifiers or has_aliases or has_nobility_titles or
       has_public_name or has_surnames_aliases or has_first_names_aliases or
       has_linked_page.HEAD or computable_death_age or computable_age)
    %foreach;qualifier;
      %if;not is_first;
        %if;has_public_name;%public_name; %qualifier;
        %else;%first_name; %qualifier;%end;<br>
      %end;
    %end;
    %if;(has_public_name or has_qualifiers)
      <span class="font-weight-bold">%apply;link(first_name,"P") %apply;link(surname,"N")</span><br>
    %end;
    %if;has_aliases;
      Alias%sp;
      %apply;lazy_print("")
      %foreach;alias;
        %if;(lazy_printed)/%end;
        %lazy_force;
        <b>%alias;</b>%nn;
      %end;
      <br>
    %end;
    %if;has_nobility_titles;
      <em>%nn;
      %foreach;nobility_title;%nn;
       %if;not is_first;,%sp;%end;
        %nobility_title;%nn;
      %end;
      </em><br>
    %end;
    %if;(has_linked_page.HEAD and linked_page.HEAD!="")%linked_page.HEAD;<br>%end;
    %if;has_first_names_aliases;
      %apply;lazy_print("")
      %apply;link(first_name,"P")/%sq;
      %foreach;first_name_alias;
        %if;(lazy_printed)/%end;
        %lazy_force;
        %apply;link(first_name_alias,"P")
      %end;
      <br>
    %end;
    %if;has_surnames_aliases;
      %apply;lazy_print("")
      %apply;link(surname,"N")/%sq;
      %foreach;surname_alias;
        %if;(lazy_printed)/%end;
        %lazy_force;
        %apply;link(surname_alias,"N")
      %end;
      <br>
    %end;
    %if;(is_dead and computable_death_age)[*age at death][:] %death_age%end;
    %if;(not is_dead and computable_age)[*age][:] %age;%end;
  %end;
%end;

%define;etat_civil()
  <ul>
    %if;has_birth_date;
      <li>%apply;capitalize(nth([born],sex)) %on_birth_date;
      %if;birthday; ([happy birthday to you!])%end;
      %if;has_birth_place; - %birth_place;%end;</li>%nl;
    %else;
      %if;has_birth_place;
        <li>%apply;capitalize(nth([born],sex)) - %birth_place;</li>%nl;
      %end;
    %end;
    %if;has_baptism_date;
      <li>%apply;capitalize(nth([baptized],sex)) %on_baptism_date;
      %if;has_baptism_place; - %baptism_place;%end;</li>%nl;
    %else;
      %if;has_baptism_place;
        <li>%apply;capitalize(nth([baptized],sex)) - %baptism_place;</li>%nl;
      %end;
    %end;
    %if;is_dead;
      <li>%apply;capitalize(died)
      %if;has_death_date; %on_death_date;%end;
      %if;has_death_place; - %death_place;%end;
      %if;(has_linked_page.DEATH and linked_page.DEATH!="") (%linked_page.DEATH;)%end;</li>%nl;
    %end;
    %if;is_buried;
      <li>%apply;capitalize(nth([buried],sex))
      %if;has_burial_date; %on_burial_date;%end;
      %if;has_burial_place; - %burial_place;%end;</li>%nl;
    %end;
    %if;is_cremated;
      <li>%apply;capitalize(nth([cremated],sex))
      %if;has_cremation_date; %on_cremation_date;%end;
      %if;has_cremation_place; - %cremation_place;%end;</li>%nl;
    %end;
    %if;has_occupation;
      <li>%apply;capitalize(occupation)</li>%nl;
    %end;
    %if;(has_linked_page.OCCU and linked_page.OCCU!="")
      <li>%apply;capitalize(linked_page.OCCU)</li>%nl;
    %end;
    %if;(has_consanguinity and bvar.show_consang!="no")
      %if;(cancel_links)
        <li>[*consanguinity][:] %consanguinity;</li>%nl;
      %else;
        <li><a href="%prefix;m=NG;em=R;et=A;ei=%mother.index;;select=%father.index;;spouse=on%if;(evar.image!="");image=%evar.image;%end;"
           title="[*relationship computing] [father/mother]0/[father/mother]1">[*consanguinity][:] %consanguinity;</a></li>
      %end;
    %end;
  </ul>
%end;

%define;portrait()
  %if;(has_image or bvar.default_image="yes")
    %if;has_image;
      %if;(evar.cgl!="on") 
        <a href="%image_url;" target="_blank">
          <img src="%image_url;"%image_size; class="%if;(op_m=3)align-self-center mx-1%end; rounded" alt="[image/images]0"%/>%nn;
        </a>%nn;
      %else;
        <img src="%image_url;"%image_size; class="%if;(op_m=3)align-self-center mx-1%end; rounded" alt="[image/images]0"%/>%nn;
      %end;
    %elseif;(bvar.default_image="yes")
      <img class="%if;(op_m=3)d-flex align-self-center mx-1%end; rounded" src="%image_prefix;/img_unknown_%if;(is_female)wo%elseif;(is_male)%else;u_%end;man.png"%image_size; alt="[missing image]"%/>
    %end;
  %end;
%end;

%define;sosa()
  %reset_count;
  %if;(has_sosa and not cancel_links)
    <div class="%if;(op_m=2 or op_m=3)text-center%end;">
      <i class="fa fa-dot-circle-o text-success mr-1"></i>%nn;
      [*Sosa]
      %if;(sosa=1)%sosa;
      %else;<a href="%prefix;%sosa_link;">%sosa;</a> %apply;a_of_b%with;%and;
        %if;(sosa_ref.is_restricted)%sosa_ref;%else;<a href="%prefix;%sosa_ref.access;">%sosa_ref;</a>%end;%end;
      %end;
    </div>
  %end;
%end;

%define;border()
  <div class="w-50 border border-dark border-left-0 border-top-0 border-bottom-0">&#8203;</div>
%end;

%let;evm;%if;(evar.m="F")m=F;%end;%in;
%let;prefx;%if;(evar.m="F")%prefix_no_pmod;%else;%prefix;%end;%in;
%if;(evar.m!="MOD_IND")
  <div class="col-12">
  <h1 class="%if;(op_m=2)text-center%else;text-xs-center text-md-left%end;">
    %if;has_public_name;
      %if;has_qualifiers;%public_name; <em>%qualifier;</em>
      %else;%public_name; %surname;%end;
    %else;
      %if;has_qualifiers;%first_name; <em>%qualifier;</em>
      %else;
        %if;cancel_links;%first_name; %surname;
        %else;
          <a href="%prefix;m=P;v=%first_name_key;#i%index;">%first_name;</a>
          <a href="%prefix;m=N;v=%surname_key;#i%index;">%surname;</a>
        %end;
      %end;
    %end;
    <span class="font-weight-light small">%dates;</span>
  </h1>
  </div> %( closing div just before h1 %)

  %if;((p_mod="zz" or p_mod="") and evar.m!="F")<div class="col-12%if;(evar.wide!="on") col-lg-8%end;">
  %end;
  %if;(op_m=1)
    %apply;portrait()
    %apply;etat_civil()
    <div class="text-center mb-2 mx-2">
      %apply;sosa()
    </div>
    <div class="mt-2 mb-1 ml-2">
      %apply;detailed_names()
    </div>
  
  %elseif;(op_m=2)
    <div class="col-12 text-center mb-2 mx-2">
      %apply;portrait()
      %apply;sosa()
    </div>
    <div class="col-12 text-center mb-2 mx-2">
      %apply;detailed_names()
    </div>
    %apply;etat_civil()
  
  %elseif;(op_m=3)
    <div class="d-flex">
      %apply;portrait()
      <div>
        <div class="text-center mb-2 mx-2">
          %apply;detailed_names()
          %apply;sosa()
        </div>
        %apply;etat_civil()
      </div>
    </div>
  %else;
  Unavailambe option value!
  %end;
%end;
