From ba8a8ca7c62ec9ad3fcfebf28712311d71e13695 Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Thu, 21 Feb 2013 22:02:11 +0100 Subject: [PATCH] Remove a backported verbatim tag now that we are using Django 1.5 --- pinry/core/templatetags/verbatim.py | 44 ------------------------------ pinry/pins/templates/pins/recent_pins.html | 1 - 2 files changed, 45 deletions(-) delete mode 100644 pinry/core/templatetags/verbatim.py diff --git a/pinry/core/templatetags/verbatim.py b/pinry/core/templatetags/verbatim.py deleted file mode 100644 index e4bf429..0000000 --- a/pinry/core/templatetags/verbatim.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -jQuery templates use constructs like: - - {{if condition}} print something{{/if}} - -This, of course, completely screws up Django templates, -because Django thinks {{ and }} mean something. - -Wrap {% verbatim %} and {% endverbatim %} around those -blocks of jQuery templates and this will try its best -to output the contents with no changes. -""" - -from django import template - -register = template.Library() - - -class VerbatimNode(template.Node): - - def __init__(self, text): - self.text = text - - def render(self, context): - return self.text - - -@register.tag -def verbatim(parser, token): - text = [] - while 1: - token = parser.tokens.pop(0) - if token.contents == 'endverbatim': - break - if token.token_type == template.TOKEN_VAR: - text.append('{{') - elif token.token_type == template.TOKEN_BLOCK: - text.append('{%') - text.append(token.contents) - if token.token_type == template.TOKEN_VAR: - text.append('}}') - elif token.token_type == template.TOKEN_BLOCK: - text.append('%}') - return VerbatimNode(''.join(text)) diff --git a/pinry/pins/templates/pins/recent_pins.html b/pinry/pins/templates/pins/recent_pins.html index 41578f6..07d6aa3 100644 --- a/pinry/pins/templates/pins/recent_pins.html +++ b/pinry/pins/templates/pins/recent_pins.html @@ -1,5 +1,4 @@ {% extends 'core/base.html' %} -{% load verbatim %} {% block title %}Recent Pins{% endblock %}