Skip to content

Commit d61ed82

Browse files
committed
Summary: Replace old-style wordwrap custom tag with {% filter wordwrap %}
- Legacy-Id: 8965
1 parent b608626 commit d61ed82

2 files changed

Lines changed: 3 additions & 33 deletions

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -527,36 +527,6 @@ def consensus(doc):
527527
else:
528528
return "Unknown"
529529

530-
# The function and class below provides a tag version of the builtin wordwrap filter
531-
# https://djangosnippets.org/snippets/134/
532-
@register.tag
533-
def wordwrap(parser, token):
534-
"""
535-
This is a tag version of the Django builtin 'wordwrap' filter. This is useful
536-
if you need to wrap a combination of fixed template text and template variables.
537-
538-
Usage:
539-
540-
{% wordwrap 80 %}
541-
some really long text here, including template variable expansion, etc.
542-
{% endwordwrap %}
543-
"""
544-
try:
545-
tag_name, len = token.split_contents()
546-
except ValueError:
547-
raise template.TemplateSyntaxError, "The wordwrap tag requires exactly one argument: width."
548-
nodelist = parser.parse(('endwordwrap',))
549-
parser.delete_first_token()
550-
return WordWrapNode(nodelist, len)
551-
552-
class WordWrapNode(template.Node):
553-
def __init__(self, nodelist, len):
554-
self.nodelist = nodelist
555-
self.len = len
556-
557-
def render(self, context):
558-
return wrap(str(self.nodelist.render(context)), int(self.len))
559-
560530
@register.filter
561531
def pos_to_label(text):
562532
"""Return a valid Bootstrap3 label type for a ballot position."""

ietf/templates/ipr/posted_document_email.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Cc: {{ cc_email }}
66

77
Dear {{ to_name }}:
88

9-
{% wordwrap 80 %}
9+
{% filter wordwrap:80 %}
1010
An IPR disclosure that pertains to your {{ doc_info }} was submitted to the IETF Secretariat on {{ ipr.submitted_date|date:"Y-m-d" }} and has been posted on the "IETF Page of Intellectual Property Rights Disclosures" (https://datatracker.ietf.org/ipr/{{ ipr.pk }}/). The title of the IPR disclosure is "{{ ipr.title }}"
11-
{% endwordwrap %}
11+
{% endfilter %}
1212

1313
Thank you
1414

15-
IETF Secretariat
15+
IETF Secretariat

0 commit comments

Comments
 (0)