{% load i18n %}

{% if msg_code == 200 %}
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Success!" %}</h4>

        <p>&#9642; {% translate "FAT Link Created!" %}</p>
        <p>&#9642; {% translate "FATs have been queued, they may take a few mins to show up." %}</p>
        <p>&#9642; {% translate "Pilots who join later will be automatically added until you close or leave the fleet in-game." %}</p>
    </div>
{% elif msg_code == 0 %}
    <div class="alert alert-danger alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Oh No!" %}</h4>

        <p>{% translate "Something went wrong!" %}</p>
    </div>
{% elif msg_code == 202 %}
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Success!" %}</h4>

        <p>&#9642; {% translate "Clickable FAT Link Created!" %}</p>
        <p>&#9642; {% translate "Make sure to give your fleet members the following link to click so that they get credit for this fleet." %}</p>

        {% if link_ongoing %}
            <p>
                &#9642; {% translate 'Link' %}:
                <i>
                    {{ request.scheme }}://{{ request.get_host }}{% url 'afat:link_click' link.hash %}
                    <a class="label label-success copy-link" href="{% url 'afat:link_click' link.hash %}"></a>
                </i>

                <button class="copy-btn btn btn-success btn-sm"
                        data-toggle="tooltip"
                        data-html="true"
                        title="Copied!"
                        data-clipboard-text="{{ request.scheme }}://{{ request.get_host }}{% url 'afat:link_click' link.hash %}"
                        style="margin-left: 1rem; background-color: rgba(255,255,255,0.3);"
                >
                    {% translate 'Copy me!' %}
                </button>
            </p>
        {% endif %}
    </div>
{% elif msg_code == 1 %}
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Success!" %}</h4>

        <p>{% translate "Fleet name successfully changed." %}</p>
    </div>
{% elif msg_code == 3 %}
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Success!" %}</h4>

        <p>{% translate "Manual FAT processed." %}</p>
    </div>
{% elif msg_code == 4 %}
    <div class="alert alert-danger alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>

        <h4>{% translate "Oh No!" %}</h4>

        <p>{% translate "Manual FAT processing failed! The character name you entered was not found." %}</p>
    </div>
{% elif msg_code == 999 %}
    <div class="alert alert-{{ message.0 }} alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="close">
            <span aria-hidden="true">&times</span>
        </button>
        <h4>
            {% if msg.0 == 'danger' %}
                {% translate "Oh No!" %}
            {% elif msg.0 == 'success' %}
                {% translate "Success!" %}
            {% endif %}
        </h4>
        <p>{{ message.1 }}</p>
    </div>
{% endif %}
