From b67ae7ff8b4151da6755f9db5eeae84d1712ecd1 Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Thu, 21 May 2026 11:42:01 +0200 Subject: [PATCH] (ui) Extend page headers across utility views Apply the shared page-header pattern to configuration, access, operations, retention, log, and changelog pages so the control panel uses one consistent title, context, and action structure. Add representative view assertions for the new page context on utility pages. Refs #28 --- .../templates/pobsync_backend/changelog.html | 15 ++++++++---- .../pobsync_backend/global_form.html | 15 ++++++++---- .../templates/pobsync_backend/host_form.html | 23 +++++++++++-------- .../templates/pobsync_backend/logs.html | 15 ++++++++---- .../pobsync_backend/purged_snapshots.html | 15 ++++++++---- .../pobsync_backend/schedule_form.html | 15 ++++++++---- .../templates/pobsync_backend/self_check.html | 15 ++++++++---- .../pobsync_backend/ssh_credential_form.html | 15 ++++++++---- .../ssh_credential_generate.html | 15 ++++++++---- .../pobsync_backend/ssh_credentials.html | 19 +++++++++------ src/pobsync_backend/tests/test_views.py | 6 +++++ 11 files changed, 112 insertions(+), 56 deletions(-) diff --git a/src/pobsync_backend/templates/pobsync_backend/changelog.html b/src/pobsync_backend/templates/pobsync_backend/changelog.html index 0e5b38a..719f846 100644 --- a/src/pobsync_backend/templates/pobsync_backend/changelog.html +++ b/src/pobsync_backend/templates/pobsync_backend/changelog.html @@ -3,11 +3,16 @@ {% block title %}Changelog - pobsync{% endblock %} {% block content %} -

Changelog

- -
- Back to dashboard -
+
diff --git a/src/pobsync_backend/templates/pobsync_backend/global_form.html b/src/pobsync_backend/templates/pobsync_backend/global_form.html index 135f8cd..98fe535 100644 --- a/src/pobsync_backend/templates/pobsync_backend/global_form.html +++ b/src/pobsync_backend/templates/pobsync_backend/global_form.html @@ -3,11 +3,16 @@ {% block title %}Global Config{% endblock %} {% block content %} -

{% if global_config %}Global Config{% else %}Create Global Config{% endif %}

- -
- Back to dashboard -
+

{% if global_config %}Edit Global Config{% else %}Create Global Config{% endif %}

diff --git a/src/pobsync_backend/templates/pobsync_backend/host_form.html b/src/pobsync_backend/templates/pobsync_backend/host_form.html index fa1b0e5..6847561 100644 --- a/src/pobsync_backend/templates/pobsync_backend/host_form.html +++ b/src/pobsync_backend/templates/pobsync_backend/host_form.html @@ -3,15 +3,20 @@ {% block title %}{% if host %}Config | {{ host.host }}{% else %}New Host{% endif %}{% endblock %} {% block content %} -

{% if host %}Config: {{ host.host }}{% else %}New Host{% endif %}

- -
- {% if host %} - Back to host - {% else %} - Back to dashboard - {% endif %} -
+

{% if host %}Edit Host Config{% else %}Create Host Config{% endif %}

diff --git a/src/pobsync_backend/templates/pobsync_backend/logs.html b/src/pobsync_backend/templates/pobsync_backend/logs.html index 537fb3d..8eb57d2 100644 --- a/src/pobsync_backend/templates/pobsync_backend/logs.html +++ b/src/pobsync_backend/templates/pobsync_backend/logs.html @@ -3,11 +3,16 @@ {% block title %}Logs | pobsync{% endblock %} {% block content %} -

Logs

- -
- Back to dashboard -
+

Filter

diff --git a/src/pobsync_backend/templates/pobsync_backend/purged_snapshots.html b/src/pobsync_backend/templates/pobsync_backend/purged_snapshots.html index 8f54524..d6ed8ce 100644 --- a/src/pobsync_backend/templates/pobsync_backend/purged_snapshots.html +++ b/src/pobsync_backend/templates/pobsync_backend/purged_snapshots.html @@ -3,11 +3,16 @@ {% block title %}Purged Snapshots | pobsync{% endblock %} {% block content %} -

Purged Snapshots

- -
- Back to dashboard -
+

Filters

diff --git a/src/pobsync_backend/templates/pobsync_backend/schedule_form.html b/src/pobsync_backend/templates/pobsync_backend/schedule_form.html index cbe7f98..9aa7581 100644 --- a/src/pobsync_backend/templates/pobsync_backend/schedule_form.html +++ b/src/pobsync_backend/templates/pobsync_backend/schedule_form.html @@ -3,11 +3,16 @@ {% block title %}Schedule | {{ host.host }}{% endblock %} {% block content %} -

Schedule: {{ host.host }}

- -
- Back to host -
+

