<!--  Union evolue -->

%(
  Copie des fonctions qui se trouvent dans perso.txt dont la SEULE
  modification est que la phrase NE commence PAS par une majuscule.
%)

%define;loc_married_to(sexx, date)
  %if;(sexx = 0 or sexx = 2)
    %if;are_married;[married%t to:::date]0%nn;
    %elseif;are_not_married;[relationship%t to:::date]0%nn;
    %elseif;are_engaged;[engaged%t to:::date]0%nn;
    %elseif;is_no_sexes_check;[relationship%t to:::date]0%nn;
    %elseif;is_no_mention;date [with]%nn;
    %end;
  %else;
    %if;are_married;[married%t to:::date]1%nn;
    %elseif;are_not_married;[relationship%t to:::date]1%nn;
    %elseif;are_engaged;[engaged%t to:::date]1%nn;
    %elseif;is_no_sexes_check;[relationship%t to:::date]1%nn;
    %elseif;is_no_mention;date [with]%nn;
    %end;
  %end;
%end;

%define;loc_long_married(xx)
  %apply;loc_married_to%with;%xx.sex%and;
    %if;(on_marriage_date = "")
    %else; <em>%on_marriage_date;
      %if;wedding_birthday; ([happy birthday to them!])%end;
      </em>
    %end;
  %end;
%end;


%if;has_families;
  <h3 class="highlight">[*marriage/marriages]1 %if;has_children; [and::child/children]1%end;</h3>
  <ul class="marriage_perso">
    %( On remet les compteurs à zéro et on commence à compter à 1 %)
    %reset_count; %incr_count;
    %foreach;family;
      %apply;li_SD("spouse")
        %if;(wizard)
          <a href="%prefix;m=MOD_FAM;i=%family.index;;ip=%index;">
            <img src="%image_prefix;/picto_molette.png" width="13" height="13" alt="[modify]" title="[modify::family/families]0"%/>%nn;
          </a>
        %end;
        %apply;long_married("self")%sp;
        %apply;short_display_person("spouse")%sp;
        %if;spouse.has_parents;
          <span style="font-size: 90%%"><em> ([*parents] :
            %apply;short_display_person("spouse.father")
            &nbsp;&amp;&nbsp;
            %apply;short_display_person("spouse.mother"))</em>%nn;
          </span>
        %end;
        %if;has_witnesses;
          &nbsp;([witness/witnesses]w :
          %foreach;witness;
            %if;not is_first;, %end;
            %apply;short_display_person("witness")%nl;
          %end;)
        %end;
        %if;((wizard or friend or bvar.no_note_for_visitor="" or bvar.no_note_for_visitor="no") and has_comment) 
          ([see] <a href="#note-wed-%count;" name="wed-note-%count;" id="wed-note-%count;">[note/notes]0</a>)
          %incr_count;
        %end;
        %if;are_divorced;, [divorced]0%divorce_date;%sp;%end;
        %if;are_separated;, [separated]0%sp;%end;
        %if;has_children;[having as children]0
          %( On sauvegarde l'ancienne valeur de count %)
          %let;prev_count;%count;%in;
          <ul>
            %foreach;child;
              %apply;li_SDC("child")
                %apply;image_MF("child","13")
                %apply;short_display_person("child")
                %if;child.has_families;
                  %foreach;child.family;
                    %if;(family_cnt!=1)
                      <img width="13" height="13"%sp; src="%image_prefix;/1pixel.png"  alt=""%/>%sp;
                      <em>%child;%child.title;%child.dates;</em>
                    %end;%sp;
                    %sp;%apply;loc_long_married("child")%sp;
                    %apply;short_display_person("spouse")<br%/>
                  %end;
                %end;
              </li>
            %end;
          </ul>
          %( On rétablie l'ancienne valeur de count %)
          %apply;init_count(prev_count)
        %end;
        %if;(evar.opt = "from" and wizard)<em>(%origin_file;)</em><br%/>%nl;%end;
      </li>
    %end;
  </ul>
%end;
