Add incoming messages page
parent
1b9fc8652d
commit
e9e263d59d
@ -0,0 +1,27 @@
|
|||||||
|
{% if page.has_other_pages %}
|
||||||
|
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||||
|
{% if page.has_previous %}
|
||||||
|
<a class="pagination-previous" href="?page={{ page.previous_page_number }}"><</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="pagination-previous is-disabled"><</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if page.has_next %}
|
||||||
|
<a class="pagination-next" href="?page={{ page.next_page_number }}">></a>
|
||||||
|
{% else %}
|
||||||
|
<a class="pagination-next is-disabled">></a>
|
||||||
|
{% endif %}
|
||||||
|
<ul class="pagination-list">
|
||||||
|
{% for p in page_range %}
|
||||||
|
<li>
|
||||||
|
{% if p == page.paginator.ELLIPSIS %}
|
||||||
|
<span class="pagination-ellipsis">{{ page.paginator.ELLIPSIS }}</span>
|
||||||
|
{% elif p == page.number %}
|
||||||
|
<a class="pagination-link is-current">{{ p }}</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="pagination-link" href="?page={{ p }}">{{ p }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{% endif %}
|
@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 4.0.4 on 2023-05-07 11:52
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("team", "0002_alter_incomingmessage_id"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="incomingmessage",
|
||||||
|
name="read",
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name="incomingmessage",
|
||||||
|
index=models.Index(fields=["sender"], name="team_incomi_sender_799f7d_idx"),
|
||||||
|
),
|
||||||
|
]
|
@ -0,0 +1,21 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load humanize %}
|
||||||
|
|
||||||
|
{% block title %}Sie haben {{ num_unread | apnumber }} neue Nachricht{{ num_unread | pluralize:"en" }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% for message in page %}
|
||||||
|
<a href="{% if message.from_helper %}{% url 'team:helper' message.from_helper.pk %}{% else %}{% url 'team:conversation' message.sender %}{% endif %}">
|
||||||
|
<div class="message{% if not message.read %} is-info{% endif %} mb-5">
|
||||||
|
<div class="message-header">
|
||||||
|
{{ message.display_sender }} <small>{{ message.created_at | naturaltime }}</small>
|
||||||
|
</div>
|
||||||
|
<div class="message-body">
|
||||||
|
{{ message.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% include "pagination.html" %}
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue