Skip to content

Commit aaa3ade

Browse files
authored
Merge pull request #6073 from readthedocs/davidfischer/gold-makes-ad-free-again
Gold makes projects ad-free again
2 parents 19cd521 + a84c4f3 commit aaa3ade

20 files changed

+98
-144
lines changed

docs/advertising/ad-blocking.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Going ad-free
5353
-------------
5454

5555
Users can go completely ad-free
56-
by becoming a `Gold Member <https://readthedocs.org/accounts/gold/>`_
56+
by becoming a `Gold member <https://readthedocs.org/accounts/gold/>`_
5757
or a `Supporter <https://readthedocs.org/sustainability/#donations>`_.
5858
Thank you for supporting Read the Docs.
5959

docs/advertising/ethical-advertising.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ Opting Out
156156
We have added multiple ways to opt out of the advertising on Read the Docs.
157157

158158
1. You can go completely ad-free
159-
by becoming a `Gold Member <https://readthedocs.org/accounts/gold/>`_
159+
by becoming a `Gold member <https://readthedocs.org/accounts/gold/>`_
160160
or a `Supporter <https://readthedocs.org/sustainability/#donations>`_.
161+
Additionally, Gold members may remove advertising from their projects for all visitors.
161162

162163
2. You can opt out of seeing paid advertisements on documentation pages:
163164

@@ -182,5 +183,4 @@ We have added multiple ways to opt out of the advertising on Read the Docs.
182183
but our commercial plans don't seem like the right fit,
183184
please `get in touch`_ to discuss alternatives to advertising.
184185

185-
.. _paid plans: https://readthedocs.com/pricing/
186186
.. _get in touch: mailto:[email protected]?subject=Alternatives%20to%20advertising

docs/advertising/index.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ that respects user privacy.
2222

2323
We recognize that advertising is not for everyone.
2424
You may :ref:`opt out of paid advertising <advertising/ethical-advertising:Opting Out>`
25-
-- you will still see :ref:`community ads <advertising/ethical-advertising:Community Ads>` --
26-
or you can go ad-free by `becoming a Gold Member`_ or a `Supporter`_ of Read the Docs.
25+
although you will still see :ref:`community ads <advertising/ethical-advertising:Community Ads>`.
26+
You can go ad-free by `becoming a Gold member`_ or a `Supporter`_ of Read the Docs.
27+
Gold members can also remove advertising from their projects for all visitors.
2728

2829
For businesses looking to remove advertising,
2930
please consider :doc:`Read the Docs for Business </commercial/index>`.
3031

31-
.. _becoming a Gold Member: https://readthedocs.org/accounts/gold/
32+
.. _becoming a Gold member: https://readthedocs.org/accounts/gold/
3233
.. _Supporter: https://readthedocs.org/sustainability/#donations
3334

3435
.. toctree::

docs/privacy-policy.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ and we encourage you to check back periodically.
166166
Payment processing
167167
++++++++++++++++++
168168

169-
Should you choose to become a `Supporter`_, purchase a `Gold Membership`_,
169+
Should you choose to become a `Supporter`_, purchase a `Gold membership`_,
170170
or become a subscriber to Read the Docs' commercial hosting product,
171171
your payment information and details will be processed by Stripe.
172172
Read the Docs does not store your payment information.
173173

174-
.. _Gold Membership: https://readthedocs.org/accounts/gold/
174+
.. _Gold membership: https://readthedocs.org/accounts/gold/
175175
.. _Supporter: https://readthedocs.org/sustainability/
176176

177177
Site monitoring

media/css/core.css

+5-2
Original file line numberDiff line numberDiff line change
@@ -873,9 +873,12 @@ div.donate-stats h2 {
873873
margin: .5em 0em 1.5em 0em;
874874
}
875875

876+
#content ul.donate-about {
877+
margin-bottom: 1em;
878+
}
876879
ul.donate-about li {
877-
margin-left: 1em;
878-
list-style: inside;
880+
margin-left: 1.5em;
881+
list-style: initial;
879882
}
880883

