{% extends 'layout.html' %}
{% block content %}

<div class="grid-container padding-top-1">
    {% if request.user.is_authenticated %}
    <div class="grid-x">
        <div class="cell large-3 medium-4 small-12">
            <a class="button" href="{% url 'admin:blackboard_jobposting_add' %}">neue Stellenausschreibung hinzufügen</a>
        </div>

        {% if bb_info %}
            <div class="cell large-3 medium-4 small-12">
                <a class="button" href="{% url 'admin:core_customflatpage_change' bb_info.id %}">Info-Text bearbeiten</a>
            </div>
        {% endif %}

        {% if bb_empty %}
            <div class="cell large-3 medium-4 small-12">
                <a class="button" href="{% url 'admin:core_customflatpage_change' bb_empty.id %}">"leeres Blackboard"-Text bearbeiten</a>
            </div>
        {% endif %}
        <hr>
    </div>
    {% endif %}

    <h1>Blackboard</h1>

    {% if bb_info %}
        {{ bb_info.content|safe }}
        <hr>
    {% endif %}

    <div class="grid-x grid-margin-x">
        {% for job in job_postings %}
            {% include 'blackboard/partials/_show_job_posting.html' %}
        {% empty %}
            {% if bb_empty %}
                <div class="cell large-3 medium-4 small-12">
                    {{ bb_empty.content|safe }}
                </div>
            {% endif %}
        {% endfor %}
    </div>
</div>

{% endblock %}
