From df3d51e6eceabb8a685cdd42e2252f9f1242b8e5 Mon Sep 17 00:00:00 2001 From: George Lacey Date: Mon, 10 May 2021 18:54:47 +0100 Subject: [PATCH] Create base template with navbar --- borgweb/borg/templates/borg/base.html | 54 ++++++++++++++++++++++ borgweb/borg/templates/borg/index.html | 63 ++++++++++++-------------- 2 files changed, 82 insertions(+), 35 deletions(-) create mode 100644 borgweb/borg/templates/borg/base.html diff --git a/borgweb/borg/templates/borg/base.html b/borgweb/borg/templates/borg/base.html new file mode 100644 index 0000000..c367ca3 --- /dev/null +++ b/borgweb/borg/templates/borg/base.html @@ -0,0 +1,54 @@ + + + + + + + {% load static %} + {% load compress %} + {% compress css %} + + {% endcompress %} + + {% block script %}{% endblock %} + + {% block title %}Title{% endblock %} + + + + +{% block body %}{% endblock %} + + \ No newline at end of file diff --git a/borgweb/borg/templates/borg/index.html b/borgweb/borg/templates/borg/index.html index ec0b4f3..966499f 100644 --- a/borgweb/borg/templates/borg/index.html +++ b/borgweb/borg/templates/borg/index.html @@ -1,61 +1,55 @@ - - - - - - Borg Summary +{% extends "borg/base.html" %} +{% load static %} - {% load static %} - {% load compress %} - {% compress css %} - - {% endcompress %} +{% block title %}Borg Summary{% endblock %} + +{% block script %} - - {{ hour_list|json_script:"hour_list" }} - - - +{% block style %} + .repo-container { + padding: 8px; + margin: 8px; + } + + .att-label { + margin-top: 4px; + margin-bottom: 4px; + } +{% endblock %} + +{% block body %} {% if repo_list %}
{% for repo in repo_list %} -

{{ repo.label }} {{ repo.location }}

-
+
Latest backup:
{{ repo.last_backup }}
-
+
Hourly backups:
{{ repo.hourly_archive_string }}
-
+
Size:
{{ repo.size_string }}
{% if repo.recent_errors|length > 0 %} -
+
Recent errors:
{% endif %} -
+
{% for error in repo.recent_errors %}
{{ error.time_ago }}
{{ error.error }}
@@ -63,13 +57,12 @@
{% endfor %} -
+
{% else %}

No repos found.

{% endif %}
-
- - \ No newline at end of file +{% endblock %} +