{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}

{% load bootstrap %}
{% load i18n %}
{% load static %}

{% block extra_content %}
  <h3>{% trans "Manual update" %}</h3>
  {% if is_busy %}
    <p>
      <button type="button" disabled="disabled"
              class="running-status-parent btn btn-default" >
        <span class="running-status loading"></span>
        {% trans "Updating..." %}
      </button>
    </p>
  {% else %}
    <p>
      <form class="form" method="post" action="{% url 'upgrades:upgrade' %}">
        {% csrf_token %}
        <input type="submit" class="btn btn-default"
               value="{% trans "Update now" %}"/>
      </form>
    </p>
  {% endif %}

  <p>
    {% blocktrans trimmed %}
      <strong>This may take a long time to complete.</strong> During an update,
      you cannot install apps. Also, this web interface may be temporarily
      unavailable and show an error. In that case, refresh the page to
      continue.
    {% endblocktrans %}
  </p>

  {% if log %}
    <p>
      <a class="btn btn-default collapsed collapsible-button" role="button"
         data-toggle="collapse" href="#collapse-log" aria-expanded="false"
         aria-controls="collapse-log">
        <span class="fa fa-chevron-right fa-fw" aria-hidden="true"></span>
        {% trans "Show recent update logs" %}
      </a>

      <div class="collapse" id="collapse-log">
        <pre>{{ log }}</pre>
      </div>
    </p>
  {% endif %}
{% endblock %}