881884
div.donate-stats-sm form {

readthedocs/gold/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
A Django app for Gold Membership.
4+
A Django app for Gold membership.
55
6-
Gold Membership is Read the Docs' program for recurring, monthly donations.
6+
Gold membership is Read the Docs' program for recurring, monthly donations.
77
"""
88
default_app_config = 'readthedocs.gold.apps.GoldAppConfig'

readthedocs/gold/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
"""Django admin configuration for the Gold Membership app."""
3+
"""Django admin configuration for the Gold membership app."""
44

55
from django.contrib import admin
66

readthedocs/gold/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
"""Django app configuration for the Gold Membership app."""
3+
"""Django app configuration for the Gold membership app."""
44

55
from django.apps import AppConfig
66

readthedocs/gold/models.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# -*- coding: utf-8 -*-
2-
3-
"""Django models for recurring donations aka Gold Membership."""
1+
"""Django models for recurring donations aka Gold membership."""
42
import math
53
from datetime import datetime
64

@@ -27,10 +25,7 @@
2725

2826
class GoldUser(models.Model):
2927

30-
"""A user subscription for gold membership."""
31-
32-
# Gold members created after this date can no longer sponsor projects to be ad-free
33-
SPONSOR_PROJECT_CUTOFF = pytz.utc.localize(datetime(year=2019, month=5, day=1))
28+
"""A user subscription for Gold membership."""
3429

3530
pub_date = models.DateTimeField(_('Publication date'), auto_now_add=True)
3631
modified_date = models.DateTimeField(_('Modified date'), auto_now=True)
@@ -66,9 +61,3 @@ def num_supported_projects(self):
6661
dollars = int(self.level.split('-')[-1])
6762
num_projects = int(math.floor(dollars // DOLLARS_PER_PROJECT))
6863
return num_projects
69-
70-
def can_sponsor_projects(self):
71-
if self.pub_date < self.SPONSOR_PROJECT_CUTOFF or self.projects.exists():
72-
return True
73-
74-
return False

readthedocs/gold/templates/gold/projects.html

+33-33
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,53 @@
44

55
{% block profile-admin-gold-edit %}active{% endblock %}
66

7-
{% block title %}
8-
Gold Projects
9-
{% endblock %}
7+
{% block title %}{% trans "Gold Projects" %}{% endblock %}
108

119

1210
{% block edit_content %}
1311

14-
<p class="empty">
12+
<h3>{% trans "Gold Projects" %}</h3>
13+
<p>
1514
{% blocktrans trimmed %}
16-
<strong>Note:</strong> this is a legacy feature.
17-
New gold members cannot sponsor projects to be ad-free.
15+
Gold members may completely remove advertising for all visitors to their projects.
1816
{% endblocktrans %}
1917
</p>
2018

21-
<p class="help_text">
22-
{% trans "Choose projects that will have all promos removed, and extra features added to them. You get to pick one for every $5/mo you support Read the Docs with." %}
23-
</p>
24-
25-
<h3> {% trans "Existing Projects" %} </h3>
26-
<p>
27-
{% blocktrans trimmed count projects=gold_user.num_supported_projects %}
28-
You can adopt one project with your subscription.
29-
{% plural %}
30-
You can adopt {{ projects }} projects with your subscription.
31-
{% endblocktrans %}
32-
</p>
19+
<ul class="donate-about">
20+
<li>{% trans 'For small businesses or personal projects, we ask for $5 per month to remove ads from a project.' %}</li>
21+
<li>{% trans 'For corporate supported open source projects, we ask for a $50 membership in order to cover our support and operations costs.' %}</li>
22+
</ul>
3323

34-
<ul>
35-
{% for project in projects %}
24+
<h3>{% trans 'Ad-free projects' %}</h3>
25+
<ul class="donate-about">
26+
{% for project in projects %}
3627
<li>
37-
<a href="{{ project.get_absolute_url }}">
38-
{{ project }}
39-
</a>
40-
(<a href="{% url "gold_projects_remove" project.slug %}">{% trans "Remove" %}</a>)
28+
<a href="{{ project.get_absolute_url }}">{{ project }}</a>
29+
<span>(<a href="{% url "gold_projects_remove" project.slug %}">{% trans "Remove Ad-Free Status" %}</a>)</span>
4130
</li>
42-
{% endfor %}
31+
{% empty %}
32+
<p>{% trans 'No projects are currently ad-free.' %}</p>
33+
{% endfor %}
4334
</ul>
4435

45-
<h3>{% trans "Add a project" %}</h3>
46-
<p>
47-
{% trans "Choose which project you would like to add." %}
48-
</p>
49-
<form method="post" action=".">{% csrf_token %}
50-
{{ form.as_p }}
36+
<h3>{% trans "Make a project ad-free" %}</h3>
37+
{% if gold_user.num_supported_projects > projects|length %}
38+
<p>
39+
{% trans "Choose which project you would like to make ad-free." %}
40+
</p>
41+
<form method="post" action=".">{% csrf_token %}
42+
{{ form.as_p }}
43+
<p>
44+
<input type="submit" value="{% trans "Make Project Ad-Free" %}">
45+
</p>
46+
</form>
47+
{% else %}
5148
<p>
52-
<input style="display: inline;" type="submit" value="{% trans "Submit" %}">
49+
{% blocktrans trimmed with gold_level=gold_user.get_level_display gold_projects_count=gold_user.num_supported_projects %}
50+
You can't make any more projects ad-free with your current Gold membership of {{ gold_level }}.
51+
You can either increase the level of your membership or change which projects you make ad-free.
52+
{% endblocktrans %}
5353
</p>
54-
</form>
54+
{% endif %}
5555

5656
{% endblock %}

readthedocs/gold/templates/gold/subscription_confirm_delete.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
{% block profile-admin-gold-edit %}active{% endblock %}
55

6-
{% block title %}Cancel Gold{% endblock %}
6+
{% block title %}Cancel Gold membership{% endblock %}
77

88
{% block edit_content %}
9-
<h2>Cancel Gold Subscription</h2>
9+
<h2>Cancel Gold membership</h2>
1010

1111
<p>
1212
{% blocktrans trimmed %}
13-
Are you sure you want to cancel your subscription?
13+
Are you sure you want to cancel your Gold membership?
1414
{% endblocktrans %}
1515
</p>
1616

1717
<form method="post" action="{% url "gold_cancel" %}">
1818
{% csrf_token %}
19-
<input type="submit" value="{% trans "Cancel Subscription" %}">
19+
<input type="submit" value="{% trans "Cancel Gold membership" %}">
2020
</form>
2121
{% endblock %}

readthedocs/gold/templates/gold/subscription_detail.html

+9-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{% block profile-admin-gold-edit %}active{% endblock %}
66

7-
{% block title %}{% trans "Gold Subscription" %}{% endblock %}
7+
{% block title %}{% trans "Gold Membership" %}{% endblock %}
88

99
{% block extra_scripts %}
1010
<script src="https://js.stripe.com/v2/" type="text/javascript"></script>
@@ -28,7 +28,7 @@
2828

2929
{% block edit_content %}
3030
<div class="gold-subscription">
31-
<h2>{% trans "Gold Subscription" %}</h2>
31+
<h2>{% trans "Gold Membership" %}</h2>
3232

3333
<p>
3434
{% blocktrans trimmed %}
@@ -47,26 +47,18 @@ <h2>{% trans "Gold Subscription" %}</h2>
4747
</p>
4848

4949
<form method="get" action="{% url "gold_subscription" %}" class="subscription-update">
50-
<button>{% trans "Update Subscription" %}</button>
50+
<button>{% trans "Update membership" %}</button>
5151
</form>
5252

5353
<form method="get" action="{% url "gold_cancel" %}" class="subscription-cancel">
54-
<button>{% trans "Cancel Subscription" %}</button>
54+
<button>{% trans "Cancel membership" %}</button>
5555
</form>
5656

57-
{% if golduser.can_sponsor_projects %}
58-
<h3>{% trans "Projects" %}</h3>
59-
<p class="subscription-projects">
60-
{% blocktrans trimmed count projects=golduser.num_supported_projects %}
61-
You can adopt one project with your subscription.
62-
{% plural %}
63-
You can adopt {{ projects }} projects with your subscription.
64-
{% endblocktrans %}
65-
</p>
57+
<h3>{% trans "Gold projects" %}</h3>
58+
<p class="subscription-projects">{% trans 'Choose projects you would like to make ad-free.' %}</p>
6659

67-
<form method="get" action="{% url "gold_projects" %}" class="subscription-projects">
68-
<button>{% trans "Select Projects" %}</button>
69-
</form>
70-
{% endif %}
60+
<form method="get" action="{% url "gold_projects" %}" class="subscription-projects">
61+
<button>{% trans "Select Projects" %}</button>
62+
</form>
7163
</div>
7264
{% endblock %}

readthedocs/gold/templates/gold/subscription_form.html

+13-30
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
{% block edit_content %}
3636
<div>
37-
<h2>Read the Docs Gold</h2>
37+
<h2>{% trans 'Read the Docs Gold Membership' %}</h2>
3838

3939
<p>
4040
{% blocktrans trimmed %}
@@ -43,53 +43,36 @@ <h2>Read the Docs Gold</h2>
4343
product.
4444
{% endblocktrans %}
4545
</p>
46+
4647
<p>
4748
{% blocktrans trimmed %}
48-
If you are an individual,
49-
feel free to give whatever feels right for the value you get out of Read the Docs.
49+
Becoming a Gold member makes Read the Docs ad-free when you are logged-in.
50+
Gold members may also completely remove advertising for all visitors to their projects.
5051
{% endblocktrans %}
5152
</p>
53+
54+
<ul class="donate-about">
55+
<li>{% trans 'For small businesses or personal projects, we ask for $5 per month to remove ads from a project.' %}</li>
56+
<li>{% trans 'For corporate supported open source projects, we ask for a $50 membership in order to cover our support and operations costs.' %}</li>
57+
</ul>
58+
5259
<p>
5360
{% blocktrans trimmed %}
5461
If you are a company using Read the Docs,
5562
please consider <a href="https://readthedocs.com/">Read the Docs for Business</a>.
5663
This will help us cover our costs,
5764
and provide you with a better experience on the site.
58-
If you aren't able to do that,
59-
we suggest giving at least $20/month to help cover our support and operations costs.
6065
{% endblocktrans %}
6166
</p>
6267

63-
<p>{% trans 'Becoming a Gold Member also makes Read the Docs ad-free for as long as you are logged-in.' %}</p>
64-
65-
<p>
66-
{% blocktrans trimmed %}
67-
You can also make one-time donations on our <a href="https://readthedocs.org/sustainability/">sustainability</a> page.
68-
{% endblocktrans %}
69-
</p>
70-
71-
{% if domains.count %}
72-
<h3>Domains</h3>
7368
<p>
7469
{% blocktrans trimmed %}
75-
We ask that folks who use custom Domains give Read the Docs $5 per domain they are using.
76-
This is optional, but it really does help us maintain the site going forward.
70+
For any questions about our Gold membership program,
71+
please <a href="mailto:[email protected]?subject=Gold%20membership%20questions">email us</a>.
7772
{% endblocktrans %}
7873
</p>
7974

80-
<p>
81-
You are currently using {{ domains.count }} domains:
82-
83-
<ul class="donate-about">
84-
{% for domain in domains %}
85-
<li>{{ domain.domain }} ({{ domain.project.name }})</li>
86-
{% endfor %}
87-
</ul>
88-
</p>
89-
90-
{% endif %}
91-
92-
{% trans "Become a Gold Member" as subscription_title %}
75+
{% trans "Become a Gold member" as subscription_title %}
9376
{% if golduser %}
9477
{% trans "Update Your Subscription" as subscription_title %}
9578
{% endif %}

readthedocs/gold/views.py

-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ def projects(request):
103103
gold_user = get_object_or_404(GoldUser, user=request.user)
104104
gold_projects = gold_user.projects.all()
105105

106-
if not gold_user.can_sponsor_projects():
107-
messages.error(request, _('New gold users are no longer allowed to sponsor projects'))
108-
return HttpResponseRedirect(reverse('gold_detail'))
109-
110106
if request.method == 'POST':
111107
form = GoldProjectForm(
112108
active_user=request.user,

0 commit comments

Comments
 (0)