From 147a329a339e7571a1f82bd37e99378b8138efcd Mon Sep 17 00:00:00 2001 From: Caitlin Barnard <54268863+CaitBarnard@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:43:10 +0000 Subject: [PATCH] FFT-179 Add a link to go from Edit Payroll to Edit Forecast (#618) Co-authored-by: Sam Dudley Co-authored-by: Sam Dudley --- forecast/templates/forecast/edit/edit.html | 10 ++++++++++ forecast/templates/forecast/edit/forecast_base.html | 4 +++- front_end/styles/styles.scss | 8 ++++++++ payroll/templates/payroll/page/edit_payroll.html | 8 +++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/forecast/templates/forecast/edit/edit.html b/forecast/templates/forecast/edit/edit.html index c990341d..32477af3 100644 --- a/forecast/templates/forecast/edit/edit.html +++ b/forecast/templates/forecast/edit/edit.html @@ -11,6 +11,16 @@ {% block title %}Edit Forecast{% endblock %} +{% block page_heading %} +
+ {{ block.super }} + {% can_access_edit_payroll user as user_can_access_edit_payroll %} + {% if user_can_access_edit_payroll and settings.PAYROLL.ENABLE_FORECAST %} + Go to Payroll + {% endif %} +
+{% endblock %} + {% block page_content %}
diff --git a/forecast/templates/forecast/edit/forecast_base.html b/forecast/templates/forecast/edit/forecast_base.html index ac676979..80240f56 100644 --- a/forecast/templates/forecast/edit/forecast_base.html +++ b/forecast/templates/forecast/edit/forecast_base.html @@ -16,7 +16,9 @@

{{ view.title }}

+ {% block page_heading %} +

{{ view.title }}

+ {% endblock page_heading %} {{ view.cost_centre_details.cost_centre_name }} ({{ view.cost_centre_details.cost_centre_code }})
diff --git a/front_end/styles/styles.scss b/front_end/styles/styles.scss index fa49d985..22f7b575 100644 --- a/front_end/styles/styles.scss +++ b/front_end/styles/styles.scss @@ -373,6 +373,14 @@ th { font-size: 16px; } +// Utility classes + .scrollable { overflow-x: auto; } + +.flex-spread { + display: flex; + justify-content: space-between; + align-items: baseline; +} diff --git a/payroll/templates/payroll/page/edit_payroll.html b/payroll/templates/payroll/page/edit_payroll.html index 889be098..81334061 100644 --- a/payroll/templates/payroll/page/edit_payroll.html +++ b/payroll/templates/payroll/page/edit_payroll.html @@ -10,7 +10,13 @@ {% endblock breadcrumbs %} {% block content %} -

Edit payroll

+
+

Edit payroll

+ {# This assumes that a user with access to payroll also has access to forecast #} + {% if settings.PAYROLL.ENABLE_FORECAST %} + Go to Forecast + {% endif %} +