Skip to content

Commit

Permalink
refactor(eligibility): use home button include
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Jul 13, 2023
1 parent b28daa6 commit f1d4b2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 4 additions & 6 deletions benefits/eligibility/templates/eligibility/unverified.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
</div>

{% if agency_links %}
<div class="row justify-content-center">
<div class="col-lg-8">{% include "core/includes/agency-links.html" with buttons=agency_links %}</div>
</div>
<div class="row justify-content-center">
<div class="col-lg-8">{% include "core/includes/agency-links.html" with buttons=agency_links %}</div>
</div>
{% endif %}

{% if back_button %}
<div class="row pt-8 justify-content-center">
<div class="col-lg-3 col-8">{% include "core/includes/button.html" with button=back_button %}</div>
<div class="col-lg-3 col-8">{% include "core/includes/button--home.html" %}</div>
</div>
{% endif %}

</div>
{% endblock main_content %}
5 changes: 1 addition & 4 deletions benefits/eligibility/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def index(request, agency=None):
# see if session has an agency
agency = session.agency(request)
if agency is None:
home = viewmodels.Button.home(request)
page = viewmodels.ErrorPage.user_error(button=home, path=request.path)
page = viewmodels.ErrorPage.user_error(path=request.path)
return TemplateResponse(request, "200_user_error.html", page.context_dict())
else:
session.update(request, eligibility_types=[], origin=agency.index_url)
Expand Down Expand Up @@ -183,7 +182,6 @@ def unverified(request):
analytics.returned_fail(request, types_to_verify)

agency_links = viewmodels.Button.agency_contact_links(agency)
back_button = viewmodels.Button.home(request)

page = viewmodels.Page(
title=_(verifier.unverified_title),
Expand All @@ -194,6 +192,5 @@ def unverified(request):

ctx = page.context_dict()
ctx["agency_links"] = agency_links
ctx["back_button"] = back_button

return TemplateResponse(request, TEMPLATE_UNVERIFIED, ctx)

0 comments on commit f1d4b2e

Please sign in to comment.