Use the actual defaults from settings.py when showing the defaults on /accounts/settings/.

- Legacy-Id: 14941
This commit is contained in:
Henrik Levkowetz 2018-03-26 17:10:28 +00:00
parent 8a4406bd81
commit 7e7fadb75e
2 changed files with 5 additions and 4 deletions

View file

@ -9,6 +9,7 @@ def preferences(request, **kwargs):
preferences = request.COOKIES.copy()
new_cookies = {}
del_cookies = []
preferences['defaults'] = settings.USER_PREFERENCE_DEFAULTS
for key in settings.USER_PREFERENCE_DEFAULTS.keys():
if key in kwargs:
if kwargs[key] == None:

View file

@ -17,7 +17,7 @@
<h2>How many days is considered "new"?</h2>
<p>This setting affects how many days are considered "new enough" to get the special highlighting in the documents table. Default setting is 14 days.</p>
<p>This setting affects how many days are considered "new enough" to get the special highlighting in the documents table. The default setting is {{ defaults.new_enough }} days.</p>
<div class="btn-group btn-group-justified">
<a class="btn btn-default {% if new_enough == '7' %}active{% endif %}" href="/accounts/settings/new_enough/7">7 days</a>
@ -30,7 +30,7 @@
<h2 class="ietf-divider">How many days is considered "soon"?</h2>
<p>This setting tells what is considered "soon" when showing documents that are going to be expire soon. Default setting is 14 days.</p>
<p>This setting tells what is considered "soon" when showing documents that are going to be expire soon. The Default setting is {{ defaults.expires_soon }} days.</p>
<div class="btn-group btn-group-justified">
<a class="btn btn-default {% if expires_soon == '7' %}active{% endif %}" href="/accounts/settings/expires_soon/7">7 days</a>
@ -43,7 +43,7 @@
<h2 class="ietf-divider">Show full document text by default?</h2>
<p>Show the full text immediately on the document page instead of only showing beginning of it. This defaults to off.</p>
<p>Show the full text immediately on the document page instead of only showing beginning of it. This defaults to {{ defaults.full_draft }}.</p>
<div class="btn-group btn-group-justified">
<a class="btn btn-default {% if full_draft == 'off' %}active{% endif %}" href="/accounts/settings/full_draft/off">Off</a>
@ -52,7 +52,7 @@
<h2 class="ietf-divider">Show the left-hand menu?</h2>
<p>Show the left-hand menu on all regular pages? This defaults to on.</p>
<p>Show the left-hand menu on all regular pages? This defaults to {{ defaults.left_menu }}.</p>
<div class="btn-group btn-group-justified">
<a class="btn btn-default {% if left_menu == 'off' %}active{% endif %}" href="/accounts/settings/left_menu/off">Off</a>