From eff1ca6250902d302368e05ef431f0394d5fefe7 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Thu, 3 Feb 2022 15:45:49 +0000 Subject: [PATCH] Enable section descriptions and add note about privacy notice --- README.md | 1 + app/models/form/section.rb | 3 ++- app/views/case_logs/_tasklist.html.erb | 3 +++ config/forms/2021_2022.json | 1 + spec/fixtures/forms/2021_2022.json | 1 + spec/models/form/section_spec.rb | 4 ++++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fea5097e..f75b018c9 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ The JSON should follow the structure: "sections": { "[snake_case_section_name_string]": { "label": String, + "description": String, "subsections": { "[snake_case_subsection_name_string]": { "label": String, diff --git a/app/models/form/section.rb b/app/models/form/section.rb index 477fc9f18..b99325f90 100644 --- a/app/models/form/section.rb +++ b/app/models/form/section.rb @@ -1,9 +1,10 @@ class Form::Section - attr_accessor :id, :label, :subsections, :form + attr_accessor :id, :label, :description, :subsections, :form def initialize(id, hsh, form) @id = id @label = hsh["label"] + @description = hsh["description"] @form = form @subsections = hsh["subsections"].map { |s_id, s| Form::Subsection.new(s_id, s, self) } end diff --git a/app/views/case_logs/_tasklist.html.erb b/app/views/case_logs/_tasklist.html.erb index 85a8d6349..8d20a0cee 100644 --- a/app/views/case_logs/_tasklist.html.erb +++ b/app/views/case_logs/_tasklist.html.erb @@ -6,6 +6,9 @@ <%= section.label %> + <% if section.description %> +

<%= section.description.html_safe %>

+ <% end %>