Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: agency index #430

Merged
merged 5 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions benefits/core/templates/core/agency_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends 'core/page.html' %}
{% load i18n %}

{% block container_content %}
<h1>{{ page.content_title }}</h1>

<p>{% blocktranslate with info_link=info_link%}core.pages.agency_index.p[0]{{ info_link }}{% endblocktranslate %}</p>
<p>{% translate "core.pages.agency_index.p[1]" %}</p>

{% block buttons%}
{{ block.super }}
{% endblock buttons %}

{% endblock container_content %}
13 changes: 9 additions & 4 deletions benefits/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ def agency_index(request, agency):
session.reset(request)
session.update(request, agency=agency, origin=agency.index_url)

button = viewmodels.Button.primary(text=_("core.pages.index.continue"), url=reverse("eligibility:index"))
button.label = _("core.pages.agency_index.button.label")

page = viewmodels.Page(
content_title=_index_content_title(),
paragraphs=_index_paragraphs(),
button=viewmodels.Button.primary(text=_("core.pages.index.continue"), url=reverse("eligibility:index")),
content_title=_("core.pages.agency_index.content_title"),
button=button,
classes="home",
)

return PageTemplateResponse(request, page)
help_page = reverse("core:help")
context_dict = {**page.context_dict(), **{"info_link": f"{help_page}#about"}}

return TemplateResponse(request, "core/agency_index.html", context_dict)


@middleware.pageview_decorator
Expand Down
19 changes: 18 additions & 1 deletion benefits/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,23 @@ msgstr ""
"The new way to pay for transit makes it easier to get your discount every "
"time you ride"

msgid "core.pages.agency_index.content_title"
msgstr ""
"Cal-ITP Benefits makes it easy to use your public transit discount "
"every time you ride."

msgid "core.pages.agency_index.p[0]%(info_link)s"
msgstr "With new contactless payment options, you can tap "
"your bank-issued contactless credit or debit card when you "
"board, and your discount will automatically apply every "
"time you ride. <a href=\"%(info_link)s\">Learn more about Cal-ITP Benefits.</a>"

msgid "core.pages.agency_index.p[1]"
msgstr "The Cal-ITP Benefits program is currently only open to those <strong>ages 65 or older</strong>."

msgid "core.pages.agency_index.button.label"
msgstr "Verify your discount and connect your bank card today!"

#: benefits/core/views.py:25
msgctxt "image alt text"
msgid "core.pages.index.image"
Expand Down Expand Up @@ -273,7 +290,7 @@ msgstr "Choose your transit provider"

#: benefits/core/views.py:70
msgid "core.pages.index.continue"
msgstr "Let’s do it!"
msgstr "Get started"
machikoyasuda marked this conversation as resolved.
Show resolved Hide resolved

#: benefits/core/views.py:86 benefits/core/views.py:106
msgid "core.buttons.back"
Expand Down
17 changes: 17 additions & 0 deletions benefits/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,23 @@ msgstr ""
"La nueva forma de pagar el transporte público hace que sea más fácil obtener "
"su descuento cada vez que viaja"

msgid "core.pages.agency_index.content_title"
angela-tran marked this conversation as resolved.
Show resolved Hide resolved
msgstr ""
"TODO: Cal-ITP Benefits makes it easy to use your public transit discount "
"every time you ride."

msgid "core.pages.agency_index.p[0]%(info_link)s"
msgstr "TODO: With new contactless payment options, you can tap "
"your bank-issued contactless credit or debit card when you "
"board, and your discount will automatically apply every "
"time you ride. <a href=\"%(info-link)s\">Learn more about Cal-ITP Benefits.</a>"

msgid "core.pages.agency_index.p[1]"
msgstr "TODO: The Cal-ITP Benefits program is currently only open to those <strong>ages 65 or older</strong>."

msgid "core.pages.agency_index.button.label"
msgstr "TODO: Verify your discount and connect your bank card today!"

#: benefits/core/views.py:25
msgctxt "image alt text"
msgid "core.pages.index.image"
Expand Down