Add sent-notes and archive

This commit is contained in:
2025-12-22 13:29:00 +05:30
parent c84866210a
commit 9724f834c0
6 changed files with 139 additions and 6 deletions

View File

@@ -20,4 +20,40 @@
{% else %}
<div class="card">No Notes found</div>
{% endif %}
<div class="title-and-link">
<h2>Active Sent Notes</h2>
<a href="{% url "sent-notes" %}">View All including expired</a>
</div>
{% if alive_created %}
<div class="notes">
{% for note in alive_created %}
<div class="note">
<p>{{ note.note }}</p>
<p class="note-from">From {{ note.from_user.visible_name }}</p>
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
</div>
{% endfor %}
</div>
{% else %}
<div class="card">No Notes found</div>
{% endif %}
<div class="title-and-link">
<h2>Archived Notes</h2>
<a href="{% url "archive" %}">View All</a>
</div>
{% if archive %}
<div class="notes">
{% for note in archive %}
<div class="note">
<p>{{ note.note }}</p>
<p class="note-from">From {{ note.from_user.visible_name }}</p>
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
</div>
{% endfor %}
</div>
{% else %}
<div class="card">No Notes found</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "notes/base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block body %}
<h1>{{ title }}</h1>
{% include "notes/messages.html" %}
{% if object_list %}
<div class="notes">
{% for note in object_list %}
<div class="note">
<p>{{ note.note }}</p>
{% if show_from %}<p class="note-from">From {{ note.from_user.visible_name }}</p>{% endif %}
{% if show_to %}<p class="note-to">To {{ note.to_user.visible_name }}</p>{% endif %}
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
</div>
{% endfor %}
</div>
{% else %}
<div class="card">No Notes found</div>
{% endif %}
{% endblock %}