From 2bc008d298803e10835e5db85ffbe640eaf45d4c Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 22 Sep 2012 00:47:36 -0400 Subject: [PATCH] Add new default icon for the cancel button in forms --- .../common/templates/generic_form_subtemplate.html | 14 +++++++------- apps/common/templatetags/default_icons.py | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/common/templates/generic_form_subtemplate.html b/apps/common/templates/generic_form_subtemplate.html index f4f55004aa..df7a788f50 100644 --- a/apps/common/templates/generic_form_subtemplate.html +++ b/apps/common/templates/generic_form_subtemplate.html @@ -87,15 +87,15 @@ {% if previous %} - {% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %} {% if cancel_label %}{{ cancel_label }}{% else %}{% trans "Cancel" %}{% endif %} + {% if cancel_icon %} + {{ cancel_icon.display_small }} + {% else %} + {{ cancel_icon_default.display_small }} + {% endif %} + + {% if cancel_label %}{{ cancel_label }}{% else %}{% trans "Cancel" %}{% endif %} {% endif %} - - {% comment %} - - {% trans 'Cancel' %} {% trans 'Cancel' %} - - {% endcomment %} {% endif %} diff --git a/apps/common/templatetags/default_icons.py b/apps/common/templatetags/default_icons.py index f0b2da8f48..6af97388bb 100644 --- a/apps/common/templatetags/default_icons.py +++ b/apps/common/templatetags/default_icons.py @@ -1,6 +1,6 @@ from django.template import Library -from common.icons import icon_tick +from common.icons import icon_tick, icon_cross register = Library() @@ -8,4 +8,5 @@ register = Library() @register.simple_tag(takes_context=True) def default_icons(context): context['submit_icon_default'] = icon_tick + context['cancel_icon_default'] = icon_cross return u''