Skip to content

Commit b79158f

Browse files
authored
Merge pull request #4063 from davidfischer/update-rtd-gold-marketing
Update Gold Member marketing
2 parents 6615154 + 08e3591 commit b79158f

File tree

12 files changed

+120
-21
lines changed

12 files changed

+120
-21
lines changed

docs/ethical-advertising.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ Opting Out
135135

136136
We have added multiple ways to opt out of the advertising on Read the Docs.
137137

138+
Users can go ad-free for as long as they are logged-in
139+
by becoming a `Gold Member of Read the Docs <https://readthedocs.org/accounts/gold/>`_.
140+
138141
Users can opt out of seeing paid advertisements on documentation pages:
139142

140143
* Go to the drop down user menu in the top right of the Read the Docs dashboard and clicking **Settings** (https://readthedocs.org/accounts/edit/).

docs/support.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ Good questions for Stack Overflow would be:
1717
Community Support
1818
-----------------
1919

20-
Read the Docs is a community supported site,
21-
nobody is paid to handle readthedocs.org support.
22-
We are hoping to bring in enough money with our `Gold`_ program to change that,
23-
so please sign up if you are able.
20+
Read the Docs is supported by community contributions and advertising.
21+
We hope to bring in enough money
22+
with our `Gold`_ and `Ethical Ads`_ programs to keep Read the Docs sustainable.
2423

2524
**All people answering your questions are doing it with their own time,
2625
so please be kind and provide as much information as possible.**
@@ -58,5 +57,5 @@ or read more at https://readthedocs.com/services/#open-source-support.
5857

5958
.. _Stack Overflow: http://stackoverflow.com/questions/tagged/read-the-docs
6059
.. _Github Issue Tracker: https://github.com/rtfd/readthedocs.org/issues
61-
.. _sign up: https://readthedocs.org/accounts/gold/
6260
.. _Gold: https://readthedocs.org/accounts/gold/
61+
.. _Ethical Ads: https://docs.readthedocs.io/en/latest/ethical-advertising.html

readthedocs/core/context_processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ def readthedocs_processor(request):
1414
'DASHBOARD_ANALYTICS_CODE': getattr(settings, 'DASHBOARD_ANALYTICS_CODE'),
1515
'SITE_ROOT': getattr(settings, 'SITE_ROOT', '') + '/',
1616
'TEMPLATE_ROOT': getattr(settings, 'TEMPLATE_ROOT', '') + '/',
17+
'USE_PROMOS': getattr(settings, 'USE_PROMOS', False),
1718
}
1819
return exports

readthedocs/core/forms.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from builtins import object
99

1010
from django import forms
11-
from django.conf import settings
1211
from django.contrib.auth.models import User
1312
from django.forms.fields import CharField
1413
from django.utils.translation import ugettext_lazy as _
@@ -26,8 +25,6 @@ class Meta(object):
2625
model = UserProfile
2726
# Don't allow users edit someone else's user page
2827
fields = ['first_name', 'last_name', 'homepage']
29-
if settings.USE_PROMOS:
30-
fields.append('allow_ads')
3128

3229
def __init__(self, *args, **kwargs):
3330
super(UserProfileForm, self).__init__(*args, **kwargs)
@@ -68,6 +65,12 @@ def clean_username(self):
6865
return data
6966

7067

68+
class UserAdvertisingForm(forms.ModelForm):
69+
class Meta(object):
70+
model = UserProfile
71+
fields = ['allow_ads']
72+
73+
7174
class FacetField(forms.MultipleChoiceField):
7275

