"Fossies" - the Fresh Open Source Software Archive

Member "horizon-16.0.0/horizon/templates/horizon/common/_form_field.html" (16 Oct 2019, 1588 Bytes) of package /linux/misc/openstack/horizon-16.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 {% load form_helpers %}
    2 
    3 <div class="form-group{% if field.errors %} has-error{% endif %} {{ field.css_classes }}">
    4   {% if field|is_checkbox %}
    5     <div class="{{ classes.single_value }}">
    6     {% include 'horizon/common/fields/_themable_checkbox.html' %}
    7     </div>
    8   {% elif field|is_radio %}
    9     {% include 'horizon/common/fields/_themable_radiobutton.html' %}
   10   {% else %}
   11     {% if field.auto_id %}
   12       <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">
   13           <span class="field-label">{{ field.label }}</span></label>
   14       {% include "horizon/common/_form_field_decorator.html" %}
   15     {% endif %}
   16 
   17     <div class="{{ classes.value }} {{ field|wrapper_classes }}">
   18       {% with add_item_link=field|add_item_url %}
   19       {% if add_item_link %}
   20         <div class='input-group'>
   21           {{ field|add_bootstrap_class }}
   22           <span class="input-group-btn">
   23             <a href="{{ add_item_link }}" data-add-to-field="{{ field.auto_id }}" class='btn btn-default ajax-add ajax-modal'>
   24               <span class="fa fa-plus"></span>
   25             </a>
   26           </span>
   27         </div>
   28       {% else %}
   29         {% if field|is_number %}
   30           {% include 'horizon/common/fields/_themable_spinner.html' %}
   31         {% else %}
   32           {{ field|add_bootstrap_class }}
   33         {% endif %}
   34       {% endif %}
   35       {% endwith %}
   36     </div>
   37   {% endif %}
   38   {% for error in field.errors %}
   39     <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
   40   {% endfor %}
   41 </div>