{% extends "templates/not_running.html" %}

{% block heading %}
  <h1>
    {% if failed %}
      Spawn failed
    {% else %}
      Session not running
    {% endif %}
  </h1>
{% endblock heading %}

{% block message %}
  <p>
    {% if failed %}
      The latest attempt to start your session {{ server_name }} has failed.
      {% if failed_html_message %}
      </p>
      <p>{{ failed_html_message | safe }}</p>
      <p>{% elif failed_message %}</p>
      <p>{{ failed_message }}</p>
      <p>
      {% endif %}
      Would you like to retry starting it?
    {% else %}
      Your session {{ server_name }} is not running.
      {% if implicit_spawn_seconds %}
        It will be restarted automatically.
        If you are not redirected in a few seconds,
        click below to launch your session.
      {% else %}
        Would you like to start it?
      {% endif %}
    {% endif %}
  </p>
{% endblock message %}

{% block start_button %}
  <a id="start"
     role="button"
     class="btn btn-lg btn-primary"
     href="{{ spawn_url }}">
    {% if failed %}
      Relaunch
    {% else %}
      Start new
    {% endif %}
    Session {{ server_name }}
  </a>
{% endblock start_button %}
