def render_readonly(self): """Render a version of onecolumn as a snippet of formatted html.""" title = 'Untitled' if not self.title else self.title contents = ''.join(map(self.render_widget_readonly, self.ordered)) return django_render_to_string('widgets/onecolumn_readonly.html', dict(title=title, contents=contents))
def render_to_string(template_name, context=None, request=None): if request is not None: context_instance = RequestContext(request, context) else: context_instance = Context(context) return django_render_to_string(template_name, context_instance=context_instance)
def render_django(template, context, context_update): if not isinstance(context, Context): if 'request' in context: context = RequestContext(context['request'], context) else: context = Context(context) with context.push(context_update): return django_render_to_string(template, context)
def render_to_string(template, *args, **kwargs): """Wrapper around django.template.loader.render_to_string which supports different template libraries.""" template_lib = _get_template_lib(template, kwargs) if template_lib == DJANGO: return django_render_to_string(template, *args, **kwargs) elif template_lib == MAKO: return django_mako.render_to_string(template, *args, **kwargs) else: raise Exception("Bad template lib: %s" % template_lib)
def render_embed(self, about, city_layout=False): """Render a version of onecolumn embeddable by city, business pages, etc. If city_layout is True, use an alternate layout that doesn't use a header bar for the embed. """ template, context = \ self.base_template_and_context('widgets/onecolumn_embed.html') context['about'] = about context['city_layout'] = city_layout return django_render_to_string(template, context)
def render_to_string(template_name, dictionary=None, context_instance=None): if not dictionary: dictionary = {} if isinstance(dictionary, dict): newdict = get_branding_dict("BRANDING") newdict.update(dictionary) else: newdict = dictionary return django_render_to_string(template_name, newdict, context_instance)
def render_to_string(templ, context): context.update({ 'PROJECT_TITLE': settings.PROJECT_TITLE, 'PROJECT_STRAPLINE': settings.PROJECT_STRAPLINE, }) return django_render_to_string(templ, context)
def render_to_string(template_name, dictionary=None, context_instance=None): from misago.template.theme import prefix_templates template_name = prefix_templates(template_name) return django_render_to_string(template_name, dictionary, context_instance=context_instance)
def render_to_string(template_name, context=None): return django_render_to_string(template_name, dictionary=context)
def render_to_string(template_name, dictionary=None, context_instance=None): dictionary = process_context(template_name, dictionary, context_instance) template_name = prefix_templates(template_name) return django_render_to_string(template_name, dictionary)
def render_to_string(template, context): html = django_render_to_string(template, context) assert "This_is_not_INVALID" not in html return html
def render_to_string(template_name, dictionary=None, context_instance=None, dirs=None): if context_instance is None: request = get_request() if request is not None: context_instance = RequestContext(request) return django_render_to_string(template_name, dictionary, context_instance, dirs)
def get_edit_info(self): return django_render_to_string( 'widgets/_onecolumn_edit_info.html', {'page': self})
def render_to_string(template_name, *args, **kwargs): return django_render_to_string(template_name, *args, **kwargs)