src/cm/templates/site/macros/form_fields.html
author Simon Descarpentries <sid1@sopinspace.com>
Fri, 05 Aug 2011 17:12:15 +0200
changeset 373 f6fe14eb51bc
parent 321 e13b6d92f70c
permissions -rw-r--r--
Add a title attribute on comment scopes to indicate the number of comments in the scope. Also ensure that the last c-count-x defined color class is set even if there are more than 25 comments in the scope.

{% load i18n %}
{% if form.non_field_errors %}<tr><td class="label"></td><td><span class="error-text">{{ form.non_field_errors }}</span></td></tr>{% endif %}

{% for field in form %}
<tr>
     <td class="label">{{ field.label_tag }}{% if field.field.required %}&nbsp;<span class="required_star">*</span>{% endif %}&nbsp;&nbsp;<div><br/></div></td>
     <td>
        <div {% if field.errors %}class="error"{% endif %}>{{ field }}
        {% ifequal field.name "format" %}
        	{% ifequal form_type "create_content" %}
        	<a class="tip" href="#" title="{% blocktrans %}Markdown (or rst) is a structured format which permit simple formatting with simple textual syntax. We recommend you use the 'markown' format unless you want to paste HTML (in which case you should use the 'html' format).{% endblocktrans %}"> </a>
        	{% endifequal %}
        	{% ifequal form_type "upload_content" %}
        	<a class="tip" href="#" title="{% blocktrans %}Markdown (or rst) is a structured format which permit simple formatting with simple textual syntax. We recommend you use the 'markdown' format if your text is mostly text and/or if you will create many revisions of your text. You can use the 'html' format if your text will not be edited or if you want to preserve complex formatting (tables, images, etc.).{% endblocktrans %}"> </a>
        	{% endifequal %}        	
        {% endifequal %}
        </div>                

        <div class="help_text">                  
        {% if field.help_text %}{{ field.help_text }}{% endif %}{% if help_links %}{% for key,value in help_links.items %}{% ifequal key field.name %}&nbsp;(<a target="_blank" title="{% blocktrans %}Help{% endblocktrans %}" href="{% url help %}#{{ value }}">?</a>){% endifequal %}{% endfor %}{% endif %}{% if field.errors %}
            <span class="error-text">              
                {% for error in field.errors %}{{ error|escape }}{% endfor %}
            </span>
            </div>
        {% else %}    
            <br/>              
        {% endif %}           
        </div>        
     </td>
</tr>
{% endfor %}