Skip to content

Commit

Permalink
Merge pull request #6073 from readthedocs/davidfischer/gold-makes-ad-…
Browse files Browse the repository at this point in the history
…free-again

Gold makes projects ad-free again
  • Loading branch information
ericholscher authored Aug 20, 2019
2 parents 19cd521 + a84c4f3 commit aaa3ade
Show file tree
Hide file tree
Showing 20 changed files with 98 additions and 144 deletions.
2 changes: 1 addition & 1 deletion docs/advertising/ad-blocking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Going ad-free
-------------

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

Expand Down
4 changes: 2 additions & 2 deletions docs/advertising/ethical-advertising.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ Opting Out
We have added multiple ways to opt out of the advertising on Read the Docs.

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

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

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

.. _paid plans: https://readthedocs.com/pricing/
.. _get in touch: mailto:ads@readthedocs.org?subject=Alternatives%20to%20advertising
7 changes: 4 additions & 3 deletions docs/advertising/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ that respects user privacy.

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

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

.. _becoming a Gold Member: https://readthedocs.org/accounts/gold/
.. _becoming a Gold member: https://readthedocs.org/accounts/gold/
.. _Supporter: https://readthedocs.org/sustainability/#donations

.. toctree::
Expand Down
4 changes: 2 additions & 2 deletions docs/privacy-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ and we encourage you to check back periodically.
Payment processing
++++++++++++++++++

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

.. _Gold Membership: https://readthedocs.org/accounts/gold/
.. _Gold membership: https://readthedocs.org/accounts/gold/
.. _Supporter: https://readthedocs.org/sustainability/

Site monitoring
Expand Down
7 changes: 5 additions & 2 deletions media/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,12 @@ div.donate-stats h2 {
margin: .5em 0em 1.5em 0em;
}

#content ul.donate-about {
margin-bottom: 1em;
}
ul.donate-about li {
margin-left: 1em;
list-style: inside;
margin-left: 1.5em;
list-style: initial;
}

