From b4a5b3481577d5759e7553e4d4cf5c8322362f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Thu, 1 Jan 2026 18:36:28 +0100 Subject: [PATCH] Use single bookmark page template --- Makefile | 2 +- bookmarks/templates/bookmarks/archive.html | 37 ------------ .../templates/bookmarks/bookmark_page.html | 59 +++++++++++++++++++ .../templates/bookmarks/bulk_edit/toggle.html | 16 ----- .../bar.html => bulk_edit_bar.html} | 8 ++- bookmarks/templates/bookmarks/index.html | 38 ------------ bookmarks/templates/bookmarks/shared.html | 44 -------------- .../templates/bookmarks/user_section.html | 22 +++++++ .../templates/bookmarks/user_select.html | 14 ----- bookmarks/templatetags/bookmarks.py | 16 ----- bookmarks/tests/test_user_select_tag.py | 39 +++++++----- bookmarks/views/bookmarks.py | 14 ++--- bookmarks/views/contexts.py | 23 ++++++++ 13 files changed, 139 insertions(+), 193 deletions(-) delete mode 100644 bookmarks/templates/bookmarks/archive.html create mode 100644 bookmarks/templates/bookmarks/bookmark_page.html delete mode 100644 bookmarks/templates/bookmarks/bulk_edit/toggle.html rename bookmarks/templates/bookmarks/{bulk_edit/bar.html => bulk_edit_bar.html} (83%) delete mode 100644 bookmarks/templates/bookmarks/index.html delete mode 100644 bookmarks/templates/bookmarks/shared.html create mode 100644 bookmarks/templates/bookmarks/user_section.html delete mode 100644 bookmarks/templates/bookmarks/user_select.html diff --git a/Makefile b/Makefile index 051a540..b42f03c 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ test: format: uv run black bookmarks - uv run djlint bookmarks/templates --reformat --quiet + uv run djlint bookmarks/templates --reformat --quiet --warn npx prettier bookmarks/frontend --write npx prettier bookmarks/styles --write diff --git a/bookmarks/templates/bookmarks/archive.html b/bookmarks/templates/bookmarks/archive.html deleted file mode 100644 index c6f86fb..0000000 --- a/bookmarks/templates/bookmarks/archive.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "shared/layout.html" %} -{% load static %} -{% load shared %} -{% load bookmarks %} -{% block content %} - - {# Bookmark list #} -
-
-

Archived bookmarks

-
- {% bookmark_search bookmark_list.search mode='archived' %} - {% include 'bookmarks/bulk_edit/toggle.html' %} - - - -
-
-
- {% csrf_token %} - {% include 'bookmarks/bulk_edit/bar.html' with disable_actions='bulk_archive' %} -
{% include 'bookmarks/bookmark_list.html' %}
-
-
- {# Filters #} -
- {% include 'bookmarks/bundle_section.html' %} - {% include 'bookmarks/tag_section.html' %} -
-
-{% endblock %} -{% block overlays %} - {% include 'bookmarks/details/modal.html' %} -{% endblock %} diff --git a/bookmarks/templates/bookmarks/bookmark_page.html b/bookmarks/templates/bookmarks/bookmark_page.html new file mode 100644 index 0000000..d490540 --- /dev/null +++ b/bookmarks/templates/bookmarks/bookmark_page.html @@ -0,0 +1,59 @@ +{% extends "shared/layout.html" %} +{% load static shared bookmarks %} +{% block content %} + + {# Bookmark list #} +
+
+

{{ bookmark_list.list_title }}

+
+ {% bookmark_search bookmark_list.search mode=bookmark_list.search_mode %} + {% if bookmark_list.bulk_edit_enabled %} + + {% endif %} + + + +
+
+
+ {% csrf_token %} + {% if bookmark_list.bulk_edit_enabled %} + {% include 'bookmarks/bulk_edit_bar.html' %} + {% endif %} +
{% include 'bookmarks/bookmark_list.html' %}
+
+
+ {# Filters #} +
+ {% if bundles %} + {% include 'bookmarks/bundle_section.html' %} + {% endif %} + {% if user_list %} + {% include 'bookmarks/user_section.html' %} + {% endif %} + {% include 'bookmarks/tag_section.html' %} +
+
+{% endblock %} +{% block overlays %} + {% include 'bookmarks/details/modal.html' %} +{% endblock %} diff --git a/bookmarks/templates/bookmarks/bulk_edit/toggle.html b/bookmarks/templates/bookmarks/bulk_edit/toggle.html deleted file mode 100644 index 9f1cdf2..0000000 --- a/bookmarks/templates/bookmarks/bulk_edit/toggle.html +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/bookmarks/templates/bookmarks/bulk_edit/bar.html b/bookmarks/templates/bookmarks/bulk_edit_bar.html similarity index 83% rename from bookmarks/templates/bookmarks/bulk_edit/bar.html rename to bookmarks/templates/bookmarks/bulk_edit_bar.html index cf0bed6..1e60d82 100644 --- a/bookmarks/templates/bookmarks/bulk_edit/bar.html +++ b/bookmarks/templates/bookmarks/bulk_edit_bar.html @@ -7,8 +7,12 @@