7376
"""

readthedocs/gold/templates/gold/subscription_form.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ <h2>Read the Docs Gold</h2>
5959
we suggest giving at least $20/month to help cover our support and operations costs.
6060
{% endblocktrans %}
6161
</p>
62+
63+
<p>{% trans 'Becoming a Gold Member also makes Read the Docs ad-free for as long as you are logged-in.' %}</p>
64+
6265
<p>
6366
{% blocktrans %}
6467
You can also make one-time donations on our <a href="https://readthedocs.org/sustainability/">sustainability</a> page.

readthedocs/profiles/urls/private.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
'template_name': 'profiles/private/edit_profile.html',
1919
},
2020
name='profiles_profile_edit'),
21-
url(r'^delete/', views.delete_account, name='delete_account')
21+
url(r'^delete/', views.delete_account, name='delete_account'),
22+
url(r'^advertising/$', views.account_advertising, name='account_advertising'),
2223
]

readthedocs/profiles/views.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
from django.http import Http404, HttpResponseRedirect
1414
from django.shortcuts import get_object_or_404, redirect, render
1515
from django.template.context import RequestContext
16+
from django.utils.translation import ugettext_lazy as _
1617

17-
from readthedocs.core.forms import UserDeleteForm
18+
from readthedocs.core.forms import UserDeleteForm, UserAdvertisingForm
1819

1920

2021
def create_profile(
@@ -279,3 +280,35 @@ def profile_detail(
279280

280281
context.update({'profile': profile_obj})
281282
return render(request, template_name, context=context)
283+
284+
285+
@login_required
286+
def account_advertising(request):
287+
success_url = reverse(account_advertising)
288+
289+
try:
290+
profile_obj = request.user.profile
291+
except ObjectDoesNotExist:
292+
return HttpResponseRedirect(reverse('profiles_profile_create'))
293+
294+
if request.method == 'POST':
295+
form = UserAdvertisingForm(
296+
data=request.POST,
297+
instance=profile_obj,
298+
)
299+
if form.is_valid():
300+
form.save()
301+
messages.info(request, _('Updated your advertising preferences'))
302+
return HttpResponseRedirect(success_url)
303+
else:
304+
form = UserAdvertisingForm(instance=profile_obj)
305+
306+
return render(
307+
request,
308+
'profiles/private/advertising_profile.html',
309+
context={
310+
'form': form,
311+
'profile': profile_obj,
312+
'user': profile_obj.user,
313+
},
314+
)

readthedocs/templates/profiles/base_profile_edit.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ <h2>
5151
<li class="{% block profile-admin-change-email %}{% endblock %}"><a href="{% url 'account_email' %}">{% trans "Change Email" %}</a></li>
5252
<li class="{% block profile-admin-delete-account %}{% endblock %}"><a href="{% url 'delete_account' %}">{% trans "Delete Account" %}</a></li>
5353
<li class="{% block profile-admin-gold-edit %}{% endblock %}"><a href="{% url 'gold_detail' %}">{% trans "Gold" %}</a></li>
54+
{% if USE_PROMOS %}
55+
<li class="{% block profile-admin-advertising %}{% endblock %}"><a href="{% url 'account_advertising' %}">{% trans "Advertising" %}</a></li>
56+
{% endif %}
5457
{% endblock %}
5558
</ul>
5659
<div>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{% extends "profiles/base_profile_edit.html" %}
2+
3+
{% load i18n %}
4+
5+
{% block title %}{% trans "Set advertising preferences" %}{% endblock %}
6+
7+
{% block profile-admin-advertising %}active{% endblock %}
8+
9+
{% block edit_content_header %} {% trans "Set advertising preferences" %} {% endblock %}
10+
11+
{% block edit_content %}
12+
<p>
13+
{% blocktrans %}
14+
Read the Docs is an open source project.
15+
In order to maintain service, we rely on both the
16+
support of our users, and from sponsor support.
17+
{% endblocktrans %}
18+
</p>
19+
20+
<p>
21+
{% blocktrans %}
22+
For more details on advertising on Read the Docs
23+
including the privacy protections we have in place for users
24+
and community advertising we run on behalf of the open source community,
25+
see <a href="https://docs.readthedocs.io/en/latest/ethical-advertising.html">our documentation</a>.
26+
{% endblocktrans %}
27+
</p>
28+
29+
{% if request.user.gold.exists or request.user.goldonce.exists %}
30+
<p>
31+
{% blocktrans %}
32+
<strong>Note:</strong>
33+
Since you are a Gold Member or donor, you <strong>will not</strong> see advertising as long as you are logged-in.
34+
Thank you for supporting Read the Docs.
35+
{% endblocktrans%}
36+
</p>
37+
{% else %}
38+
<p>
39+
{% url "gold_detail" as gold_detail %}
40+
{% blocktrans %}
41+
You may remove ads completely by becoming a <a href="{{ gold_detail }}">Gold member to Read the Docs</a>.
42+
{% endblocktrans %}
43+
</p>
44+
{% endif %}
45+
46+
<form method="POST" action=".">
47+
{% csrf_token %}
48+
{{ form.as_p }}
49+
<input type="submit" name="submit" value="{% trans "Update advertisement preference" %}" id="submit"/>
50+
</form>
51+
{% endblock %}

readthedocs/templates/projects/project_advertising.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
{% block project_edit_content %}
1515
<p>
1616
{% blocktrans %}
17-
Read the Docs is an open source project, maintained and operated by
18-
full-time volunteers. In order to maintain service, we rely on both the
17+
Read the Docs is an open source project.
18+
In order to maintain service, we rely on both the
1919
support of our users, and from sponsor support.
2020
{% endblocktrans %}
2121
</p>
@@ -48,9 +48,10 @@
4848

4949
<p>
5050
{% blocktrans %}
51-
For more information on our stance on sponsor advertisements, we wrote
52-
more about our stance
53-
<a href="https://blog.readthedocs.com/ads-on-read-the-docs/">on our blog</a>.
51+
For more details on advertising on Read the Docs
52+
including the privacy protections we have in place for users
53+
and community advertising we run on behalf of the open source community,
54+
see <a href="https://docs.readthedocs.io/en/latest/ethical-advertising.html">our documentation</a>.
5455
{% endblocktrans %}
5556
</p>
5657

readthedocs/templates/projects/project_edit_base.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<li class="{% block project-subprojects-active %}{% endblock %}"><a href="{% url "projects_subprojects" project.slug %}">{% trans "Subprojects" %}</a></li>
2525
<li class="{% block project-integrations-active %}{% endblock %}"><a href="{% url "projects_integrations" project.slug %}">{% trans "Integrations" %}</a></li>
2626
<li class="{% block project-notifications-active %}{% endblock %}"><a href="{% url "projects_notifications" project.slug %}">{% trans "Notifications" %}</a></li>
27-
<li class="{% block project-ads-active %}{% endblock %}"><a href="{% url "projects_advertising" project.slug %}">{% trans "Advertising" %} </a></li>
27+
{% if USE_PROMOS %}
28+
<li class="{% block project-ads-active %}{% endblock %}"><a href="{% url "projects_advertising" project.slug %}">{% trans "Advertising" %} </a></li>
29+
{% endif %}
2830
</ul>
2931
<div>
3032
<h2>{% block project_edit_content_header %}{% endblock %}</h2>

readthedocs/templates/support.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
Community Support
2727
-----------------
2828

29-
Read the Docs is a community supported site,
30-
nobody is paid to handle readthedocs.org support.
31-
We are hoping to bring in enough money with our `Gold`_ program to change that,
32-
so please sign up if you are able.
29+
Read the Docs is supported by community contributions and advertising.
30+
We hope to bring in enough money
31+
with our `Gold`_ and `Ethical Ads`_ programs to keep Read the Docs sustainable.
3332

3433
**All people answering your questions are doing it with their own time,
3534
so please be kind and provide as much information as possible.**
@@ -67,8 +66,8 @@
6766

6867
.. _Stack Overflow: http://stackoverflow.com/questions/tagged/read-the-docs
6968
.. _Github Issue Tracker: https://github.com/rtfd/readthedocs.org/issues
70-
.. _sign up: https://readthedocs.org/accounts/gold/
7169
.. _Gold: https://readthedocs.org/accounts/gold/
70+
.. _Ethical Ads: https://docs.readthedocs.io/en/latest/ethical-advertising.html
7271

7372
{% endfilter %}
7473
</div>

0 commit comments

Comments
 (0)