Skip to content

Commit

Permalink
Merge pull request #238 from DFE-Digital/feature/658-padding-adjustme…
Browse files Browse the repository at this point in the history
…nt-parameter

(658) Make padding a configurable parameter for actions
  • Loading branch information
jacksonj04 authored Oct 25, 2022
2 parents e610561 + 0554b8b commit 69585a9
Show file tree
Hide file tree
Showing 18 changed files with 209 additions and 89 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- The trust SharePoint link is shown on the project summary.
- Closed projects display their closed date on the project list
- Closed projects are sorted to the back of the project list
- Actions can have their padding (between previous action) explicitly reduced
using the new `padding` parameter.

#### Changed

Expand Down
21 changes: 14 additions & 7 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,27 @@ $govuk-global-styles: true;
}

.task-checkboxes {
.govuk-checkboxes__item {
margin-bottom: govuk-spacing(9);
}
}

.task-checkboxes,
.clear-legal-documents-task-checkboxes {
.govuk-checkboxes__item {
label {
@extend .govuk-\!-font-weight-bold;
}
}
}

.task-action__wrapper {
&:first-of-type {
margin-top: 0;
}

&__padding-normal {
margin-top: govuk-spacing(9);
}

&__padding-reduced {
margin-top: govuk-spacing(0);
}
}

