Add new default icon for the cancel button in forms

This commit is contained in:
Roberto Rosario
2012-09-22 00:47:36 -04:00
parent 5fa0c9ccfb
commit 2bc008d298
2 changed files with 9 additions and 8 deletions

View File

@@ -87,15 +87,15 @@
{% if previous %}
<a href="#header" onclick='{% if previous %}window.location.replace("{{ previous }}");{% else %}history.go(-1);{% endif %}' class="button">
<img src="{{ STATIC_URL }}web_theme_media/images/icons/cross.png" alt="{% if cancel_label %}{{ cancel_label }}{% else %}{% trans 'Cancel' %}{% endif %}"/> {% if cancel_label %}{{ cancel_label }}{% else %}{% trans "Cancel" %}{% endif %}
</a>
{% if cancel_icon %}
{{ cancel_icon.display_small }}
{% else %}
{{ cancel_icon_default.display_small }}
{% endif %}
{% comment %}
<a href="#header" class="button">
<img src="{{ STATIC_URL }}web_theme_media/images/icons/cross.png" alt="{% trans 'Cancel' %}"/> {% trans 'Cancel' %}
{% if cancel_label %}{{ cancel_label }}{% else %}{% trans "Cancel" %}{% endif %}
</a>
{% endcomment %}
{% endif %}
</div>
{% endif %}
</form>

View File

@@ -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''