div.donate-stats-sm form {
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/gold/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

"""
A Django app for Gold Membership.
A Django app for Gold membership.
Gold Membership is Read the Docs' program for recurring, monthly donations.
Gold membership is Read the Docs' program for recurring, monthly donations.
"""
default_app_config = 'readthedocs.gold.apps.GoldAppConfig'
2 changes: 1 addition & 1 deletion readthedocs/gold/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

"""Django admin configuration for the Gold Membership app."""
"""Django admin configuration for the Gold membership app."""

from django.contrib import admin

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/gold/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

"""Django app configuration for the Gold Membership app."""
"""Django app configuration for the Gold membership app."""

from django.apps import AppConfig

Expand Down
15 changes: 2 additions & 13 deletions readthedocs/gold/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-

"""Django models for recurring donations aka Gold Membership."""
"""Django models for recurring donations aka Gold membership."""
import math
from datetime import datetime

Expand All @@ -27,10 +25,7 @@

class GoldUser(models.Model):

"""A user subscription for gold membership."""

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

pub_date = models.DateTimeField(_('Publication date'), auto_now_add=True)
modified_date = models.DateTimeField(_('Modified date'), auto_now=True)
Expand Down Expand Up @@ -66,9 +61,3 @@ def num_supported_projects(self):
dollars = int(self.level.split('-')[-1])
num_projects = int(math.floor(dollars // DOLLARS_PER_PROJECT))
return num_projects

def can_sponsor_projects(self):
if self.pub_date < self.SPONSOR_PROJECT_CUTOFF or self.projects.exists():
return True

return False
66 changes: 33 additions & 33 deletions readthedocs/gold/templates/gold/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@

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

{% block title %}
Gold Projects
{% endblock %}
{% block title %}{% trans "Gold Projects" %}{% endblock %}


{% block edit_content %}

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

<p class="help_text">
{% 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." %}
</p>

<h3> {% trans "Existing Projects" %} </h3>
<p>
{% blocktrans trimmed count projects=gold_user.num_supported_projects %}
You can adopt one project with your subscription.
{% plural %}
You can adopt {{ projects }} projects with your subscription.
{% endblocktrans %}
</p>
<ul class="donate-about">
<li>{% trans 'For small businesses or personal projects, we ask for $5 per month to remove ads from a project.' %}</li>
<li>{% trans 'For corporate supported open source projects, we ask for a $50 membership in order to cover our support and operations costs.' %}</li>
</ul>

<ul>
{% for project in projects %}
<h3>{% trans 'Ad-free projects' %}</h3>
<ul class="donate-about">
{% for project in projects %}
<li>
<a href="{{ project.get_absolute_url }}">
{{ project }}
</a>
(<a href="{% url "gold_projects_remove" project.slug %}">{% trans "Remove" %}</a>)
<a href="{{ project.get_absolute_url }}">{{ project }}</a>
<span>(<a href="{% url "gold_projects_remove" project.slug %}">{% trans "Remove Ad-Free Status" %}</a>)</span>
</li>
{% endfor %}
{% empty %}
<p>{% trans 'No projects are currently ad-free.' %}</p>
{% endfor %}
</ul>

<h3>{% trans "Add a project" %}</h3>
<p>
{% trans "Choose which project you would like to add." %}
</p>
<form method="post" action=".">{% csrf_token %}
{{ form.as_p }}
<h3>{% trans "Make a project ad-free" %}</h3>
{% if gold_user.num_supported_projects > projects|length %}
<p>
{% trans "Choose which project you would like to make ad-free." %}
</p>
<form method="post" action=".">{% csrf_token %}
{{ form.as_p }}
<p>
<input type="submit" value="{% trans "Make Project Ad-Free" %}">
</p>
</form>
{% else %}
<p>
<input style="display: inline;" type="submit" value="{% trans "Submit" %}">
{% blocktrans trimmed with gold_level=gold_user.get_level_display gold_projects_count=gold_user.num_supported_projects %}
You can't make any more projects ad-free with your current Gold membership of {{ gold_level }}.
You can either increase the level of your membership or change which projects you make ad-free.
{% endblocktrans %}
</p>
</form>
{% endif %}

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

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

{% block title %}Cancel Gold{% endblock %}
{% block title %}Cancel Gold membership{% endblock %}

{% block edit_content %}
<h2>Cancel Gold Subscription</h2>
<h2>Cancel Gold membership</h2>

<p>
{% blocktrans trimmed %}
Are you sure you want to cancel your subscription?
Are you sure you want to cancel your Gold membership?
{% endblocktrans %}
</p>

<form method="post" action="{% url "gold_cancel" %}">
{% csrf_token %}
<input type="submit" value="{% trans "Cancel Subscription" %}">
<input type="submit" value="{% trans "Cancel Gold membership" %}">
</form>
{% endblock %}
26 changes: 9 additions & 17 deletions readthedocs/gold/templates/gold/subscription_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

{% block title %}{% trans "Gold Subscription" %}{% endblock %}
{% block title %}{% trans "Gold Membership" %}{% endblock %}

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

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

<p>
{% blocktrans trimmed %}
Expand All @@ -47,26 +47,18 @@ <h2>{% trans "Gold Subscription" %}</h2>
</p>

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

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

{% if golduser.can_sponsor_projects %}
<h3>{% trans "Projects" %}</h3>
<p class="subscription-projects">
{% blocktrans trimmed count projects=golduser.num_supported_projects %}
You can adopt one project with your subscription.
{% plural %}
You can adopt {{ projects }} projects with your subscription.
{% endblocktrans %}
</p>
<h3>{% trans "Gold projects" %}</h3>
<p class="subscription-projects">{% trans 'Choose projects you would like to make ad-free.' %}</p>

<form method="get" action="{% url "gold_projects" %}" class="subscription-projects">
<button>{% trans "Select Projects" %}</button>
</form>
{% endif %}
<form method="get" action="{% url "gold_projects" %}" class="subscription-projects">
<button>{% trans "Select Projects" %}</button>
</form>
</div>
{% endblock %}
43 changes: 13 additions & 30 deletions readthedocs/gold/templates/gold/subscription_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

{% block edit_content %}
<div>
<h2>Read the Docs Gold</h2>
<h2>{% trans 'Read the Docs Gold Membership' %}</h2>

<p>
{% blocktrans trimmed %}
Expand All @@ -43,53 +43,36 @@ <h2>Read the Docs Gold</h2>
product.
{% endblocktrans %}
</p>

<p>
{% blocktrans trimmed %}
If you are an individual,
feel free to give whatever feels right for the value you get out of Read the Docs.
Becoming a Gold member makes Read the Docs ad-free when you are logged-in.
Gold members may also completely remove advertising for all visitors to their projects.
{% endblocktrans %}
</p>

<ul class="donate-about">
<li>{% trans 'For small businesses or personal projects, we ask for $5 per month to remove ads from a project.' %}</li>
<li>{% trans 'For corporate supported open source projects, we ask for a $50 membership in order to cover our support and operations costs.' %}</li>
</ul>

<p>
{% blocktrans trimmed %}
If you are a company using Read the Docs,
please consider <a href="https://readthedocs.com/">Read the Docs for Business</a>.
This will help us cover our costs,
and provide you with a better experience on the site.
If you aren't able to do that,
we suggest giving at least $20/month to help cover our support and operations costs.
{% 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 trimmed %}
You can also make one-time donations on our <a href="https://readthedocs.org/sustainability/">sustainability</a> page.
{% endblocktrans %}
</p>

{% if domains.count %}
<h3>Domains</h3>
<p>
{% blocktrans trimmed %}
We ask that folks who use custom Domains give Read the Docs $5 per domain they are using.
This is optional, but it really does help us maintain the site going forward.
For any questions about our Gold membership program,
please <a href="mailto:rev@readthedocs.org?subject=Gold%20membership%20questions">email us</a>.
{% endblocktrans %}
</p>

<p>
You are currently using {{ domains.count }} domains:

<ul class="donate-about">
{% for domain in domains %}
<li>{{ domain.domain }} ({{ domain.project.name }})</li>
{% endfor %}
</ul>
</p>

{% endif %}

{% trans "Become a Gold Member" as subscription_title %}
{% trans "Become a Gold member" as subscription_title %}
{% if golduser %}
{% trans "Update Your Subscription" as subscription_title %}
{% endif %}
Expand Down
4 changes: 0 additions & 4 deletions readthedocs/gold/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ def projects(request):
gold_user = get_object_or_404(GoldUser, user=request.user)
gold_projects = gold_user.projects.all()

if not gold_user.can_sponsor_projects():
messages.error(request, _('New gold users are no longer allowed to sponsor projects'))
return HttpResponseRedirect(reverse('gold_detail'))

if request.method == 'POST':
form = GoldProjectForm(
active_user=request.user,
Expand Down
Loading

0 comments on commit aaa3ade

Please sign in to comment.