.govuk-section-break--s {
@include govuk-responsive-margin(2, "top");
@include govuk-responsive-margin(2, "bottom");
Expand Down
1 change: 0 additions & 1 deletion app/controllers/tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class TasksController < ApplicationController
before_action :find_task_level_notes, only: :show

def show
render "tasks/clear_legal_documents/show" if @task.clear_legal_documents_type?
end

def update
Expand Down
6 changes: 0 additions & 6 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ class Task < ApplicationRecord
has_many :actions, dependent: :destroy
has_many :notes, dependent: :destroy

LEGAL_DOCUMENT_SECTION_TITLE = "Clear and sign legal documents"

default_scope { order(order: "asc") }

delegate :project, to: :section
Expand All @@ -17,10 +15,6 @@ def completed_actions_count
@completed_actions_count ||= actions.where(action_type: "single-checkbox").where(completed: true).count
end

def clear_legal_documents_type?
section.title == LEGAL_DOCUMENT_SECTION_TITLE
end

def status
return :not_applicable if not_applicable? && optional?

Expand Down
30 changes: 0 additions & 30 deletions app/views/tasks/clear_legal_documents/show.html.erb

This file was deleted.

32 changes: 18 additions & 14 deletions app/views/tasks/shared/_action_single-checkbox.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<%= form.govuk_check_boxes_fieldset "action-#{action.id}",
multiple: false,
legend: {text: action.title, hidden: true},
classes: "task-checkboxes" do %>
<%= form.govuk_check_box "action-#{action.id}",
1,
0,
name: "task[actions][#{action.id}]",
label: { text: action.title },
multiple: false,
link_errors: true,
checked: action.completed?,
hint: -> do %>
<%= yield %>
<%= render layout: "tasks/shared/action_wrapper", locals: {action: action} do %>

<%= form.govuk_check_boxes_fieldset "action-#{action.id}",
multiple: false,
legend: {text: action.title, hidden: true},
classes: "task-checkboxes" do %>
<%= form.govuk_check_box "action-#{action.id}",
1,
0,
name: "task[actions][#{action.id}]",
label: { text: action.title },
multiple: false,
link_errors: true,
checked: action.completed?,
hint: -> do %>
<%= yield %>
<% end %>
<% end %>

<% end %>
8 changes: 6 additions & 2 deletions app/views/tasks/shared/_action_subheading.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<h2 class="govuk-heading-l"><%= action.title %></h2>
<%= render layout: "tasks/shared/action_wrapper", locals: {action: action} do %>

<%= yield %>
<h2 class="govuk-heading-l"><%= action.title %></h2>

<%= yield %>

<% end %>
3 changes: 3 additions & 0 deletions app/views/tasks/shared/_action_wrapper.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="task-action__wrapper task-action__wrapper__padding-<%= action.padding || "normal" %>">
<%= yield %>
</div>
6 changes: 5 additions & 1 deletion app/views/tasks/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= form_for :task, url: project_task_path, method: :put do |form| %>

<%= render partial: "tasks/shared/not_applicable_checkbox", locals: {task: @task, form: form} %>

<% @task.actions.each do |action| %>
<%= render layout: "tasks/shared/action_#{action.action_type}", locals: {action: action, form: form} do %>

<%= render partial: "tasks/shared/action_hint", locals: {action: action} %>

<%= render partial: "tasks/shared/action_guidance_summary", locals: {action: action} %>

<% end %>
<% end %>

<%= form.govuk_submit %>

<% end %>
</div>

Expand Down
48 changes: 48 additions & 0 deletions app/workflows/lists/conversion/sections/clear-legal-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ tasks:
The answers given inform how the land will be treated. It decides which leases, directions and other land agreements are needed.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- slug: clear-and-sign-land-registry-title-plans
title: Land registry title plans
Expand All @@ -49,10 +53,13 @@ tasks:
Talk to your line manager or the relevant solicitor if you have questions about anything on the title plan.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder

- slug: clear-and-sign-supplemental-funding-agreement
Expand All @@ -76,21 +83,27 @@ tasks:
Supplemental funding agreements from 2020 onwards and Master funding agreements from 2018 onwards are compatible.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
hint: |
The Secretary of State, or somebody with the authority to act on their behalf, must sign the Supplemental funding agreement.
Usually this is your team leader or the deputy director.
- type: single-checkbox
padding: reduced
title: Sent to team leader or deputy director
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: clear-and-sign-church-supplemental-agreement
Expand All @@ -111,14 +124,19 @@ tasks:
You'll need to [contact the policy team (opens in new tab)](https://educationgovuk.sharepoint.com/sites/lvedfe00116/SitePages/Commissioning%20Form.aspx) about changes to clause text.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Signed by diocese
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
Expand All @@ -127,8 +145,10 @@ tasks:
Usually this is your team leader or the deputy director.
- type: single-checkbox
padding: reduced
title: Sent to team leader or deputy director
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: clear-and-sign-master-funding-agreement
Expand Down Expand Up @@ -156,12 +176,16 @@ tasks:
You will need to clear any new and updated documents. These may need a Deed of variation.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
Expand All @@ -175,8 +199,10 @@ tasks:
Once you've received the signed page, put it back in the document. Then save the signed Master funding agreement as a PDF in the school's SharePoint folder.
- type: single-checkbox
padding: reduced
title: Sent to team leader or deputy director
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: clear-and-sign-articles-of-association
Expand All @@ -196,12 +222,16 @@ tasks:
You'll need to [contact the policy team (opens in new tab)](https://educationgovuk.sharepoint.com/sites/lvedfe00116/SitePages/Commissioning%20Form.aspx) about changes to clause text.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder

- slug: clear-and-sign-deed-of-variation
Expand All @@ -220,21 +250,27 @@ tasks:
You'll need to [contact the policy team (opens in new tab)](https://educationgovuk.sharepoint.com/sites/lvedfe00116/SitePages/Commissioning%20Form.aspx) about changes to clause text.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by school or trust
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
hint: |
The Secretary of State, or somebody with the authority to act on their behalf, must sign the Deed of variation.
Usually this is your team leader or the deputy director.
- type: single-checkbox
padding: reduced
title: Sent to team leader or deputy director
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: clear-and-sign-trust-modification-order
Expand All @@ -261,12 +297,16 @@ tasks:
* voluntary-aided school
* foundation school
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Sent to Legal advisers office
- type: single-checkbox
padding: reduced
title: Cleared by Legal advisers office
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
Expand All @@ -285,8 +325,10 @@ tasks:
It can take several weeks to hear back from the Academies Operational
Practice Unit.
- type: single-checkbox
padding: reduced
title: Sent to Academies Operational Practice Unit
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: clear-and-sign-direction-to-transfer
Expand All @@ -309,12 +351,16 @@ tasks:
You'll need to [contact the policy team (opens in a new tab)](https://educationgovuk.sharepoint.com/sites/lvedfe00116/SitePages/Commissioning%20Form.aspx) about any changes to clause text.
- type: single-checkbox
padding: reduced
title: Received
- type: single-checkbox
padding: reduced
title: Cleared
- type: single-checkbox
padding: reduced
title: Signed by caseworker
- type: single-checkbox
padding: reduced
title: Saved in the school's SharePoint folder
- type: subheading
title: Signed by the Secretary of State
Expand All @@ -330,8 +376,10 @@ tasks:
It can take several weeks to hear back from the Academies Operational
Practice Unit.
- type: single-checkbox
padding: reduced
title: Sent to Academies Operational Practice Unit
- type: single-checkbox
padding: reduced
title: Document signed on behalf of the Secretary of State

- slug: commercial-transfer-agreement
Expand Down
Loading

0 comments on commit 69585a9

Please sign in to comment.