Skip to content

Commit

Permalink
Show BF banner until end of promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
acasajus committed Nov 30, 2023
1 parent f81f8ca commit 93fe538
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
4 changes: 3 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,10 @@ def format_datetime(value):

@app.context_processor
def inject_stage_and_region():
now = arrow.now()
return dict(
YEAR=arrow.now().year,
YEAR=now.year,
NOW=now,
URL=URL,
SENTRY_DSN=SENTRY_FRONT_END_DSN,
VERSION=SHA1,
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</head>
<body>
<div class="page">
{% if current_user.is_authenticated and current_user.should_show_upgrade_button() %}
{% if NOW.timestamp < 1701475201 and current_user.is_authenticated and current_user.should_show_upgrade_button() %}

<div class="alert alert-success text-center mb-0" role="alert">
Black Friday: $20 for the first year instead of $30. Available until December 1st.
Expand Down
29 changes: 16 additions & 13 deletions templates/dashboard/pricing.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,22 @@
{% endblock %}
{% block default_content %}

<div class="alert alert-info">
Black Friday Deal: 33% off on the yearly plan for the <b>first</b> year ($20 instead of $30).
<br>
Please use this coupon code
<em data-toggle="tooltip"
title="Click to copy"
class="clipboard"
data-clipboard-text="BF2023">BF2023</em> during the checkout.
<br>
<img src="/static/images/coupon.png" class="m-2" style="max-width: 300px">
<br>
Available until December 1, 2023.
</div>
{% if NOW.timestamp < 1701475201 %}

<div class="alert alert-info">
Black Friday Deal: 33% off on the yearly plan for the <b>first</b> year ($20 instead of $30).
<br>
Please use this coupon code
<em data-toggle="tooltip"
title="Click to copy"
class="clipboard"
data-clipboard-text="BF2023">BF2023</em> during the checkout.
<br>
<img src="/static/images/coupon.png" class="m-2" style="max-width: 300px">
<br>
Available until December 1, 2023.
</div>
{% endif %}
<div class="pb-8">
<div class="text-center mx-md-auto mb-8 mt-6">
<h1>Upgrade to unlock premium features</h1>
Expand Down

0 comments on commit 93fe538

Please sign in to comment.