{% extends "authentic2/base-page.html" %}
{% load i18n %}

{% block extra-body-class %}narrow-page{% endblock %}
{% block bodyargs %}onload="window.iframe_count -= 1"{% endblock %}

{% comment %}Initialize iframe countdown {% endcomment %}
{% block extra_scripts %}
  <script>
    window.iframe_count = 1;
  </script>
  {% endblock %}

  {% block content %}
<h2 class="single-title">Compte usager</h2>
<div id="welcome">

  <h3>{% trans message %}</h3>

  <ul class="logout-list">
      {% for fragment in logout_list %}
          {{ fragment|safe }}
      {% endfor %}
  </ul>
  <script>
    window.iframe_count += document.getElementsByTagName("iframe").length;
    var refresh_launched = 0;
    setInterval(function () {
      if (iframe_count == 0) {
        if (refresh_launched == 0) {
          refresh_launched = 1;
          setTimeout(function () { window.location = '{{ next_url }}' }, 300);
        }
      }
    }, {{ redir_timeout }})
  </script>

  <div id="continue-link">
    <a href="{{ next_url }}">{% trans "Continue logout" %}</a>
  </div>
</div>
{% endblock %}
