remove unused customtag verbatim
This commit is contained in:
Родитель
9cb625cf1a
Коммит
56abe946ad
|
@ -1,48 +0,0 @@
|
|||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
"""
|
||||
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
|
||||
from django.template import base
|
||||
|
||||
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 == base.TOKEN_VAR:
|
||||
text.append('{{')
|
||||
elif token.token_type == base.TOKEN_BLOCK:
|
||||
text.append('{%')
|
||||
text.append(token.contents)
|
||||
if token.token_type == base.TOKEN_VAR:
|
||||
text.append('}}')
|
||||
elif token.token_type == base.TOKEN_BLOCK:
|
||||
text.append('%}')
|
||||
return VerbatimNode(''.join(text))
|
|
@ -1,5 +1,4 @@
|
|||
{% extends "_base.html" %}
|
||||
{% load verbatim %}
|
||||
{% load inline_file %}
|
||||
|
||||
{% block css %}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{% extends "_base.html" %}
|
||||
{% load verbatim %}
|
||||
{% load inline_file %}
|
||||
|
||||
{% block css %}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{% extends "_base.html" %}
|
||||
{% load verbatim %}
|
||||
{% load inline_file %}
|
||||
|
||||
{% block rss %}
|
||||
|
@ -12,9 +11,7 @@
|
|||
|
||||
{% block drawer %}
|
||||
<h3>Category filter</h3>
|
||||
{% verbatim %}
|
||||
<paper-listbox id="papermenu">
|
||||
{% endverbatim %}
|
||||
{% for k,v in CATEGORIES %}
|
||||
{% if v != 'webcomponents' %}
|
||||
<paper-item data-category="{{v}}">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{% extends "_base.html" %}
|
||||
{% load verbatim %}
|
||||
{% load inline_file %}
|
||||
|
||||
{% block css %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче