Add new front page with boxes and thing types tree
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 29s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 6s

- Replace simple HTML index with full template
- Add grid of all boxes with details and item counts
- Add expandable tree view of thing types using MPTT
- Add 'mptt' to INSTALLED_APPS for recursetree tag
- Add jQuery for tree toggle functionality

Bump container version to 0.027
This commit is contained in:
2025-12-29 00:09:23 +01:00
parent fbd3c9bee5
commit 02e949d0ad
4 changed files with 214 additions and 4 deletions

View File

@@ -6,9 +6,13 @@ from .models import Box, Thing, ThingType
def index(request):
"""Simple index page."""
html = '<h1>LabHelper</h1><p><a href="/search/">Search Things</a> | <a href="/admin/">Admin</a></p>'
return HttpResponse(html)
"""Home page with boxes and thing types."""
boxes = Box.objects.select_related('box_type').all().order_by('id')
thing_types = ThingType.objects.all()
return render(request, 'boxes/index.html', {
'boxes': boxes,
'thing_types': thing_types,
})
def box_detail(request, box_id):