{% if schedule %}Edit Schedule{% else %}Create Schedule{% endif %}

diff --git a/src/pobsync_backend/templates/pobsync_backend/self_check.html b/src/pobsync_backend/templates/pobsync_backend/self_check.html index 6bcb385..df294fe 100644 --- a/src/pobsync_backend/templates/pobsync_backend/self_check.html +++ b/src/pobsync_backend/templates/pobsync_backend/self_check.html @@ -3,11 +3,16 @@ {% block title %}Self Check | pobsync{% endblock %} {% block content %} -

Self Check

- -
- Back to dashboard -
+
OK
{{ summary.ok }}
diff --git a/src/pobsync_backend/templates/pobsync_backend/ssh_credential_form.html b/src/pobsync_backend/templates/pobsync_backend/ssh_credential_form.html index 543915d..092480f 100644 --- a/src/pobsync_backend/templates/pobsync_backend/ssh_credential_form.html +++ b/src/pobsync_backend/templates/pobsync_backend/ssh_credential_form.html @@ -3,11 +3,16 @@ {% block title %}{% if credential %}SSH Key | {{ credential.name }}{% else %}New SSH Key{% endif %} | pobsync{% endblock %} {% block content %} -

{% if credential %}SSH Key: {{ credential.name }}{% else %}New SSH Key{% endif %}

- -
- Back to SSH keys -
+

{% if credential %}Edit SSH Credential{% else %}Create SSH Credential{% endif %}

diff --git a/src/pobsync_backend/templates/pobsync_backend/ssh_credential_generate.html b/src/pobsync_backend/templates/pobsync_backend/ssh_credential_generate.html index 7d8b593..1b5933c 100644 --- a/src/pobsync_backend/templates/pobsync_backend/ssh_credential_generate.html +++ b/src/pobsync_backend/templates/pobsync_backend/ssh_credential_generate.html @@ -3,11 +3,16 @@ {% block title %}Generate SSH Key | pobsync{% endblock %} {% block content %} -

Generate SSH Key

- -
- Back to SSH keys -
+

Create Key Pair

diff --git a/src/pobsync_backend/templates/pobsync_backend/ssh_credentials.html b/src/pobsync_backend/templates/pobsync_backend/ssh_credentials.html index cc031a6..df15f37 100644 --- a/src/pobsync_backend/templates/pobsync_backend/ssh_credentials.html +++ b/src/pobsync_backend/templates/pobsync_backend/ssh_credentials.html @@ -3,13 +3,18 @@ {% block title %}SSH Keys | pobsync{% endblock %} {% block content %} -

SSH Keys

- -
- Generate SSH key - Add existing key - Back to dashboard -
+

Credentials

diff --git a/src/pobsync_backend/tests/test_views.py b/src/pobsync_backend/tests/test_views.py index cb42255..510f77f 100644 --- a/src/pobsync_backend/tests/test_views.py +++ b/src/pobsync_backend/tests/test_views.py @@ -295,6 +295,7 @@ class ViewTests(TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Self Check") + self.assertContains(response, "Runtime, filesystem, service, and configuration checks") self.assertContains(response, "Django debug") self.assertContains(response, "Database connection") self.assertContains(response, "State root") @@ -329,6 +330,7 @@ class ViewTests(TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Logs") + self.assertContains(response, "Filter pobsync service logs") self.assertContains(response, "web-01 failed backup run 12") self.assertNotContains(response, "web-02 failed backup run 12") self.assertNotContains(response, "started") @@ -358,6 +360,7 @@ class ViewTests(TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Purged Snapshots") + self.assertContains(response, "Audit trail for snapshots removed") self.assertContains(response, "20260518-021500Z__OLDSNAP") self.assertContains(response, "outside retention policy") self.assertContains(response, "Scheduled") @@ -412,6 +415,7 @@ class ViewTests(TestCase): ) self.assertRedirects(response, reverse("ssh_credentials")) + self.assertContains(response, "Manage the key pairs pobsync uses") self.assertContains(response, "SSH credential saved for backup-key.") self.assertContains(response, "backup-key") credential = SshCredential.objects.get(name="backup-key") @@ -641,6 +645,7 @@ class ViewTests(TestCase): response = self.client.get(reverse("edit_global_config")) self.assertEqual(response.status_code, 200) + self.assertContains(response, "Defaults used by hosts unless a host overrides them") self.assertContains(response, f'value="{credential.id}" selected') self.assertContains(response, "--archive") self.assertContains(response, "/proc/***") @@ -2031,6 +2036,7 @@ class ViewTests(TestCase): response = self.client.get(reverse("edit_host_schedule", args=[host.host])) self.assertEqual(response.status_code, 200) + self.assertContains(response, "Automatic backup timing and scheduled prune behavior") self.assertContains(response, "Create Schedule") self.assertContains(response, "Schedule expression") self.assertContains(response, "evaluated by the pobsync scheduler service")