Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gold Member marketing #4063

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/ethical-advertising.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ Opting Out

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

Users can go ad-free for as long as they are logged-in
by becoming a `Gold Member to Read the Docs <https://readthedocs.org/accounts/gold/>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason the to feels weird here. I guess it implies a subscription? That makes sense, just reads weird to me and I'm not 100% sure why.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think of is better than to.


Users can opt out of seeing paid advertisements on documentation pages:

* 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/).
Expand Down
9 changes: 4 additions & 5 deletions docs/support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ Good questions for Stack Overflow would be:
Community Support
-----------------

Read the Docs is a community supported site,
nobody is paid to handle readthedocs.org support.
We are hoping to bring in enough money with our `Gold`_ program to change that,
so please sign up if you are able.
Read the Docs is a community- and ad-supported site.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

community- is a bit odd here. I think maybe reword it:

Read the Docs is supported by community contributions and advertising.

We hope to bring in enough money
with our `Gold`_ and `Ethical Ads`_ programs to keep Read the Docs sustainable.

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

.. _Stack Overflow: http://stackoverflow.com/questions/tagged/read-the-docs
.. _Github Issue Tracker: https://github.com/rtfd/readthedocs.org/issues
.. _sign up: https://readthedocs.org/accounts/gold/
.. _Gold: https://readthedocs.org/accounts/gold/
.. _Ethical Ads: https://docs.readthedocs.io/en/latest/ethical-advertising.html
1 change: 1 addition & 0 deletions readthedocs/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ def readthedocs_processor(request):
'DASHBOARD_ANALYTICS_CODE': getattr(settings, 'DASHBOARD_ANALYTICS_CODE'),
'SITE_ROOT': getattr(settings, 'SITE_ROOT', '') + '/',
'TEMPLATE_ROOT': getattr(settings, 'TEMPLATE_ROOT', '') + '/',
'USE_PROMOS': getattr(settings, 'USE_PROMOS', False),
}
return exports
9 changes: 6 additions & 3 deletions readthedocs/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from builtins import object

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

def __init__(self, *args, **kwargs):
super(UserProfileForm, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -68,6 +65,12 @@ def clean_username(self):
return data


class UserAdvertisingForm(forms.ModelForm):
class Meta(object):
model = UserProfile
fields = ['allow_ads']


class FacetField(forms.MultipleChoiceField):

"""
Expand Down
3 changes: 3 additions & 0 deletions readthedocs/gold/templates/gold/subscription_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ <h2>Read the Docs Gold</h2>
we suggest giving at least $20/month to help cover our support and operations costs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like these other parts of the page are just blabbing in an awkward way also. I'm almost tempted to just remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a read and see if there's anything that should be removed. I tried to remove anything inaccurate already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think everything around domains can be deleted once we get Lets Encrypt support. I don't quite think I'll delete that yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would LE support change our infra cost for domains? If anything, it would increase the overhead we have for each domain we serve, managing the certs, etc.

{% endblocktrans %}
</p>

<p>{% trans 'Becoming a Gold Member also makes Read the Docs ad-free for as long as you are logged-in.' %}</p>

<p>
{% blocktrans %}
You can also make one-time donations on our <a href="https://readthedocs.org/sustainability/">sustainability</a> page.
Expand Down
3 changes: 2 additions & 1 deletion readthedocs/profiles/urls/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
'template_name': 'profiles/private/edit_profile.html',
},
name='profiles_profile_edit'),
url(r'^delete/', views.delete_account, name='delete_account')
url(r'^delete/', views.delete_account, name='delete_account'),
url(r'^advertising/$', views.account_advertising, name='account_advertising'),
]
34 changes: 33 additions & 1 deletion readthedocs/profiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from django.template.context import RequestContext
from django.utils.translation import ugettext_lazy as _

from readthedocs.core.forms import UserDeleteForm
from readthedocs.core.forms import UserDeleteForm, UserAdvertisingForm


def create_profile(
Expand Down Expand Up @@ -279,3 +280,34 @@ def profile_detail(

context.update({'profile': profile_obj})
return render(request, template_name, context=context)


def account_advertising(request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a login_requires decorator? Guessing it will blow up with a non-logged in user otherwise?

success_url = reverse(account_advertising)

try:
profile_obj = request.user.profile
except ObjectDoesNotExist:
return HttpResponseRedirect(reverse('profiles_profile_create'))

if request.method == 'POST':
form = UserAdvertisingForm(
data=request.POST,
instance=profile_obj,
)
if form.is_valid():
form.save()
messages.info(request, _('Updated your advertising preferences'))
return HttpResponseRedirect(success_url)
else:
form = UserAdvertisingForm(instance=profile_obj)

return render(
request,
'profiles/private/advertising_profile.html',
context={
'form': form,
'profile': profile_obj,
'user': profile_obj.user,
},
)
3 changes: 3 additions & 0 deletions readthedocs/templates/profiles/base_profile_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ <h2>
<li class="{% block profile-admin-change-email %}{% endblock %}"><a href="{% url 'account_email' %}">{% trans "Change Email" %}</a></li>
<li class="{% block profile-admin-delete-account %}{% endblock %}"><a href="{% url 'delete_account' %}">{% trans "Delete Account" %}</a></li>
<li class="{% block profile-admin-gold-edit %}{% endblock %}"><a href="{% url 'gold_detail' %}">{% trans "Gold" %}</a></li>
{% if USE_PROMOS %}
<li class="{% block profile-admin-advertising %}{% endblock %}"><a href="{% url 'account_advertising' %}">{% trans "Advertising" %}</a></li>
{% endif %}
{% endblock %}
</ul>
<div>
Expand Down
51 changes: 51 additions & 0 deletions readthedocs/templates/profiles/private/advertising_profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{% extends "profiles/base_profile_edit.html" %}

{% load i18n %}

{% block title %}{% trans "Set advertising preferences" %}{% endblock %}

{% block profile-admin-advertising %}active{% endblock %}

{% block edit_content_header %} {% trans "Set advertising preferences" %} {% endblock %}

{% block edit_content %}
<p>
{% blocktrans %}
Read the Docs is an open source project.
In order to maintain service, we rely on both the
support of our users, and from sponsor support.
{% endblocktrans %}
</p>

<p>
{% blocktrans %}
For more details on advertising on Read the Docs
including the privacy protections we have in place for users
and community advertising we run on behalf of the open source community,
see <a href="https://docs.readthedocs.io/en/latest/ethical-advertising.html">our documentation</a>.
{% endblocktrans %}
</p>

{% if request.user.gold.exists or request.user.goldonce.exists %}
<p>
{% blocktrans %}
<strong>Note:</strong>
Since you are a Gold Member or donor, you <strong>will not</strong> see advertising as long as you are logged-in.
Thank you for supporting Read the Docs.
{% endblocktrans%}
</p>
{% else %}
<p>
{% url "gold_detail" as gold_detail %}
{% blocktrans %}
You may remove ads completely by becoming a <a href="{{ gold_detail }}">Gold member to Read the Docs</a>.
{% endblocktrans %}
</p>
{% endif %}

<form method="POST" action=".">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="submit" value="{% trans "Update advertisement preference" %}" id="submit"/>
</form>
{% endblock %}
11 changes: 6 additions & 5 deletions readthedocs/templates/projects/project_advertising.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{% block project_edit_content %}
<p>
{% blocktrans %}
Read the Docs is an open source project, maintained and operated by
full-time volunteers. In order to maintain service, we rely on both the
Read the Docs is an open source project.
In order to maintain service, we rely on both the
support of our users, and from sponsor support.
{% endblocktrans %}
</p>
Expand Down Expand Up @@ -48,9 +48,10 @@

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

Expand Down
4 changes: 3 additions & 1 deletion readthedocs/templates/projects/project_edit_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
<li class="{% block project-subprojects-active %}{% endblock %}"><a href="{% url "projects_subprojects" project.slug %}">{% trans "Subprojects" %}</a></li>
<li class="{% block project-integrations-active %}{% endblock %}"><a href="{% url "projects_integrations" project.slug %}">{% trans "Integrations" %}</a></li>
<li class="{% block project-notifications-active %}{% endblock %}"><a href="{% url "projects_notifications" project.slug %}">{% trans "Notifications" %}</a></li>
<li class="{% block project-ads-active %}{% endblock %}"><a href="{% url "projects_advertising" project.slug %}">{% trans "Advertising" %} </a></li>
{% if USE_PROMOS %}
<li class="{% block project-ads-active %}{% endblock %}"><a href="{% url "projects_advertising" project.slug %}">{% trans "Advertising" %} </a></li>
{% endif %}
</ul>
<div>
<h2>{% block project_edit_content_header %}{% endblock %}</h2>
Expand Down
9 changes: 4 additions & 5 deletions readthedocs/templates/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
Community Support
-----------------

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

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

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

{% endfilter %}
</div>
Expand Down