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

Allow staying logged in for longer #4236

Merged
merged 5 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion readthedocs/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ class CommunityBaseSettings(Settings):
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = DEFAULT_FROM_EMAIL

# Cookies
# Sessions
SESSION_COOKIE_DOMAIN = 'readthedocs.org'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_AGE = 30 * 24 * 60 * 60 # 30 days
SESSION_SAVE_EVERY_REQUEST = True

# CSRF
CSRF_COOKIE_HTTPONLY = True
CSRF_COOKIE_AGE = 30 * 24 * 60 * 60

Expand Down
51 changes: 26 additions & 25 deletions readthedocs/templates/profiles/private/advertising_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,44 @@
{% 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.
Since you are a Gold Member or Supporter, you are <strong>ad-free</strong> for as long as you are logged-in.
Thank you for supporting Read the Docs.
{% endblocktrans%}
</p>
{% else %}
<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>

<p>
{% url "gold_detail" as gold_detail %}
{% url "donate" as donate_url %}
{% blocktrans %}
You may remove ads completely by becoming a <a href="{{ gold_detail }}">Gold member to Read the Docs</a>.
You can <strong>go ad-free</strong> by becoming a <a href="{{ gold_detail }}">Gold Member</a> or <a href="{{ donate_url }}">Supporter</a> of 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>
<form method="POST" action=".">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="submit" value="{% trans "Update advertisement preference" %}" id="submit"/>
</form>
{% endif %}
{% endblock %}