Skip to content

Commit

Permalink
scaffolds for household info flow and script to generate scaffold tem…
Browse files Browse the repository at this point in the history
…plates (#314)
  • Loading branch information
lkemperman-cfa committed Sep 26, 2023
1 parent e80b1d1 commit aac7436
Show file tree
Hide file tree
Showing 33 changed files with 1,003 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/create-templates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#brew install yq
flowName="${1:-laDigitalAssister}"
flowIndex="${2:-1}"
templates=`ls -1 src/main/resources/templates/laDigitalAssister/*.html | cut -d'/' -f6-`
screens=( $(yq '[select(document_index == '"$flowIndex"') | .flow.*.nextScreens[0].name] | flatten' src/main/resources/flows-config.yaml) )
screenNames=( $( printf '%s\n' ${screens[@]} | egrep -v '^(---|-|null|\[*\])' ) )
for i in "${!screenNames[@]}"; do
if grep -q "${screenNames[$i]}.html" <<< "${templates[*]}"; then
echo "found ${screenNames[$i]} in templates"
else
echo "${screenNames[$i]} not in templates; creating one"
cat scripts/scaffold.html >> "src/main/resources/templates/${flowName}/${screenNames[$i]}.html"
fi
done
29 changes: 29 additions & 0 deletions scripts/scaffold.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
90 changes: 90 additions & 0 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,96 @@ flow:
nextScreens:
- name: householdInfo
householdInfo:
nextScreens:
- name: ssnForm
ssnForm:
nextScreens:
- name: ssnFaqs
ssnFaqs:
nextScreens:
- name: specialSituations
specialSituations:
nextScreens:
- name: school
school:
nextScreens:
- name: pregnancy
pregnancy:
nextScreens:
- name: outOfStateBenefits
outOfStateBenefits:
nextScreens:
- name: seasonalFarmWorker
seasonFarmWorker:
nextScreens:
- name: usCitizen
usCitizen:
nextScreens:
- name: householdCount
householdCount:
nextScreens:
- name: usVeteran
usVeteran:
nextScreens:
- name: fosterSystem
fosterSystem:
nextScreens:
- name: fosterCareUntilAdult
fosterCareUntilAdult:
nextScreens:
- name: rentedRoom
rentedRoom:
nextScreens:
- name: payForMeals
payForMeals:
nextScreens:
- name: minorNotInSchoolNotUpToDate
minorNotInSchoolNotUpToDate:
nextScreens:
- name: immunizationSchoolProof
immunizationSchoolProof:
nextScreens:
- name: requestChildcareHelp
requestChildcareHelp:
nextScreens:
- name: childCareWho
childCareWho:
nextScreens:
- name: childrenWithParentOutsideHome
childrenWithParentOutsideHome:
nextScreens:
- name: additionalParent
additionalParent:
nextScreens:
- name: custodyOfChild
custodyOfChild:
nextScreens:
- name: whoCustody
whoCustody:
nextScreens:
- name: parentsList
parentsList:
nextScreens:
- name: sensitiveQuestions
sensitiveQuestions:
nextScreens:
- name: personalSituations
personalSituations:
nextScreens:
- name: whichPersonalSituations
whichPersonalSituations:
nextScreens:
- name: moreInfoPersonalSituations
moreInfoPersonalSituations:
nextScreens:
- name: victimOfDomesticViolence
victimOfDomesticViolence:
nextScreens:
- name: sensitiveQuestionsCriminalJustice
sensitiveQuestionsCriminalJustice:
nextScreens:
- name: criminalJusticeSituations
criminalJusticeSituations:
nextScreens: null

subflows:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
29 changes: 29 additions & 0 deletions src/main/resources/templates/laDigitalAssister/childCareWho.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
29 changes: 29 additions & 0 deletions src/main/resources/templates/laDigitalAssister/custodyOfChild.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
29 changes: 29 additions & 0 deletions src/main/resources/templates/laDigitalAssister/fosterSystem.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>
29 changes: 29 additions & 0 deletions src/main/resources/templates/laDigitalAssister/householdCount.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}">
<head th:replace="fragments/head :: head(title='Scaffold')"></head>
<body>
<div class="page-wrapper">
<div th:replace="fragments/toolbar :: toolbar"></div>
<section class="slab">
<div class="grid">
<div th:replace="fragments/goBack :: goBackLink"></div>
<main id="content" role="main" class="form-card spacing-above-35">
<!-- <th:block-->
<!-- th:replace="'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})"/>-->
<th:block th:replace="'fragments/form' :: form(action=${formAction}, content=~{::formContent})">
<th:block th:ref="formContent">
<div class="form-card__content">

</div>
<div class="form-card__footer">

</div>
</th:block>
</th:block>
</main>
</div>
</section>
</div>
<th:block th:replace="fragments/footer :: footer" />
</body>
</html>

0 comments on commit aac7436

Please sign in to comment.