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

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

{% block url %}
    <a href="{{ service_url }}">{{ service_url }}</a>
{% endblock %}

{% block active %}
    <span class="badge {% if username != '' %}bg-success{% else %}bg-warning{% endif %}">{% if username != '' %}Active{% else %}Disabled{% endif %}</span>
{% endblock %}

{% block user %}
    Username: <span class="badge bg-secondary">{{ username }}</span>
{% endblock %}

{% block controls %}
    {% if username == "" %}
        {% if urls.auth_activate %}
        <a href="{% url urls.auth_activate %}" title="Activate" class="btn btn-warning">
            <span class="fas fa-check fa-fw"></span>
        </a>
        {% endif %}
    {% else %}
        {% if urls.auth_set_password %}
        <a href="{% url urls.auth_set_password %}" title="Set Password" class="btn btn-warning">
            <span class="fas fa-edit fa-fw"></span>
        </a>
        {% endif %}
        {% if urls.auth_reset_password %}
        <a href="{% url urls.auth_reset_password %}" title="Reset Password" class="btn btn-primary">
            <span class="fas fa-sync fa-fw"></span>
        </a>
        {% endif %}
        {% if urls.auth_deactivate %}
        <a href="{% url urls.auth_deactivate %}" title="Deactivate" class="btn btn-danger">
            <span class="fas fa-times fa-fw"></span>
        </a>
        {% endif %}
    {% endif %}
{% endblock %}
