Added new context variable form_hide_required_text for hide the word "(required)" from selected forms

This commit is contained in:
Roberto Rosario
2011-03-18 14:15:13 -04:00
parent b4a475cac2
commit 6f90cee824
3 changed files with 4 additions and 1 deletions
@@ -34,7 +34,7 @@
{% for field in form.visible_fields %} {% for field in form.visible_fields %}
<div class="group"> <div class="group">
{% if field.errors %}<div class="fieldWithErrors">{% endif %} {% if field.errors %}<div class="fieldWithErrors">{% endif %}
<label class="label">{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans "required" %}){% endif %}</label> <label class="label">{{ field.label_tag }}{% if field.field.required and not read_only and not form_hide_required_text %} ({% trans "required" %}){% endif %}</label>
{% if field.errors %}<span class="error">{% for error in field.errors %}{{ error }}{% if not forloop.last %} | {% endif %}{% endfor %}</span></div>{% endif %} {% if field.errors %}<span class="error">{% for error in field.errors %}{{ error }}{% if not forloop.last %} | {% endif %}{% endfor %}</span></div>{% endif %}
{{ field }} {{ field }}
{% if field.help_text %}<span class="description">{{ field.help_text }}</span>{% endif %} {% if field.help_text %}<span class="description">{{ field.help_text }}</span>{% endif %}
+1
View File
@@ -43,6 +43,7 @@ def results(request, form=None):
'form':form, 'form':form,
'form_title':_(u'Search'), 'form_title':_(u'Search'),
'hide_header':True, 'hide_header':True,
'form_hide_required_text':True,
}) })
if SHOW_OBJECT_TYPE: if SHOW_OBJECT_TYPE:
+2
View File
@@ -124,8 +124,10 @@
{% get_main_setting "SIDE_BAR_SEARCH" as side_bar_search %} {% get_main_setting "SIDE_BAR_SEARCH" as side_bar_search %}
{% if side_bar_search %} {% if side_bar_search %}
{% with "true" as side_bar %} {% with "true" as side_bar %}
{% with "true" as form_hide_required_text %}
{% search_form %} {% search_form %}
{% endwith %} {% endwith %}
{% endwith %}
{% endif %} {% endif %}
{% get_object_navigation_links %} {% get_object_navigation_links %}