{% extends "crm/base.html" %}
{% load crm_tags %}


{% block content %}

{% if request.user|is_crm_manager %}

<div class="d-flex">

    <a href="{% url 'crm:prospect-list' %}" class="small-button margin-v20">
        Prospects
    </a>
    <a href="{% url 'crm:add-event' %}" class="small-button margin-v20">
        Ajouter un évènement
    </a>
    <a href="{% url 'crm:add-prospect' %}" class="small-button margin-v20 left-margin">
        Ajouter un prospect
    </a>
    <a href="{% url 'crm:csv-import' %}" class="small-button margin-v20 left-margin">
        Import
    </a>
</div>

<div class="container grid-x padding-bottom">
    <div class="cell medium-6 large-6 my-block bubble">

        <div class="d-flex justify-content-between align-items-center mb-4">
            <h1 class="title">Completed Events</h1>
        </div>

        <div class="list-group">
            {% for event in completed_events %}
                {% include "crm/event_row.html" with event=event %}
            {% empty %}
            <div class="list-group-item">No completed events.</div>
            {% endfor %}
        </div>

    </div>

    <div class="cell medium-6 large-6 my-block bubble">

        <div class="d-flex justify-content-between align-items-center mb-4">
            <h1 class="title">Planned Events</h1>
        </div>

        <div class="list-group">
            {% for event in planned_events %}
                {% include "crm/event_row.html" with event=event %}
            {% empty %}
            <div class="list-group-item">No planned events.</div>
            {% endfor %}
        </div>

    </div>
</div>

{% else %}

Not authorized

{% endif %}

{% endblock %}
