diff --git a/argocd/deployment.yaml b/argocd/deployment.yaml
index c757ea7..df0ba34 100644
--- a/argocd/deployment.yaml
+++ b/argocd/deployment.yaml
@@ -27,7 +27,7 @@ spec:
mountPath: /data
containers:
- name: web
- image: git.baumann.gr/adebaumann/labhelper:0.026
+ image: git.baumann.gr/adebaumann/labhelper:0.027
imagePullPolicy: Always
ports:
- containerPort: 8000
diff --git a/boxes/templates/boxes/index.html b/boxes/templates/boxes/index.html
new file mode 100644
index 0000000..5fc532c
--- /dev/null
+++ b/boxes/templates/boxes/index.html
@@ -0,0 +1,205 @@
+{% load mptt_tags %}
+
+
+
+
+
+ LabHelper
+
+
+
+
+
+
+
LabHelper
+
+
+
+
+
Boxes
+ {% if boxes %}
+
+ {% for box in boxes %}
+
+ {% endfor %}
+
+ {% else %}
+
No boxes found.
+ {% endif %}
+
+
+
+
Thing Types
+ {% if thing_types %}
+
+ {% recursetree thing_types %}
+ -
+ {% if children %}
+ [-]
+ {% else %}
+
+ {% endif %}
+ {{ node.name }}
+ {% if node.things.exists %}
+ ({{ node.things.count }})
+ {% endif %}
+ {% if children %}
+
+ {% endif %}
+
+ {% endrecursetree %}
+
+ {% else %}
+
No thing types found.
+ {% endif %}
+
+
+
+
\ No newline at end of file
diff --git a/boxes/views.py b/boxes/views.py
index a9792f1..49727c8 100644
--- a/boxes/views.py
+++ b/boxes/views.py
@@ -6,9 +6,13 @@ from .models import Box, Thing, ThingType
def index(request):
- """Simple index page."""
- html = 'LabHelper
Search Things | Admin
'
- 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):
diff --git a/labhelper/settings.py b/labhelper/settings.py
index 9a9dadb..6ab1e5d 100644
--- a/labhelper/settings.py
+++ b/labhelper/settings.py
@@ -38,6 +38,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
+ 'mptt',
'django_mptt_admin',
'sorl.thumbnail',
'boxes',