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

{% block content %}
    {% has_perm 'orga.create_events' request.user request.user as can_create_event %}
    <div class="dashboard-list">
        {% for event in request.orga_events %}
            <a href="{{ event.orga_urls.base }}" class="dashboard-block">
                <h1>{{ event.name }}</h1>
                <span class="dashboard-description">
                    {% if event.date_from %}{{ event.date_from }} – {{ event.date_to }}<br>{% endif %}
                    /{{ event.slug }}
                </span>
            </a>
        {% endfor %}
        {% for organiser in organisers %}
            <a href="{{ organiser.orga_urls.base }}" class="dashboard-block">
                <h1>{{ organiser.name }}</h1>
                <span class="dashboard-description">
                    ({% trans "Organiser" %})
                </span>
            </a>
        {% endfor %}
        {% if can_create_event %}
            <a href="{% url "orga:event.create" %}" class="dashboard-block">
                <h1><i class="fa fa-plus"></i>{% trans "New event" %}</h1>
                <span class="dashboard-description">{% trans "Uh, a new event?<br>Head over here, please!" %}</span>
            </a>
        {% endif %}
    </div>
{% endblock %}
