X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Ftemplatetags%2Fqcg_utils.py;h=a1b6b52698627c2a960f439eeb71a56317dc5d35;hb=6d6c248706a2b7a388ab37bc12a38d1b3806ba63;hp=2dfe96e33c2778f5f6bd535872f5b8d826fab5d0;hpb=cb292970db9b3ea3054212858abb5eebe73f0fd9;p=qcg-portal.git diff --git a/qcg/templatetags/qcg_utils.py b/qcg/templatetags/qcg_utils.py index 2dfe96e..a1b6b52 100644 --- a/qcg/templatetags/qcg_utils.py +++ b/qcg/templatetags/qcg_utils.py @@ -1,6 +1,7 @@ from datetime import datetime, timedelta from django import template +from django.conf import settings from django.utils.html import format_html, format_html_join from django.utils.timesince import timesince from django.utils.timezone import now @@ -33,3 +34,9 @@ def display_attribute(label, value): def get_params_as_hidden(context, *params): return format_html_join('\n', u'', ((param, v) for param in params for v in context['request'].GET.getlist(param, []))) + + +@register.inclusion_tag('qcg/tags/bootstrap_checkbox.html') +def bootstrap_checkbox(field, label_class=settings.BOOTSTRAP3['horizontal_label_class'], + field_class=settings.BOOTSTRAP3['horizontal_field_class']): + return {'field': field, 'label_class': label_class, 'field_class': field_class}