X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/a6876bf7a05515cc4f16a70324990f11193933c1..c83e534451c1ca43da0ed9585298a96f059f77fb:/src/ajaxable/templatetags/ajaxable_tags.py diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py index ec90e4794..2d980f278 100644 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ b/src/ajaxable/templatetags/ajaxable_tags.py @@ -1,12 +1,12 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import template -from django.utils.encoding import force_unicode +from django.utils.encoding import force_text from django.utils.safestring import mark_safe - from ajaxable.utils import placeholdized + + register = template.Library() @@ -32,14 +32,14 @@ def pretty_field(field, template=None): return mark_safe(template % { 'errors': field.errors, 'input': field, - 'label': force_unicode(field.label), - 'helptext': force_unicode(field.help_text), + 'label': ('*' if field.field.required else '') + force_text(field.label), + 'helptext': force_text(field.help_text), }) @register.filter def pretty_checkbox(field): - return pretty_field(field, template=u''' + return pretty_field(field, template='''
  • %(errors)s