-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from guidance-guarantee-programme/web-variant
Templates for rendering a digital summary document
- Loading branch information
Showing
7 changed files
with
131 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Output | ||
module Templates | ||
module SectionSelectors | ||
class Generic | ||
include Output::Templates::SupplementarySectionable | ||
|
||
def call(output_document) | ||
[ | ||
:header, | ||
:getting_started, | ||
:options_overview, | ||
:generic_guidance, | ||
:inheritance_tax, | ||
:scams, | ||
supplementary_sections(output_document), | ||
:further_guidance, | ||
:footer | ||
].flatten | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Output | ||
module Templates | ||
module SectionSelectors | ||
class GenericNaked | ||
include Output::Templates::SupplementarySectionable | ||
|
||
def call(output_document) | ||
[ | ||
:getting_started, | ||
:options_overview, | ||
:generic_guidance, | ||
:inheritance_tax, | ||
:scams, | ||
supplementary_sections(output_document), | ||
:further_guidance | ||
].flatten | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
lib/output/templates/section_selectors/supplementary_sectionable.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Output | ||
module Templates | ||
module SupplementarySectionable | ||
SUPPLEMENTARY_SECTIONS = %i( | ||
supplementary_benefits | ||
supplementary_debt | ||
supplementary_ill_health | ||
supplementary_defined_benefit_pensions | ||
) | ||
|
||
def supplementary_sections(output_document) | ||
SUPPLEMENTARY_SECTIONS.select { |c| output_document.public_send(c) } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Output | ||
module Templates | ||
VERSION = '4.0.0' | ||
VERSION = '4.1.0' | ||
end | ||
end |