From 4e75b89212c9b92a4dbd4d10bc045844df9ce3b9 Mon Sep 17 00:00:00 2001 From: George Lacey Date: Tue, 11 May 2021 16:31:01 +0100 Subject: [PATCH] Display paths --- borgweb/borg/templates/borg/index.html | 19 ++++++++++++++++++- borgweb/borg/views.py | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/borgweb/borg/templates/borg/index.html b/borgweb/borg/templates/borg/index.html index 64012ed..92561c4 100644 --- a/borgweb/borg/templates/borg/index.html +++ b/borgweb/borg/templates/borg/index.html @@ -62,7 +62,24 @@ {% else %} -

No repos found.

+
+
+

No repositories found

+
+
+ {% endif %} + {% if location_list %} +
+

Paths

+ {% for location in location_list %} +
+
{{ location.label }}
+
{{ location.short_description }}
+
+ {% endfor %} +
+ {% else %} + {% endif %} {% endblock %} diff --git a/borgweb/borg/views.py b/borgweb/borg/views.py index 0c12115..0f0da84 100644 --- a/borgweb/borg/views.py +++ b/borgweb/borg/views.py @@ -11,12 +11,14 @@ from datetime import datetime, timedelta def index(request): repo_list = Repo.objects.all() + location_list = Location.objects.all() repo_dict = repo_daily_dict(repo_list, 24) context = { 'repo_list': repo_list, - 'hour_list': repo_dict + 'hour_list': repo_dict, + 'location_list': location_list, } return render(request, 'borg/index.html', context)