Skip to content

Commit

Permalink
Refactor: All modal triggers are now links, not buttons (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
machikoyasuda authored Aug 8, 2023
2 parents 119f9ce + 3a54e84 commit 02fc681
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 16 deletions.
2 changes: 0 additions & 2 deletions benefits/core/templates/core/includes/modal-trigger-link.html

This file was deleted.

6 changes: 4 additions & 2 deletions benefits/core/templates/core/includes/modal-trigger.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<!-- Button to trigger modal -->
<button type="button" class="{{ classes }}" data-bs-toggle="modal" data-bs-target="#{{ id }}">{{ text }}</button>
<!-- Inline link to trigger modal -->
{# djlint:off #}
<a href="#{{ modal }}" class="{{ classes }}" id="{{ id }}" data-bs-toggle="modal" data-bs-target="#{{ modal }}">{{ text }}{% if login %}<span class="fallback-text color-logo">Login.gov</span>{% endif %}</a>{% if period %}.{% endif %}
{# djlint:on #}
4 changes: 2 additions & 2 deletions benefits/core/templates/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% endblock headline %}

{% block call-to-action %}
{% translate "Choose your Provider" as trigger_text %}
{% include "core/includes/modal-trigger.html" with id="modal--agency-selector" classes="btn btn-lg btn-primary" text=trigger_text %}
{% translate "Choose your Provider" as text %}
{% include "core/includes/modal-trigger.html" with modal="modal--agency-selector" classes="btn btn-lg btn-primary" text=text period=False %}
{% include "core/includes/modal--agency-selector.html" with id="modal--agency-selector" %}
{% endblock call-to-action %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<div class="media-body--details">
<p>
{% translate "Your contactless card must be a debit or credit card by Visa or Mastercard." %}
{% translate "Learn more about contactless cards" as trigger_text %}
{% include "core/includes/modal-trigger-link.html" with id="modal--contactless" text=trigger_text %}
{% translate "Learn more about contactless cards" as text %}
{% include "core/includes/modal-trigger.html" with modal="modal--contactless" text=text period=True %}
</p>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<div class="media-body--details">
<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 trigger_text %}
{% include "core/includes/modal-trigger-link.html" with id="modal--identity-verification" text=trigger_text %}
{% translate "Learn more about identity verification" as text %}
{% include "core/includes/modal-trigger.html" with modal="modal--identity-verification" text=text period=True %}
</p>
<div class="media-body--items">
<p>{% translate "For this process you will need:" %}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
{% block description %}
{% translate "You must be 65 years or older. You will need to verify your identity with" %}

<!-- Button to trigger modal -->
<button id="login" type="button" class="border-0 bg-transparent p-0" data-bs-toggle="modal" data-bs-target="#modal--login-gov">
<span class="fallback-text color-logo">Login.gov</span>
</button>
.
{% include "core/includes/modal-trigger.html" with classes="border-0 bg-transparent p-0" id="login" modal="modal--login-gov" login=True period=True %}

{% include "eligibility/includes/modal--senior-help.html" with id="modal--login-gov" size="modal-lg" %}
{% endblock description %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<div class="media-body--details">
<p>
{% translate "You will be directed to our payment partner, " %}
{% include "core/includes/modal-trigger-link.html" with id="modal--littlepay" text="Littlepay" %}
{% translate "We don’t store your information, and you won’t be charged." %}
{% include "core/includes/modal-trigger.html" with modal="modal--littlepay" text="Littlepay" period=True %}
</p>
<p>{% translate "Please use a debit or credit card by Visa or Mastercard." %}</p>
</div>
Expand Down

0 comments on commit 02fc681

Please sign in to comment.