Issue #56, remove remaining side bar templates code
This commit is contained in:
@@ -358,13 +358,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% get_sidebar_templates as sidebar_templates %}
|
||||
{% for template in sidebar_templates %}
|
||||
{% with 'true' as side_bar %}
|
||||
{% include template %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
</div><!--end #sidebar-->
|
||||
</div><!--end #wrapper .wat-cf-->
|
||||
|
||||
@@ -273,26 +273,3 @@ def get_multi_item_links_form(context):
|
||||
form = MultiItemForm(actions=actions)
|
||||
context.update({'multi_item_form': form, 'multi_item_actions': actions})
|
||||
return ''
|
||||
|
||||
|
||||
class GetSidebarTemplatesNone(Node):
|
||||
def __init__(self, var_name='sidebar_templates'):
|
||||
self.var_name = var_name
|
||||
|
||||
def render(self, context):
|
||||
request = Variable('request').resolve(context)
|
||||
view_name = resolve_to_name(request.META['PATH_INFO'])
|
||||
context[self.var_name] = sidebar_templates.get(view_name, [])
|
||||
return ''
|
||||
|
||||
|
||||
@register.tag
|
||||
def get_sidebar_templates(parser, token):
|
||||
tag_name, arg = token.contents.split(None, 1)
|
||||
|
||||
m = re.search(r'("?\w+"?)?.?as (\w+)', arg)
|
||||
if not m:
|
||||
raise TemplateSyntaxError('%r tag had invalid arguments' % tag_name)
|
||||
|
||||
menu_name, var_name = m.groups()
|
||||
return GetSidebarTemplatesNone(var_name=var_name)
|
||||
|
||||
Reference in New Issue
Block a user