Skip to content

Commit cadedce

Browse files
committed
Port cookies/ away from use of |equal filter, remove |equal filter
- Legacy-Id: 6776
1 parent 19da33d commit cadedce

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,6 @@ def expires_soon(x,request):
410410
days = 14
411411
return x > -days
412412

413-
@register.filter(name='equal')
414-
def equal(x, y):
415-
return str(x)==str(y)
416-
417413
@register.filter(name='startswith')
418414
def startswith(x, y):
419415
return unicode(x).startswith(y)

ietf/templates/cookies/settings.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block title %}User settings{% endblock %}
55
{% block content %}
66

7-
<h2>Cookie settings for the ietf datatracker.</h2>
7+
<h2>Cookie settings for the IETF datatracker</h2>
88

99
<p> Following settings are implemented using cookies, so if you have
1010
cookies disabled then you are not able to change the settings
@@ -22,12 +22,12 @@ <h2 class="ietf-divider">How many days is considered new</h2>
2222
</td>
2323
</tr>
2424
<tr class="settings-values">
25-
<td>{% if new_enough|equal:"7" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/7">7 days</a></span>{%else%}<a href="/cookies/new_enough/7">7 days</a>{% endif %}</td></td>
26-
<td>{% if new_enough|equal:"14" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/14">14 days</a></span>{%else%}<a href="/cookies/new_enough/14">14 days</a>{% endif %}</td>
27-
<td>{% if new_enough|equal:"21" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/21">21 days</a></span>{%else%}<a href="/cookies/new_enough/21">21 days</a>{% endif %}</td>
28-
<td>{% if new_enough|equal:"30" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/30">30 days</a></span>{%else%}<a href="/cookies/new_enough/30">30 days</a>{% endif %}</td>
29-
<td>{% if new_enough|equal:"60" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/60">60 days</a></span>{%else%}<a href="/cookies/new_enough/60">60 days</a>{% endif %}</td>
30-
<td>{% if new_enough|equal:"90" %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/90">90 days</a></span>{%else%}<a href="/cookies/new_enough/90">90 days</a>{% endif %}</td>
25+
<td>{% if new_enough == 7 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/7">7 days</a></span>{%else%}<a href="/cookies/new_enough/7">7 days</a>{% endif %}</td></td>
26+
<td>{% if new_enough == 14 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/14">14 days</a></span>{%else%}<a href="/cookies/new_enough/14">14 days</a>{% endif %}</td>
27+
<td>{% if new_enough == 21 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/21">21 days</a></span>{%else%}<a href="/cookies/new_enough/21">21 days</a>{% endif %}</td>
28+
<td>{% if new_enough == 30 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/30">30 days</a></span>{%else%}<a href="/cookies/new_enough/30">30 days</a>{% endif %}</td>
29+
<td>{% if new_enough == 60 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/60">60 days</a></span>{%else%}<a href="/cookies/new_enough/60">60 days</a>{% endif %}</td>
30+
<td>{% if new_enough == 90 %}<span class="ietf-highlight-y"><a href="/cookies/new_enough/90">90 days</a></span>{%else%}<a href="/cookies/new_enough/90">90 days</a>{% endif %}</td>
3131
</tr>
3232

3333
<tr class="setting-header">
@@ -41,12 +41,12 @@ <h2 class="ietf-divider">How many days is considered soon</h2>
4141
</td>
4242
</tr>
4343
<tr class="settings-values">
44-
<td>{% if expires_soon|equal:"7" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/7">7 days</a></span>{%else%}<a href="/cookies/expires_soon/7">7 days</a>{% endif %}</td></td>
45-
<td>{% if expires_soon|equal:"14" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/14">14 days</a></span>{%else%}<a href="/cookies/expires_soon/14">14 days</a>{% endif %}</td>
46-
<td>{% if expires_soon|equal:"21" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/21">21 days</a></span>{%else%}<a href="/cookies/expires_soon/21">21 days</a>{% endif %}</td>
47-
<td>{% if expires_soon|equal:"30" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/30">30 days</a></span>{%else%}<a href="/cookies/expires_soon/30">30 days</a>{% endif %}</td>
48-
<td>{% if expires_soon|equal:"60" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/60">60 days</a></span>{%else%}<a href="/cookies/expires_soon/60">60 days</a>{% endif %}</td>
49-
<td>{% if expires_soon|equal:"90" %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/90">90 days</a></span>{%else%}<a href="/cookies/expires_soon/90">90 days</a>{% endif %}</td>
44+
<td>{% if expires_soon == 7 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/7">7 days</a></span>{%else%}<a href="/cookies/expires_soon/7">7 days</a>{% endif %}</td></td>
45+
<td>{% if expires_soon == 14 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/14">14 days</a></span>{%else%}<a href="/cookies/expires_soon/14">14 days</a>{% endif %}</td>
46+
<td>{% if expires_soon == 21 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/21">21 days</a></span>{%else%}<a href="/cookies/expires_soon/21">21 days</a>{% endif %}</td>
47+
<td>{% if expires_soon == 30 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/30">30 days</a></span>{%else%}<a href="/cookies/expires_soon/30">30 days</a>{% endif %}</td>
48+
<td>{% if expires_soon == 60 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/60">60 days</a></span>{%else%}<a href="/cookies/expires_soon/60">60 days</a>{% endif %}</td>
49+
<td>{% if expires_soon == 90 %}<span class="ietf-highlight-y"><a href="/cookies/expires_soon/90">90 days</a></span>{%else%}<a href="/cookies/expires_soon/90">90 days</a>{% endif %}</td>
5050
</tr>
5151

5252
<tr class="setting-header">
@@ -60,8 +60,8 @@ <h2 class="ietf-divider">Show full document text in document page</h2>
6060
</td>
6161
</tr>
6262
<tr class="settings-values">
63-
<td>{% if full_draft|equal:"off" %}<span class="ietf-highlight-y"><a href="/cookies/full_draft/off">off</a></span>{%else%}<a href="/cookies/full_draft/off">off</a>{% endif %}</td></td>
64-
<td>{% if full_draft|equal:"on" %}<span class="ietf-highlight-y"><a href="/cookies/full_draft/on">on</a></span>{%else%}<a href="/cookies/full_draft/on">on</a>{% endif %}</td></td>
63+
<td>{% if full_draft == "off" %}<span class="ietf-highlight-y"><a href="/cookies/full_draft/off">off</a></span>{%else%}<a href="/cookies/full_draft/off">off</a>{% endif %}</td></td>
64+
<td>{% if full_draft == "on" %}<span class="ietf-highlight-y"><a href="/cookies/full_draft/on">on</a></span>{%else%}<a href="/cookies/full_draft/on">on</a>{% endif %}</td></td>
6565
</tr>
6666
</table>
6767
{% endblock %}

0 commit comments

Comments
 (0)