Skip to content

Commit

Permalink
Refactor: eligibility start copy (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran authored Sep 28, 2022
2 parents 8503218 + 9766990 commit 8b9066a
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 246 deletions.
5 changes: 3 additions & 2 deletions benefits/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.1 on 2022-09-02 18:15
# Generated by Django 4.1.1 on 2022-09-26 19:52

from django.db import migrations, models
import django.db.models.deletion
Expand Down Expand Up @@ -46,7 +46,8 @@ class Migration(migrations.Migration):
("jws_signing_alg", models.TextField(null=True)),
("selection_label", models.TextField()),
("selection_label_description", models.TextField(null=True)),
("start_content_title", models.TextField()),
("start_headline", models.TextField()),
("start_sub_headline", models.TextField()),
("start_item_name", models.TextField()),
("start_item_description", models.TextField()),
("start_blurb", models.TextField()),
Expand Down
53 changes: 28 additions & 25 deletions benefits/core/migrations/0002_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def load_sample_data(app, *args, **kwargs):
auth_provider=auth_provider,
selection_label=_("eligibility.pages.index.dmv.label"),
selection_label_description=None,
start_content_title=_("eligibility.pages.start.dmv.content_title"),
start_headline=_("eligibility.pages.start.dmv.title"),
start_sub_headline=_("eligibility.pages.start.dmv.content_title"),
start_item_name=_("eligibility.pages.start.dmv.items[0].title"),
start_item_description=_("eligibility.pages.start.dmv.items[0].text"),
start_blurb=_("eligibility.pages.start.dmv.p[0]"),
Expand Down Expand Up @@ -136,41 +137,43 @@ def load_sample_data(app, *args, **kwargs):
jwe_encryption_alg="RSA-OAEP",
jws_signing_alg="RS256",
auth_provider=None,
selection_label=_("eligibility.pages.index.mst.label"),
selection_label_description=_("eligibility.pages.index.mst.description"),
start_content_title=_("eligibility.pages.start.mst.content_title"),
start_item_name=_("eligibility.pages.start.mst.items[0].title"),
start_item_description=_("eligibility.pages.start.mst.items[0].text"),
start_blurb=_("eligibility.pages.start.mst.p[0]"),
form_title=_("eligibility.pages.confirm.mst.title"),
form_content_title=_("eligibility.pages.confirm.mst.content_title"),
form_blurb=_("eligibility.pages.confirm.mst.p[0]"),
form_sub_label=_("eligibility.forms.confirm.mst.fields.sub"),
form_sub_help_text=_("eligibility.forms.confirm.mst.fields.sub.help_text"),
selection_label=_("eligibility.pages.index.mst_cc.label"),
selection_label_description=_("eligibility.pages.index.mst_cc.description"),
start_headline=_("eligibility.pages.start.mst_cc.headline"),
start_sub_headline=_("eligibility.pages.start.mst_cc.sub_headline"),
start_item_name=_("eligibility.pages.start.mst_cc.items[0].title"),
start_item_description=_("eligibility.pages.start.mst_cc.items[0].text"),
start_blurb=_("eligibility.pages.start.mst_cc.p[0]"),
form_title=_("eligibility.pages.confirm.mst_cc.title"),
form_content_title=_("eligibility.pages.confirm.mst_cc.content_title"),
form_blurb=_("eligibility.pages.confirm.mst_cc.p[0]"),
form_sub_label=_("eligibility.forms.confirm.mst_cc.fields.sub"),
form_sub_help_text=_("eligibility.forms.confirm.mst_cc.fields.sub.help_text"),
form_sub_placeholder="TODO: B1234567",
form_sub_pattern=".+",
form_name_label=_("eligibility.forms.confirm.mst.fields.name"),
form_name_help_text=_("eligibility.forms.confirm.mst.fields.name.help_text"),
form_name_label=_("eligibility.forms.confirm.mst_cc.fields.name"),
form_name_help_text=_("eligibility.forms.confirm.mst_cc.fields.name.help_text"),
form_name_placeholder="Garcia",
form_name_max_length=255,
unverified_title=_("eligibility.pages.unverified.mst.title"),
unverified_content_title=_("eligibility.pages.unverified.mst.content_title"),
unverified_blurb=_("eligibility.pages.unverified.mst.p[0]"),
unverified_title=_("eligibility.pages.unverified.mst_cc.title"),
unverified_content_title=_("eligibility.pages.unverified.mst_cc.content_title"),
unverified_blurb=_("eligibility.pages.unverified.mst_cc.p[0]"),
)

