{% extends 'base.html' %}
{% load static %}

    {% block styles %}
        <link rel="stylesheet" type="text/css" href="{% static 'announcements/style.css' %}">   
    {% endblock %}

{% block title %}Announcements{% endblock %}
{% block content %}
    <h1>Announcement Board </h1>
        <div>
            <h2>Important Announcements:</h2>
            {% if announcement_list %}
                <ul>
                {% for announcement in announcement_list %}
                <li><a href="{% url 'announcements:detailsAnnouncements' announcement.id %}">{{announcement.announcement_title}}</a> by {{announcement.author.first_name}} {{announcement.author.last_name}} dated {{announcement.pub_date|date:"d/m/Y"}}</li>
                {% endfor %}
                </ul>
                {% else %}
                <p>There are no announcements.</p>
            {% endif %}
            <a href="{% url 'announcements:addAnnouncements' %}">
                <button>New Announcement</button>
            </a>
        </div>
{% endblock %}