Port cookies/ away from use of |equal filter, remove |equal filter
- Legacy-Id: 6776
This commit is contained in:
parent
19da33d8ff
commit
cadedce023
|
@ -410,10 +410,6 @@ def expires_soon(x,request):
|
|||
days = 14
|
||||
return x > -days
|
||||
|
||||
@register.filter(name='equal')
|
||||
def equal(x, y):
|
||||
return str(x)==str(y)
|
||||
|
||||
@register.filter(name='startswith')
|
||||
def startswith(x, y):
|
||||
return unicode(x).startswith(y)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% block title %}User settings{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<h2>Cookie settings for the ietf datatracker.</h2>
|
||||
<h2>Cookie settings for the IETF datatracker</h2>
|
||||
|
||||
<p> Following settings are implemented using cookies, so if you have
|
||||
cookies disabled then you are not able to change the settings
|
||||
|
@ -22,12 +22,12 @@ cookies disabled then you are not able to change the settings
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="settings-values">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr class="setting-header">
|
||||
|
@ -41,12 +41,12 @@ cookies disabled then you are not able to change the settings
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="settings-values">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
<tr class="setting-header">
|
||||
|
@ -60,8 +60,8 @@ cookies disabled then you are not able to change the settings
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="settings-values">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue