<!-- prettier-disable -->
[%#
   # This helper should be included in files which will be served as
   # top-level responses (i.e. documents on their own); this includes
   # UI/login.html, UI/logout.html, UI/main.html and various UI/setup/ pages

   # Most LedgerSMB responses are handled by the 'xhr' Dojo module, which
   # *only* needs opening and closing BODY tags to be there (for now).
   #
   # Note: To keep some comments as is and control pre or post white space
   #       chomping, we make use of '+' or '-' beside the introducers in
   #       comments like this one.
-%]
<!DOCTYPE html>
<html lang="[% USER.language %]">
<head>
    <title>[% title %]</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    [%-#
        # source comment only!
        #
        # don't specify a title on the stylesheets: we want them to be
        # *persistent*
        # http://www.w3.org/TR/html401/present/styles.html#h-14.3.1
    -%]
    <%= htmlWebpackPlugin.tags.headTags %>
    <link href="js/dojo/resources/dojo.css" rel="stylesheet">
    <link href="js/css/[% dojo_theme %].css" rel="stylesheet">
    [%- IF stylesheet %]
    <link href="js/css/[% stylesheet %]" rel="stylesheet">
    [%- END %]
    [%- FOREACH s = include_stylesheet %]
    <link href="js/css/[% s %]" rel="stylesheet">
    [%- END %]
    [%- IF warn_expire;
       IF pw_expires.years ;
          ALERT = text("Warning: Your password will expire in [_1] years", pw_expires.years);
       ELSIF pw_expires.months ;
          ALERT = text("Warning: Your password will expire in [_1] months", pw_expires.months);
       ELSIF pw_expires.weeks ;
          ALERT = text("Warning: Your password will expire in [_1] weeks", pw_expires.weeks);
       ELSIF pw_expires.days ;
          ALERT = text("Warning: Your password will expire in [_1] days", pw_expires.days);
       ELSE ;
          ALERT = text("Warning: Your password will expire today");
       END;
    %]
    <script>
      let h;
      h = () => {
          window.removeEventListener('DOMContentLoaded', h);
          window.alert("[% ALERT %]");
      };
      window.addEventListener('DOMContentLoaded', h);
    </script>
    [% END %]
    <script>
        var dojoConfig = {
            async: 1,
            parseOnLoad: false,
            locale: "[% USER.language %]",
            packages: [{"name":"lsmb","location":"../lsmb"}],
            mode: "<%= htmlWebpackPlugin.options.mode %>"
        };
        var lsmbConfig = {
            company: "[% company %]",
            language: "[% USER.language %]",
            login: "[% login %]",
            [% IF USER.dateformat %]
            "dateformat": '[% USER.dateformat %]',
            [% END %]
            version: "[% version %]"
        };
    </script>
    <meta name="robots" content="noindex,nofollow" />
</head>
[% content %]
</html>
