Skip to content

Commit

Permalink
FFT-179 Add a link to go from Edit Payroll to Edit Forecast (#618)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Dudley <samuel.dudley@digital.trade.gov.uk>
Co-authored-by: Sam Dudley <dudley.co.uk@gmail.com>
  • Loading branch information
3 people authored Feb 12, 2025
1 parent d40be6a commit 147a329
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions forecast/templates/forecast/edit/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

{% block title %}Edit Forecast{% endblock %}

{% block page_heading %}
<div style="display: flex; align-items: baseline; gap: 2rem;">
{{ block.super }}
{% can_access_edit_payroll user as user_can_access_edit_payroll %}
{% if user_can_access_edit_payroll and settings.PAYROLL.ENABLE_FORECAST %}
<a class="govuk-link" href="{% url 'payroll:edit' view.cost_centre_details.cost_centre_code view.financial_year %}">Go to Payroll</a>
{% endif %}
</div>
{% endblock %}

{% block page_content %}
<div class="govuk-grid-row date-selection-download">

Expand Down
4 changes: 3 additions & 1 deletion forecast/templates/forecast/edit/forecast_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ <h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title
</div>
</div>
{% endif %}
<h1 class="govuk-heading-l">{{ view.title }}</h1>
{% block page_heading %}
<h1 class="govuk-heading-l">{{ view.title }}</h1>
{% endblock page_heading %}
<a href="{% url 'forecast_cost_centre' view.cost_centre_details.cost_centre_code view.financial_year %}" target="_blank" class="govuk-heading-m cost-centre-heading-link">{{ view.cost_centre_details.cost_centre_name }} ({{ view.cost_centre_details.cost_centre_code }}) </a>
<dl class="govuk-summary-list">
<div class="govuk-summary-list__row">
Expand Down
8 changes: 8 additions & 0 deletions front_end/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
8 changes: 7 additions & 1 deletion payroll/templates/payroll/page/edit_payroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
{% endblock breadcrumbs %}

{% block content %}
<h1 class="govuk-heading-l">Edit payroll</h1>
<div class="flex-spread">
<h1 class="govuk-heading-l">Edit payroll</h1>
{# This assumes that a user with access to payroll also has access to forecast #}
{% if settings.PAYROLL.ENABLE_FORECAST %}
<a class="govuk-link" href="{% url 'edit_forecast' cost_centre_code financial_year %}">Go to Forecast</a>
{% endif %}
</div>

<div id="payroll-app"></div>

Expand Down

0 comments on commit 147a329

Please sign in to comment.