<!DOCTYPE html>
{% set debug_flag = webenv.debugFlag %}
{% set statstr = webenv.statusStr %}
{% set my_url = webenv.req_url %}
<html>
  <head>
      <meta charset="UTF-8">
      <title>{% if 'awt' not in msgs.pagetitle.lower() %}{{msgs.pagetitle}} — (awt){% else %}{{msgs.pagetitle}}{% endif %}</title>
      {# Basic SEO description mirrors OG description #}
      {% if msgs.og_description %}
      <meta name="description" content="{{ msgs.og_description }}">
      {% endif %}
      {# Open Graph (for Facebook/Slack/Discord) #}
      <meta property="og:type" content="website">
      <meta property="og:title" content="{{ msgs.og_title or msgs.pagetitle }}">
      <meta property="og:description" content="{{ msgs.og_description or msgs.lede }}">
      <meta property="og:url" content="{{ webenv.base_url ~ webenv.pathportion }}">
      {% set default_og_image = webenv.base_url ~ '/preview-img/site/generic.png' %}
      {% set og_image_url = msgs.og_image or default_og_image %}
      <meta property="og:image" content="{{ og_image_url }}">
      {% set og_image_type = 'image/png' if '.png' in og_image_url else 'image/svg+xml' %}
      <meta property="og:image:type" content="{{ og_image_type }}">
      <link rel="stylesheet"
            type="text/css"
            href="{{ url_for('static', filename='css/electostyle.css') }}">
      <link rel="shortcut icon"
            href="{{ url_for('static', filename='img/awtonly.svg') }}">
      <script src="{{ url_for('static', filename='js/abifwebtool.js') }}" defer></script>
  </head>
  <body>
    <header>
      <a href="/">
        <img src="/static/img/awt-electorama.svg" alt="awt logo">
      </a>
    </header>
    <div id="content">
      <h1>{{msgs.pagetitle}}</h1>
      {% if webenv.debugFlag %}
      <div class="hatnote">(<a href="#debug">Debug output</a>)</div>
      <small><i>{{webenv.req_url}} {{webenv.hostname}}</i></small>
      (see <a href="#debug">debug output below</a>)<br>
      {% endif %}
      {% block introduction %}
      {% if webenv.toppage == 'edit' %}
      {% include 'intro-snippet.html' %}
      {% endif %}
      {% endblock introduction %}
      {% block content %}
      {########### vvvv THIS GETS REPLACED vvvv #########}
      <h1>THIS OUTPUT SHOULD BE OVERRIDEN BY A JINJA SUBTEMPLATE</h1>
      {########### ^^^^ THIS GETS REPLACED ^^^^ #########}
      {% endblock content %}
      {% if webenv.debugFlag %}
      <h2 id="debug">Debug output</h2>
      <div class="hatnote">from {{webenv.hostname}} for
        <a href="{{webenv.req_url}}">{{webenv.req_url}}</a></div>
      <pre>{{ debug_output }}</pre>
      <code>resblob</code> var:
      <pre>{{ resblob|pprint}}</pre>
      <code>msgs</code> var:
      <pre>{{ msgs|pprint}}</pre>
      <code>webenv</code> var:
      <pre>{{ webenv|pprint }}</pre>
      {% endif %}
      <hr>
      {% include 'footer.snippet.html' %}
    </div>
  </body>
</html>
