From 2e60124b9f216e483c6d0375f3b66b9291064d2b Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Wed, 22 Apr 2026 16:18:18 +0200 Subject: [PATCH] Shared work log payroll modal + safe DOM builder in base.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modal shell + JS click handler live in base.html so any page opts in by adding data-log-id to a row. JS uses createElement + textContent (matches worker_lookup_ajax pattern) to build the modal body from JSON — no innerHTML. Supervisors never receive the markup. Footer 'Open full page' links to /history//. Co-Authored-By: Claude Opus 4.7 (1M context) --- core/templates/base.html | 254 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) diff --git a/core/templates/base.html b/core/templates/base.html index 205e0d4..ba0349a 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -392,6 +392,260 @@ })(); +{# === WORK LOG PAYROLL MODAL — click handler + safe DOM builder === #} +{# Builds the modal body from JSON via createElement + textContent. #} +{% if user.is_authenticated and user.is_staff or user.is_superuser %} + +{% endif %} + {% block extra_js %}{% endblock %} + +{# === WORK LOG PAYROLL MODAL (admin-only) === #} +{# Hidden by default. Any element with data-log-id anywhere in the app #} +{# triggers this modal. Fetches JSON and builds the DOM safely. #} +{% if user.is_authenticated and user.is_staff or user.is_superuser %} + +{% endif %}