{% extends "bloomerp_base.html" %} 
{% block main %}

<div class="card text-start">
  <div class="card-body">
    <h4 class="card-title">Notifications</h4>
    <p>For advanced filtering, click here <a href="{% url 'notification_detailed_list' %}">All Notifications</a></p>
    <div class="notification-list">
      {% for notification in notifications %}
      <a
        href="{{notification.target.get_absolute_url}}"
        class="list-group-item list-group-item-action"

      >
        <div class="d-flex w-100 justify-content-between">
          <h5 class="mb-1">Object {{notification.verb|title}}</h5>
          <small>{{notification.timestamp|timesince}}</small>
        </div>
        <p class="mb-1">{{notification.actor}} has {{notification.verb}}d the <b>{{notification.target_content_type.model}}</b> {{notification.target}}.</p>
        <small></small>
      </a>
      {% endfor %}
    </div>

    
    

    <div class="row justify-content-center align-items-center mt-4">
        <nav aria-label="">
            <ul class="pagination">
                {%if page_obj.has_previous %}
                <li class="page-item">
                    <a class="page-link" href="?page=1" tabindex="-1">First</a>
                </li>
                <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">{{ page_obj.previous_page_number }}</a></li>
                {% endif %}
                
                <li class="page-item active" aria-current="page">
                    <a class="page-link" href="#">{{ page_obj.number }}</a>
                </li>
                {%if page_obj.has_next %}
                <li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">{{ page_obj.next_page_number }}</a></li>
                <li class="page-item">
                    <a class="page-link" href="?page={{ page_obj.paginator.num_pages }}">Last</a>
                </li>
                {% endif %}
            </ul>
        </nav>

        <p class="text-muted">
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
        </p>

    </div>

  </div>
</div>

{% endblock %}
