{% extends "orga/base.html" %}
{% load i18n %}

{% block content %}
<h2>{% if request.event.is_public %}{% trans "Deactivate event" %}{% else %}{% trans "Go live" %}{% endif %}</h2>

{% if request.event.is_public %}
    {% blocktrans trimmed %}
    Your event is currently live and publicly visible.
    If you take it down, it will only be visible to you and your team.
    {% endblocktrans %}
{% else %}
    {% blocktrans trimmed %}
    Your event is currently only visible to you and your team.
    By going live, it will be publicly visible.
    {% endblocktrans %}

    {% if warnings %}
    <p>
    <h4>{% trans "Your event may not be ready for release yet!" %}</h4>
    <ul>
        {% for warning in warnings %}<li>{{ warning.text }} <a class="btn btn-sm btn-outline-info" href="{{ warning.url }}">{% trans "Fix me" %}</a></li>{% endfor %}
    </ul>
    </p>
    {% endif %}
    {% if suggestions %}
    <p>
    <h4>{% trans "There may be easy ways to improve your event before its release!" %}</h4>
    <ul>
    {% for suggestion in suggestions %}<li>{{ suggestion.text }} <a class="btn btn-sm btn-outline-info" href="{{ suggestion.url }}">{% trans "Fix me" %}</a></li>{% endfor %}
    </ul>
    </p>
    {% endif %}
{% endif %}
<p>
<div class="submit-group">
    <span></span>
    <form method="post">
        {% csrf_token %}
        {% if request.event.is_public %}
        <button class="btn btn-lg btn-danger" type="submit" name="action" value="deactivate">{% trans "Go offline" %}</button>
        {% else %}
        <button class="btn btn-lg btn-success" type="submit" name="action" value="activate">{% trans "Go live" %}</button>
        {% endif %}
    </form>
</div>
{% endblock %}
