-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the button text on place finders
This an accessibility fix required by the DAC audit: Update the button text from "Find" to "Find results near you" For one place page, the Find a register office, the new button text is "Find a register office". The code uses the content of the publication title to determine that this is the find a register service, rather than checking the base_path or content id, which would be the usual way of doing it. This is intentional, because the button text only makes sense on this page if the title matches. If in the future the title of this publication changes, the button text will revert to the more generic "Find results near you". If we were checking basepath and the page title changed, the button text would drift out of sync.
- Loading branch information
Showing
5 changed files
with
35 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
module LocationFormHelper | ||
def button_text(publication_format = nil) | ||
def button_text(publication_format = nil, publication_title = nil) | ||
case publication_format | ||
when "local_transaction", "licence" | ||
I18n.t("formats.local_transaction.find_council") | ||
when "place" | ||
places_button_text(publication_title) | ||
else | ||
I18n.t("find") | ||
end | ||
end | ||
|
||
def places_button_text(publication_title) | ||
publication_title == "Find a register office" ? publication_title : I18n.t("formats.place.find_results") | ||
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
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