{% extends "services/services_ctrl_base.html" %}

{% load i18n %}

{% block title %}
    {{ service_name }}
{% endblock %}

{% block url %}
    {% if username != '' %}
        <a href="mumble://{{ connect_url }}">{{ service_url }}</a>
    {% endif %}
{% endblock %}

{% block user %}
    {% include "services/service_username.html" with username=username %}
{% endblock %}

{% block controls %}
    {% if username == "" %}
        {% if urls.auth_activate %}
            <a class="btn btn-warning" href="{% url urls.auth_activate %}" title="{% translate 'Activate' %}">
                <i class="fa-solid fa-check fa-fw"></i>
            </a>
        {% endif %}
    {% else %}
        {% if urls.auth_set_password %}
            <a class="btn btn-warning" href="{% url urls.auth_set_password %}" title="{% translate 'Set Password' %}">
                <i class="fa-solid fa-pen-to-square fa-fw"></i>
            </a>
        {% endif %}

        {% if urls.auth_reset_password %}
            <a class="btn btn-primary" href="{% url urls.auth_reset_password %}" title="{% translate 'Reset Password' %}">
                <i class="fa-solid fa-rotate fa-fw"></i>
            </a>
        {% endif %}

        {% if urls.auth_deactivate %}
            <a class="btn btn-danger" href="{% url urls.auth_deactivate %}" title="{% translate 'Deactivate' %}">
                <i class="fa-solid fa-xmark fa-fw"></i>
            </a>
        {% endif %}

        {% if connect_url %}
            <a class="btn btn-success" href="mumble://{{ connect_url }}" title="{% translate 'Connect' %}">
                <i class="fa-solid fa-arrow-right fa-fw"></i>
            </a>
        {% endif %}
    {% endif %}
    {% if perms.mumble.view_connection_history %}
        <a class="btn btn-primary" type="button" id="btnMumbleConnectionHistory" href="{% url 'mumble:connection_history' %}" title="{% translate 'Mumble Connection History' %}">
            <i class="fa-solid fa-clock-rotate-left"></i> History
        </a>
    {% endif %}
{% endblock %}
