From 77fbbf70b33300d573c0ee660b4a42cdbed460c0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 12 Sep 2017 11:40:42 +0200 Subject: Bootstrap: templatetag for modal window --- chimere/templates/blocks/bootstrap-modal.html | 14 ++++++++++++++ chimere/templatetags/bootstrap.py | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 chimere/templates/blocks/bootstrap-modal.html create mode 100644 chimere/templatetags/bootstrap.py diff --git a/chimere/templates/blocks/bootstrap-modal.html b/chimere/templates/blocks/bootstrap-modal.html new file mode 100644 index 0000000..d476d5b --- /dev/null +++ b/chimere/templates/blocks/bootstrap-modal.html @@ -0,0 +1,14 @@ + diff --git a/chimere/templatetags/bootstrap.py b/chimere/templatetags/bootstrap.py new file mode 100644 index 0000000..ea1cb6d --- /dev/null +++ b/chimere/templatetags/bootstrap.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from logging import getLogger + +from django import template + +log = getLogger(__name__) + +register = template.Library() + + +@register.inclusion_tag('blocks/bootstrap-modal.html') +def bootstrap_modal(context, winid, title="", content="", size=""): + if size not in ['large']: + size = "" + context_data = { + "id": winid, + "title": title, + "content": content, + "size": size + } + return context_data -- cgit v1.2.3