{% extends "base.html" %}
{% load i18n %}
{% load translations %}
{% load static %}

{% block extra_script %}
{% if support.name != 'community' %}
<script id="zammad_form_script" defer data-cfasync="false" src="https://care.weblate.org/assets/form/form.js"></script>
<script defer data-cfasync="false" src="{% static 'zammad.js' %}{{ cache_param }}"></script>
{% endif %}
{% endblock %}

{% block breadcrumbs %}
<li><a href="{% url 'manage' %}">{% trans "Manage" %}</a></li>
{% endblock %}

{% block content %}

<div class="panel panel-default">
<div class="panel-heading">
  <h4 class="panel-title">
    {% documentation_icon 'admin/support' right=True %}
    {% trans "Weblate support status" %}
  </h4>
</div>
  <table class="table table-condensed table-striped">
  <tr>
  <th>{% trans "Weblate version" %}</th>
  <td>
    {% if git_revision %}
      {{ version }} — <a href="{{ git_revision_link }}">{{ git_revision }}</a>
    {% elif git_revision_link %}
      <a href="{{ git_revision_link }}">{{ version }}</a>
    {% else %}
      {{ version }}
    {% endif %}
  </td>
  </tr>
  <tr>
  <th>{% trans "Support status" %}</th>
  <td>
    {{ support.get_verbose }}
    {% if not support.in_limits %}
    <div class="alert alert-danger" role="alert">
    {% trans "Exceeding service limits" %}
    </div>
    {% endif %}
  </td>
  </tr>
  {% if support.expiry %}
  <tr>
  <th>{% trans "Support expiry" %}</th>
  <td>{{ support.expiry|naturaltime }}</td>
  </tr>
  {% endif %}
  {% if support.secret %}
  <tr>
  <th>{% trans "Discover Weblate" %}</th>
  <td>
    <a href="https://weblate.org/discover/" class="btn-inline pull-right flip">{% trans "Browse discovery" %}</a>
    {% if support.discoverable %}
      {% trans "Your Weblate is listed on weblate.org" %}
      <br />
      <a href="{% url 'manage-discovery' %}" class="btn btn-primary link-post">{% trans "Disable discovery" %}</a>
      <a href="https://weblate.org/user/" class="btn btn-primary">{% trans "Manage your listing" %}</a>
    {% else %}
      {% trans "Your Weblate is not listed on weblate.org" %}
      <br />
      <a href="{% url 'manage-discovery' %}" class="btn btn-primary link-post">{% trans "Enable discovery" %}</a>
    {% endif %}
  </td>
  </tr>
  {% endif %}
  </table>
  <div class="panel-footer">
  {% if support.secret %}
  <a href="https://weblate.org/user/" class="btn btn-primary">{% trans "Manage support package" %}</a>
  {% endif %}
  {% if support.name == 'community' %}
  <a href="https://weblate.org/support/" class="btn btn-primary">{% trans "Purchase support package" %}</a>
  <a href="https://weblate.org/donate/" class="btn btn-primary">{% trans "Donate to Weblate" %}</a>
  {% else %}
  <a href="mailto:support@weblate.org" id="support-form" data-fullname="{{ user.full_name }}" data-email="{{ user.email }}" class="btn btn-primary">{% trans "Get help" %}</a>
  {% endif %}
  </div>
</div>

{% include "manage/snippets/activation-form.html" %}

{% endblock %}
