X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/f23e8f623a0670883682399799d40abda730ff16..18873187afb531075cb9979c45fc97be7b78cc8c:/forum/modules/ui_objects.py diff --git a/forum/modules/ui_objects.py b/forum/modules/ui_objects.py index 70bee93..caa221f 100644 --- a/forum/modules/ui_objects.py +++ b/forum/modules/ui_objects.py @@ -1,5 +1,6 @@ from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify +from django import template from forum.utils import html class Visibility(object): @@ -82,6 +83,14 @@ class Link(ObjectBase): html.hyperlink(self.url(context), self.text(context), **self.attrs(context)), self.post_code(context)) +class Include(ObjectBase): + def __init__(self, tpl, visibility=None, weight=500): + super(Include, self).__init__(visibility, weight) + self.template = template.loader.get_template(tpl) + + def render(self, context): + return self.template.render(context) + class LoopContext(LoopBase): def __init__(self, loop_context, visibility=None, weight=500):