From ebf3b9d00aca4975ee58421aec7ddb531cef9f01 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Tue, 6 Jan 2026 12:55:04 +0100 Subject: [PATCH] Restructured pages --- AGENTS.md | 8 +- boxes/templates/boxes/boxes_list.html | 74 ++++++++++++ boxes/templates/boxes/index.html | 161 +++++++++++++++++++------- boxes/tests.py | 28 ++--- boxes/views.py | 13 ++- labhelper/urls.py | 5 +- 6 files changed, 224 insertions(+), 65 deletions(-) create mode 100644 boxes/templates/boxes/boxes_list.html diff --git a/AGENTS.md b/AGENTS.md index 26a579c..910fced 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -214,10 +214,10 @@ labhelper/ │ │ ├── add_things.html # Form to add multiple things │ │ ├── box_detail.html # Box contents view │ │ ├── box_management.html # Box/BoxType CRUD management +│ │ ├── boxes_list.html # Boxes list page with tabular view │ │ ├── edit_thing.html # Edit thing page (name, description, picture, tags, files, links) -│ │ ├── index.html # Home page with boxes and tags +│ │ ├── index.html # Home page with search and tags │ │ ├── resources_list.html # List all links and files from things -│ │ ├── search.html # Search page with AJAX │ │ └── thing_detail.html # Read-only thing details view │ ├── templatetags/ │ │ └── dict_extras.py # Custom template filters: get_item, render_markdown, truncate_markdown @@ -378,7 +378,8 @@ The project uses a base template system at `labhelper/templates/base.html`. All | View Function | URL Pattern | Name | Description | |---------------|-------------|------|-------------| -| `index` | `/` | `index` | Home page with boxes grid and tags overview | +| `index` | `/` | `index` | Home page with search and tags overview | +| `boxes_list` | `/search/` | `search`, `boxes_list` | Boxes list page with tabular view | | `box_management` | `/box-management/` | `box_management` | Manage boxes and box types | | `add_box_type` | `/box-type/add/` | `add_box_type` | Add new box type | | `edit_box_type` | `/box-type//edit/` | `edit_box_type` | Edit box type | @@ -390,7 +391,6 @@ The project uses a base template system at `labhelper/templates/base.html`. All | `thing_detail` | `/thing//` | `thing_detail` | Read-only view of thing details | | `edit_thing` | `/thing//edit/` | `edit_thing` | Edit thing (name, description, picture, tags, files, links, move) | | `add_things` | `/box//add/` | `add_things` | Add multiple things to a box | -| `search` | `/search/` | `search` | Search page | | `search_api` | `/search/api/` | `search_api` | AJAX search endpoint | | `resources_list` | `/resources/` | `resources_list` | List all links and files from things (sorted by thing name) | | `LoginView` | `/login/` | `login` | Django auth login | diff --git a/boxes/templates/boxes/boxes_list.html b/boxes/templates/boxes/boxes_list.html new file mode 100644 index 0000000..81a23c5 --- /dev/null +++ b/boxes/templates/boxes/boxes_list.html @@ -0,0 +1,74 @@ +{% extends "base.html" %} + +{% block title %}Boxes - LabHelper{% endblock %} + +{% block page_header %} + +{% endblock %} + +{% block content %} +{% if boxes %} +
+ + + + + + + + + + + + {% for box in boxes %} + + + + + + + + {% endfor %} + +
Box IDTypeDimensions (mm)ContentsItem Count
+ Box {{ box.id }} + {{ box.box_type.name }}{{ box.box_type.width }} x {{ box.box_type.height }} x {{ box.box_type.length }} + {% if box.things.all %} +
+ {% for thing in box.things.all %} + {{ thing.name }} + {% endfor %} +
+ {% else %} + Empty + {% endif %} +
{{ box.things.count }}
+
+{% else %} +
+ +

No boxes found

+

Create your first box to get started.

+
+{% endif %} +{% endblock %} + +{% block extra_js %} + +{% endblock %} diff --git a/boxes/templates/boxes/index.html b/boxes/templates/boxes/index.html index 4b62ba1..d3ff1f9 100644 --- a/boxes/templates/boxes/index.html +++ b/boxes/templates/boxes/index.html @@ -11,34 +11,37 @@ {% block content %}
-

Boxes

- {% if boxes %} - - {% else %} -

- - No boxes found. + +

+ Type at least 2 characters to search

- {% endif %} +
+ + + +
@@ -57,7 +60,7 @@