Skip to content

Commit

Permalink
Fix #910 - Add additional logic to only show 'Get unlimited button' t…
Browse files Browse the repository at this point in the history
…o PREMIUM_ENABLED flagged env
  • Loading branch information
maxxcrawford committed Jul 9, 2021
1 parent e95ca9a commit 4874a88
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
36 changes: 27 additions & 9 deletions privaterelay/templates/includes/dashboard-filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,35 @@
<form action="{% url 'emails-index' %}" class="dash-create" method="POST">
<input type="hidden" name="api_token" value="{{ user_profile.api_token }}">
{% if user_profile.at_max_free_aliases and not user_profile.has_unlimited %}
<a
href="{{ settings.FXA_SUBSCRIPTIONS_URL }}/products/{{ settings.PREMIUM_PROD_ID }}?plan={{ settings.PREMIUM_PRICE_ID }}"
target="_blank"
rel="noopener noreferrer"
class="btn btn-blue--ghost"
data-event-label="Upgrade"

{% if settings.PREMIUM_ENABLED %}
<a
href="{{ settings.FXA_SUBSCRIPTIONS_URL }}/products/{{ settings.PREMIUM_PROD_ID }}?plan={{ settings.PREMIUM_PRICE_ID }}"
target="_blank"
rel="noopener noreferrer"
class="btn btn-blue--ghost"
data-event-label="Upgrade"
>
<span class="generate-new-alias-text">
{% ftlmsg 'profile-label-upgrade' %}
</span>
</a>

{% else %}

<button
disabled
type="submit"
class="blue-btn-states dash-create-new-relay flx al-cntr jst-cntr btn-disabled"
title="{% ftlmsg 'profile-label-generate-new-alias' %}"
value="{% ftlmsg 'profile-label-generate-new-alias' %}"
>
<span class="generate-new-relay-icon"></span>
<span class="generate-new-alias-text">
{% ftlmsg 'profile-label-upgrade' %}
</span>
</a>
{% ftlmsg 'profile-label-generate-new-alias' %}</span>
</button>

{% endif %}

{% else %}
<button
Expand Down
1 change: 1 addition & 0 deletions static/scss/partials/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ button:active {

.btn-disabled {
opacity: 0.9;
cursor: not-allowed;
}

.sign-in {
Expand Down

0 comments on commit 4874a88

Please sign in to comment.