Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 21 lines (19 sloc) 0.979 kB
5a595fb @ojii Moved plugin processors to a seperate file
ojii authored
1 # -*- coding: utf-8 -*-
2 from django.utils.safestring import mark_safe
3
4 def plugin_meta_context_processor(instance, placeholder):
5 return {
6 'plugin_index': instance._render_meta.index, # deprecated template variable
7 'plugin': {
8 'counter': instance._render_meta.index + 1,
9 'counter0': instance._render_meta.index,
10 'revcounter': instance._render_meta.total - instance._render_meta.index,
11 'revcounter0': instance._render_meta.total - instance._render_meta.index - 1,
12 'first': instance._render_meta.index == 0,
13 'last': instance._render_meta.index == instance._render_meta.total - 1,
14 'total': instance._render_meta.total,
15 'id_attr': 'plugin_%i_%i' % (instance.placeholder.pk, instance.pk),
16 'instance': instance,
17 }
18 }
19
20 def mark_safe_plugin_processor(instance, placeholder, rendered_content, original_context):
21 return mark_safe(rendered_content)
Something went wrong with that request. Please try again.