From af9b21c1d0346234b1f40f5052350e90772e7d06 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 7 Mar 2011 19:21:02 -0400 Subject: [PATCH] Added generic list template column option to make data non-breakable --- apps/common/templates/generic_list_subtemplate.html | 9 ++++++++- apps/common/templatetags/non_breakable.py | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 apps/common/templatetags/non_breakable.py diff --git a/apps/common/templates/generic_list_subtemplate.html b/apps/common/templates/generic_list_subtemplate.html index 517a813845..47fc6dbb3f 100644 --- a/apps/common/templates/generic_list_subtemplate.html +++ b/apps/common/templates/generic_list_subtemplate.html @@ -2,6 +2,7 @@ {% load attribute_tags %} {% load pagination_tags %} {% load navigation %} +{% load non_breakable %} {% if side_bar %}
@@ -60,7 +61,13 @@ {% endfor %} {% endif %} {% for column in extra_columns %} - {{ object|object_property:column.attribute|safe }} + {% if column.keep_together %} +
+ {{ object|object_property:column.attribute|safe|make_non_breakable }} +
+ {% else %} + {{ object|object_property:column.attribute|safe }} + {% endif %} {% endfor %} {% if not hide_links %} diff --git a/apps/common/templatetags/non_breakable.py b/apps/common/templatetags/non_breakable.py new file mode 100644 index 0000000000..483c899154 --- /dev/null +++ b/apps/common/templatetags/non_breakable.py @@ -0,0 +1,8 @@ +from django.template import Library + +register = Library() + +@register.filter +def make_non_breakable(value): + return value.replace(u'-', u'\u2011') +