{% load i18n %}
<div class="card text-center m-4" style="min-width: 18rem; min-height: 18rem;">
    <div class="card-body ">
        <h5 class="card-title ">{% translate "Discord" %}</h5>
        <p class="card-text">{% if server_name %}{{ server_name }}{% else %}{% translate "Unlinked Server" %}{% endif %}</p>
        <p class="card-text"><span class="badge {% if user_has_account %}bg-success{% else %}bg-warning{% endif %}">{% if user_has_account %}{% translate "Active" %}{% else %}{% translate "Disabled" %}{% endif %}</span></p>
        <p class="card-text">
        {% if not user_has_account %}
            {% translate "(not activated)" %}
        {% else %}
            {{ discord_username }}
        {% endif %}
        </p>
    </div>
    <div class="card-footer">
        {% if not user_has_account %}
            <a href="{% url 'discord:activate' %}" title="{% translate 'Join the Discord server' %}" class="btn btn-primary">
                <span class="fas fa-check fa-fw"></span>
            </a>
        {% else %}
            <a href="{% url 'discord:reset' %}" title="{% translate 'Leave- and rejoin the Discord Server (Reset)' %}" class="btn btn-warning">
                <span class="fas fa-sync fa-fw"></span>
            </a>
            <a href="{% url 'discord:deactivate' %}" title="{% translate 'Leave the Discord server' %}" class="btn btn-danger">
                <span class="fas fa-times fa-fw"></span>
            </a>
        {% endif %}
        {% if request.user.is_superuser %}
            <a type="button" id="btnLinkDiscordServer" class="btn btn-primary" href="{% url 'discord:add_bot' %}">
                <span class="fas fa-link fa-fw"></span>
            </a>
        {% endif %}
    </div>
</div>
