From 4d9f2cc09f8ebffa17f6911989c86f76dda9ce72 Mon Sep 17 00:00:00 2001 From: Irene Sheen Date: Sat, 10 Jan 2026 15:11:22 +0530 Subject: [PATCH] Move notes to a central file and add linebreaksbr --- .../notes/static/notes/stylesheets/style.css | 4 -- server/notes/templates/notes/home.html | 42 ++----------------- server/notes/templates/notes/note_list.html | 17 +------- server/notes/templates/notes/notes.html | 15 +++++++ 4 files changed, 19 insertions(+), 59 deletions(-) create mode 100644 server/notes/templates/notes/notes.html diff --git a/server/notes/static/notes/stylesheets/style.css b/server/notes/static/notes/stylesheets/style.css index 4217125..791e77f 100644 --- a/server/notes/static/notes/stylesheets/style.css +++ b/server/notes/static/notes/stylesheets/style.css @@ -74,10 +74,6 @@ button { margin: auto; } -.notes.notes-grid { - display: grid; -} - .note { display: inline-block; width: 100%; diff --git a/server/notes/templates/notes/home.html b/server/notes/templates/notes/home.html index b0ab331..a8e8c1f 100644 --- a/server/notes/templates/notes/home.html +++ b/server/notes/templates/notes/home.html @@ -7,53 +7,17 @@ {% include "notes/messages.html" %}

Notes for you

- {% if notes %} -
- {% for note in notes %} -
-

{{ note.note }}

-

From {{ note.from_user.visible_name }}

-

{{ note.created_at|date:"j M, H:i"}}

-
- {% endfor %} -
- {% else %} -
No Notes found
- {% endif %} + {% include "notes/notes.html" with object_list=notes show_from=True show_to=False %} - {% if alive_created %} -
- {% for note in alive_created %} -
-

{{ note.note }}

-

From {{ note.from_user.visible_name }}

-

{{ note.created_at|date:"j M Y, H:i"}}

-
- {% endfor %} -
- {% else %} -
No Notes found
- {% endif %} + {% include "notes/notes.html" with object_list=alive_created show_from=False show_to=True %} - {% if archive %} -
- {% for note in archive %} -
-

{{ note.note }}

-

From {{ note.from_user.visible_name }}

-

{{ note.created_at|date:"j M Y, H:i"}}

-
- {% endfor %} -
- {% else %} -
No Notes found
- {% endif %} + {% include "notes/notes.html" with object_list=archive show_from=True show_to=False %} {% endblock %} diff --git a/server/notes/templates/notes/note_list.html b/server/notes/templates/notes/note_list.html index 9c9571e..c61cda6 100644 --- a/server/notes/templates/notes/note_list.html +++ b/server/notes/templates/notes/note_list.html @@ -5,20 +5,5 @@ {% block body %}

{{ title }}

{% include "notes/messages.html" %} - - {% if object_list %} -
- {% for note in object_list %} -
-

{{ note.note }}

- {% if show_from %}

From {{ note.from_user.visible_name }}

{% endif %} - {% if show_to %}

To {{ note.to_user.visible_name }}

{% endif %} -

{{ note.created_at|date:"j M Y, H:i"}}

-
- {% endfor %} -
- {% else %} -
No Notes found
- {% endif %} - + {% include "notes/notes.html" %} {% endblock %} diff --git a/server/notes/templates/notes/notes.html b/server/notes/templates/notes/notes.html new file mode 100644 index 0000000..7fd5c9e --- /dev/null +++ b/server/notes/templates/notes/notes.html @@ -0,0 +1,15 @@ +{% if object_list %} +
+ {% for note in object_list %} +
+

{{ note.note | linebreaksbr }}

+ {% if show_from %}

From {{ note.from_user.visible_name }}

{% endif %} + {% if show_to %}

To {{ note.to_user.visible_name }}

{% endif %} +

{{ note.created_at|date:"j M Y, H:i"}}

+
+ {% endfor %} +
+{% else %} +
No Notes found
+{% endif %} +