Added support for overriding a form's submit button icon, updated assign_remove view to use this feature

This commit is contained in:
Roberto Rosario
2011-06-13 00:22:39 -04:00
parent 4b17894320
commit f3335287ed
2 changed files with 8 additions and 1 deletions

View File

@@ -70,7 +70,12 @@
{% if not read_only %}
<div class="group navform wat-cf">
<button class="button" type="submit" name="{% if form.prefix %}{{ form.prefix }}-submit{% else %}submit{% endif %}">
<img src="{{ MEDIA_URL }}web_theme_media/images/icons/tick.png" alt="{% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}" /> {% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans "Save" %}{% else %}{% trans "Submit" %}{% endif %}{% endif %}
{% if submit_icon_famfam %}
<span class="famfam active famfam-{{ submit_icon_famfam|default:'tick' }}"></span>
{% else %}
<img src="{{ MEDIA_URL }}web_theme_media/images/icons/tick.png" alt="{% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}{% endif %}" />
{% endif %}
{% if submit_label %}{{ submit_label }}{% else %}{% if object %}{% trans "Save" %}{% else %}{% trans "Submit" %}{% endif %}{% endif %}
</button>
{% comment %}
<a href="#header" class="button">

View File

@@ -98,6 +98,7 @@ def assign_remove(request, left_list, right_list, add_method, remove_method, lef
'form': unselected_list,
'title': left_list_title,
'submit_label': _(u'Add'),
'submit_icon_famfam': 'add'
}
},
{
@@ -108,6 +109,7 @@ def assign_remove(request, left_list, right_list, add_method, remove_method, lef
'form': selected_list,
'title': right_list_title,
'submit_label': _(u'Remove'),
'submit_icon_famfam': 'delete'
}
},