EligibilityVerifier.objects.create(
name="OAuth claims via Login.gov",
eligibility_type=type1,
auth_provider=auth_provider,
selection_label=_("eligibility.pages.index.oauth.label"),
selection_label=_("eligibility.pages.index.mst_login.label"),
selection_label_description=None,
start_content_title=_("eligibility.pages.start.oauth.content_title"),
start_item_name=_("eligibility.pages.start.oauth.items[0].title"),
start_item_description=_("eligibility.pages.start.oauth.items[0].text"),
start_blurb=_("eligibility.pages.start.oauth.p[0]"),
unverified_title=_("eligibility.pages.unverified.oauth.title"),
unverified_content_title=_("eligibility.pages.unverified.oauth.content_title"),
unverified_blurb=_("eligibility.pages.unverified.oauth.p[0]"),
start_headline=_("eligibility.pages.start.mst_login.headline"),
start_sub_headline=_("eligibility.pages.start.mst_login.sub_headline"),
start_item_name=_("eligibility.pages.start.mst_login.items[0].title"),
start_item_description=_("eligibility.pages.start.mst_login.items[0].text"),
start_blurb=_("eligibility.pages.start.mst_login.p[0]"),
unverified_title=_("eligibility.pages.unverified.mst_login.title"),
unverified_content_title=_("eligibility.pages.unverified.mst_login.content_title"),
unverified_blurb=_("eligibility.pages.unverified.mst_login.p[0]"),
)

PaymentProcessor = app.get_model("core", "PaymentProcessor")
Expand Down
3 changes: 2 additions & 1 deletion benefits/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class EligibilityVerifier(models.Model):
auth_provider = models.ForeignKey(AuthProvider, on_delete=models.PROTECT, null=True)
selection_label = models.TextField()
selection_label_description = models.TextField(null=True)
start_content_title = models.TextField()
start_headline = models.TextField()
start_sub_headline = models.TextField()
start_item_name = models.TextField()
start_item_description = models.TextField()
start_blurb = models.TextField()
Expand Down
11 changes: 2 additions & 9 deletions benefits/eligibility/templates/eligibility/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

{% block main_content %}
<div class="container">
<h1 class="headline">{% translate "eligibility.pages.start.content_title" %}</h1>
<p>{% blocktranslate with info_link=info_link%}eligibility.pages.start.p[0]{{ info_link }}{% endblocktranslate %}</p>
<p>{% translate "eligibility.pages.start.p[1]" %}</p>
<h1 class="headline">{{ start_headline }}</h1>

<h2 class="media-title">{{ title }}</h2>
<h2 class="media-title">{{ start_sub_headline }}</h2>

{% block media_list %}
{% if media|length_is:"0" %}
Expand All @@ -29,11 +27,6 @@ <h3 class="media-body--heading">{{ item.heading }}</h3>
</ul>
</div>
</div>
<div class="media-body--links">
{% for l in item.links %}
{% include "core/includes/button.html" with button=l %}
{% endfor %}
</div>
</div>
</li>
{% endfor %}
Expand Down
19 changes: 6 additions & 13 deletions benefits/eligibility/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def start(request):
identity_item["links"] = [
viewmodels.Button.link(
classes="btn-text btn-link",
text=_("eligibility.pages.start.oauth.link_text"),
text=_("eligibility.pages.start.mst_login.link_text"),
url=f"{reverse(ROUTE_HELP)}#login-gov",
),
]
identity_item["bullets"] = [
_("eligibility.pages.start.oauth.required_items[0]"),
_("eligibility.pages.start.oauth.required_items[1]"),
_("eligibility.pages.start.oauth.required_items[2]"),
_("eligibility.pages.start.mst_login.required_items[0]"),
_("eligibility.pages.start.mst_login.required_items[1]"),
_("eligibility.pages.start.mst_login.required_items[2]"),
]

if not session.logged_in(request):
Expand All @@ -108,13 +108,6 @@ def start(request):
icon=viewmodels.Icon("bankcardcheck", pgettext("image alt text", "core.icons.bankcardcheck")),
heading=_("eligibility.pages.start.bankcard.title"),
details=_("eligibility.pages.start.bankcard.text"),
links=[
viewmodels.Button.link(
classes="btn-text btn-link",
text=_("eligibility.pages.start.bankcard.button[0].link"),
url=f"{reverse(ROUTE_HELP)}#payment-options",
),
],
)

media = [identity_item, bank_card_item]
Expand All @@ -126,9 +119,9 @@ def start(request):
)

ctx = page.context_dict()
ctx["title"] = _(verifier.start_content_title)
ctx["start_headline"] = _(verifier.start_headline)
ctx["start_sub_headline"] = _(verifier.start_sub_headline)
ctx["media"] = media
ctx["info_link"] = f"{reverse(ROUTE_HELP)}#about"

return TemplateResponse(request, TEMPLATE_START, ctx)

Expand Down
Loading

0 comments on commit 8b9066a

Please sign in to comment.