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: remove eligibility item templates #2774

Merged
merged 5 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 0 additions & 8 deletions benefits/core/templates/core/includes/eligibility-item.html

This file was deleted.

28 changes: 20 additions & 8 deletions benefits/eligibility/context/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class CTAButton:
class EligibilityStart:
page_title: str
headline_text: str
eligibility_item_template: str
call_to_action_button: CTAButton
eligibility_item_headline: Optional[str] = None
eligibility_item_body: Optional[str] = None

def dict(self):
return asdict(self)
Expand All @@ -37,39 +38,49 @@ def __init__(self, page_title, headline_text):
super().__init__(
page_title=page_title,
headline_text=headline_text,
eligibility_item_template="eligibility/includes/eligibility-item--identification--start--login-gov.html",
call_to_action_button=CTAButton(
text=_("Get started with"), fallback_text="Login.gov", route=routes.OAUTH_LOGIN, extra_classes="login"
),
)


class AgencyCardEligibilityStart(EligibilityStart):
def __init__(self, headline_text, eligibility_item_template):
def __init__(self, headline_text, eligibility_item_headline, eligibility_item_body):
super().__init__(
page_title=_("Agency card overview"),
headline_text=headline_text,
eligibility_item_template=eligibility_item_template,
eligibility_item_headline=eligibility_item_headline,
eligibility_item_body=eligibility_item_body,
call_to_action_button=CTAButton(text=_("Continue"), route=routes.ELIGIBILITY_CONFIRM),
)


eligibility_start = {
SystemName.AGENCY_CARD.value: AgencyCardEligibilityStart(
headline_text=_("You selected an Agency Card transit benefit."),
eligibility_item_template="eligibility/includes/eligibility-item--identification--start--cst-agency-card.html",
eligibility_item_headline=_("Your current Agency Card number"),
eligibility_item_body=_(
"You do not need to have your physical CST Agency Card, but you will need to know the number."
),
),
SystemName.CALFRESH.value: LoginGovEligibilityStart(
page_title=_("CalFresh benefit overview"), headline_text=_("You selected a CalFresh Cardholder transit benefit.")
),
SystemName.COURTESY_CARD.value: AgencyCardEligibilityStart(
headline_text=_("You selected a Courtesy Card transit benefit."),
eligibility_item_template="eligibility/includes/eligibility-item--identification--start--mst-agency-card.html",
eligibility_item_headline=_("Your current Courtesy Card number"),
eligibility_item_body=_(
"You do not need to have your physical MST Courtesy Card, but you will need to know the number."
),
),
SystemName.MEDICARE.value: EligibilityStart(
page_title=_("Medicare benefit overview"),
headline_text=_("You selected a Medicare Cardholder transit benefit."),
eligibility_item_template="eligibility/includes/eligibility-item--identification--start--medicare.html",
eligibility_item_headline=_("An online account with Medicare.gov"),
eligibility_item_body=_(
"If you do not have an account you will be able to create one using your red, white, and blue Medicare card. "
"We use your Medicare.gov account to verify you qualify."
),
call_to_action_button=CTAButton(text=_("Continue to Medicare.gov"), route=routes.OAUTH_LOGIN),
),
SystemName.OLDER_ADULT.value: LoginGovEligibilityStart(
Expand All @@ -78,7 +89,8 @@ def __init__(self, headline_text, eligibility_item_template):
),
SystemName.REDUCED_FARE_MOBILITY_ID.value: AgencyCardEligibilityStart(
headline_text=_("You selected a Reduced Fare Mobility ID transit benefit."),
eligibility_item_template="eligibility/includes/eligibility-item--identification--start--sbmtd-agency-card.html",
eligibility_item_headline=_("Your current Reduced Fare Mobility ID number"),
eligibility_item_body=_("You do not need to have your physical card, but you will need to know the number."),
),
SystemName.VETERAN.value: LoginGovEligibilityStart(
page_title=_("Veterans benefit overview"), headline_text=_("You selected a Veteran transit benefit.")
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

36 changes: 34 additions & 2 deletions benefits/eligibility/templates/eligibility/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,40 @@ <h1>{{ headline_text }}</h1>
{% block inner-content %}
<p class="py-4">{% translate "You will need a few items to continue:" %}</p>
<ul class="d-flex flex-column gap-4 list-unstyled ps-0 mb-0">
{% include eligibility_item_template %}
{% include "eligibility/includes/eligibility-item--contactless-card--start.html" %}
<li>
<h2 class="h3 pb-1">
{% if eligibility_item_headline %}
{{ eligibility_item_headline }}
{% else %}
{% translate "A Login.gov account with identity verification" %}
{% endif %}
</h2>
{% if eligibility_item_body %}
<p>{{ eligibility_item_body }}</p>
{% else %}
<p>
{% translate "You will be able to create an account using your email address if you do not already have one. We use your Login.gov account to verify your identity." %}
{% translate "Learn more about identity verification" as text %}
{% include "core/includes/modal-trigger.html" with modal="modal--identity-verification" text=text period=True %}
</p>
<p>{% translate "For this process you will need:" %}</p>
<ul class="list-disc ms-lg-5 ms-0">
<li>{% translate "Your state-issued ID card" %}</li>
<li>{% translate "Your Social Security number" %}</li>
<li>{% translate "A phone number with a phone plan associated with your name" %}</li>
</ul>
{% include "eligibility/includes/modal--login-gov-start-help.html" with size="modal-lg" id="modal--identity-verification" header="p-md-2 p-3" body="pb-md-3 mb-md-3 mx-md-3 py-0 pt-0 absolute-top" %}
{% endif %}
</li>
<li>
<h2 class="h3 pb-1">{% translate "Your contactless card details" %}</h2>
<p>
{% translate "Your contactless card must be a debit or credit card by Visa or Mastercard." %}
{% translate "Learn more about contactless cards" as text %}
{% include "core/includes/modal-trigger.html" with modal="modal--contactless" text=text period=True %}
</p>
{% include "eligibility/includes/modal--contactless.html" with id="modal--contactless" size="modal-lg" header="p-md-2 p-3" body="pb-md-3 mb-md-3 mx-md-3 py-0 pt-0 absolute-top" %}
</li>
</ul>
{% endblock inner-content %}

Expand Down
Loading
Loading