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

{% block content %}
    <h2>{% trans "Bulletins" %}</h2>
    {% if bulletin_list.count == 0 %}
    <p>
        No bulletins to show! Why don't you
        <a href="{% url "bulletin-create" %}">
            create a new bulletin</a>?
    </p>
    {% else %}
    <dl class="bulletin-list">
        {% for bulletin in bulletin_list %}
        <dt>
            <a href="{% url "bulletin-detail" pk=bulletin.pk %}">
                {{ bulletin.title }}</a>
            {% if request.user.is_authenticated %}
            <a class="btn btn-outline-secondary btn-sm"
               href="{% url "bulletin-edit" pk=bulletin.pk %}">Edit</a>
            {% endif %}
        </dt>
        <dd>
            {% if bulletin.description %}
                <p>{{ bulletin.description }}</p>
            {% endif %}
        </dd>
        {% endfor %}
    </dl>
    <p>
        <a href="{% url "bulletin-rss" %}?{{ request.META.QUERY_STRING }}">
            RSS Feed</a>
    </p>
    {% endif %}
{% endblock %}
