Display paths

This commit is contained in:
George Lacey 2021-05-11 16:31:01 +01:00
parent e7eafee84f
commit 4e75b89212
2 changed files with 21 additions and 2 deletions

View File

@ -62,7 +62,24 @@
<canvas id="backup_csize_hourly" width="400" height="200"></canvas>
</div>
{% else %}
<p>No repos found.</p>
<div style="width: 600px;" class="repo-container shadow rounded bg-primary overflow-hidden">
<div style="width: 600px;" class="repo-container shadow rounded bg-primary overflow-hidden">
<h2 class="h2">No repositories found</h2>
</div>
</div>
{% endif %}
{% if location_list %}
<div style="width: 600px;" class="repo-container shadow rounded bg-primary overflow-hidden">
<h2 class="h2">Paths</h2>
{% for location in location_list %}
<dl class="att-label row ps-3">
<dt class="col-3">{{ location.label }}</dt>
<dd class="col-9">{{ location.short_description }}</dd>
</dl>
{% endfor %}
</div>
{% else %}
{% endif %}
</div>
{% endblock %}

View File

@ -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)