Skip to content

Commit fad2c31

Browse files
committed
Clean up promo JS
1 parent e6813a6 commit fad2c31

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

readthedocs/core/static-src/core/js/readthedocs-doc-embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $(document).ready(function () {
5959

6060
// Show promo selectively
6161
if (data.promo && build.show_promo()) {
62-
var promo = sponsorship.Promo.from_variant([
62+
var promo = sponsorship.Promo.from_variants([
6363
id=data.promo_data.id,
6464
text=data.promo_data.text,
6565
image=data.promo_data.image,

readthedocs/core/static/core/js/readthedocs-doc-embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ $(document).ready(function () {
9898

9999
// Show promo selectively
100100
if (data.promo && build.show_promo()) {
101-
var promo = sponsorship.Promo.from_variant([
101+
var promo = sponsorship.Promo.from_variants([
102102
id=data.promo_data.id,
103103
text=data.promo_data.text,
104104
image=data.promo_data.image,

readthedocs/restapi/views/footer_views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def footer_html(request):
6161
show_promo = False
6262

6363
promo_obj = SupporterPromo.objects.filter(live=True, display_type='doc').order_by('?').first()
64+
if not promo_obj:
65+
show_promo = False
6466

6567
context = Context({
6668
'project': project,

0 commit comments

Comments
 (0)