forked from codeforamerica/ohana-web-search
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves terminology information box content to a config yaml file, which is fed into a partial when defined keywords are entered. Custom info boxes can be displayed by overriding the provided template.
- Loading branch information
1 parent
31720a1
commit 7e8468f
Showing
14 changed files
with
590 additions
and
65 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
%dl | ||
%dt | ||
= term['title'] | ||
%dd | ||
= term['description'] | ||
- if term['url'].present? | ||
%p | ||
= link_to "More info...", term['url'], :target => "_blank" |
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
# Show informational terminology definition boxes for certain keyword | ||
# searches. This can be helpful for such things as providing a definition | ||
# for the federal SNAP program when the user searches for "food stamps," | ||
# for example. | ||
# | ||
# To create an entry follow this format: | ||
# | ||
# '<main-keyword>' : | ||
# synonymns : | ||
# - '<synonymn1>' | ||
# - '<synonymn2>' | ||
# - '<synonymn3 ... >' | ||
# title: '<title for this term>' | ||
# description : | ||
# '<description of this term>' | ||
# url : '<where to go for more info>' | ||
# | ||
# The <main-keyword> and all the entries under 'synonyms' | ||
# will be keywords the user can search for to display the | ||
# info box. | ||
# | ||
# The info (title, description, url) will be fed into the | ||
# partial at app/views/component/terminology/_template.html.haml | ||
# | ||
# You can override the template partial by providing your | ||
# own partial in the app/views/component/terminology/ directory. | ||
# Give it the name _<main-keyword>.html.haml, with underscores | ||
# in place of spaces in the name. Such as _market_match.html.haml, | ||
# or _wic.html.haml. | ||
|
||
'wic' : | ||
synonymns : | ||
- 'women, infants, and children' | ||
- 'WIC/Women, Infants, & Children' | ||
title: Women, Infants, and Children | ||
description : | ||
Women, Infants, and Children (WIC) | ||
provides assistance for low-income pregnant, breastfeeding, and | ||
non-breastfeeding postpartum women, and to eligible infants and | ||
children up to age 5.. | ||
url : http://www.fns.usda.gov/wic | ||
|
||
'sfmnp' : | ||
synonymns : | ||
- "senior farmers' market nutrition program" | ||
- 'SFMNP/Food vouchers for seniors' | ||
title : "Senior Farmers' Market Nutrition Program" | ||
description : | ||
"Senior Farmers' Market Nutrition Program (SFMNP) | ||
provides low-income seniors with coupons that can be exchanged for eligible | ||
foods at farmers' markets, roadside stands, and community-supported | ||
agriculture programs." | ||
url : http://www.fns.usda.gov/sfmnp | ||
|
||
'calfresh' : | ||
synonymns : | ||
- 'food stamps' | ||
- 'snap' | ||
- 'calfresh/food stamps' | ||
title : CalFresh | ||
description : | ||
Known federally as SNAP (Supplemental Nutrition Assistance Program), | ||
CalFresh offers nutrition assistance to eligible, low income individuals | ||
and families and provides economic benefits to communities. | ||
url : http://www.calfresh.ca.gov | ||
|
||
'market match' : | ||
synonymns : '' | ||
title : Market Match | ||
description : | ||
"Market Match offers farmers’ market customers an extra $5 when they spend | ||
at least $10 on their CalFresh EBT card at participating farmer's markets." | ||
url : http://www.pcfma.com/pcfma_marketmatch.php | ||
|
||
'health care reform': | ||
synonymns : | ||
- 'aca' | ||
- 'affordable care act' | ||
- 'health insurance' |
55 changes: 55 additions & 0 deletions
55
spec/cassettes/terminology_search/with_keyword_that_returns_custom_terminology_info_box.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
spec/cassettes/terminology_search/with_keyword_that_returns_no_terminology_info_box.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.