<div class="col-md-6"> 
{% if value.tag_type is not defined or value.tag_type != "hidden" %}             
  <label for="{{ key }}">                                                            
  {% if value.description is defined %}
  <strong>{{ value.description }}</strong>
    <span class="text-muted">({% if value.display_name is defined %}{{ value.display_name }}{% else %}{{ key }}{% endif %})</span>:
  {% elif value.display_name is defined %}                                         
    {{ value.display_name }}:                                                         
  {% else %}                                                                     
    {{ key }}:                                                                        
  {% endif %}                                                                    
  </label>                                                                         
{% endif %}                                                                      
{% if value.tag_type is defined %}                                               
                                                                                   
    <!-- text type -->                                                             
    {% if value.tag_type == "text" %}                                              
      <input type="text" class="form-control" id="{{ key }}" name="{{ key }}" value="{{ value.default}}" aria-describedby="help{{ key }}" {% if value.required %}required{%endif%} />
    <!-- end select type -->                                                       
                                                                                   
    <!-- hidden text type -->                                                      
    {% elif value.tag_type == "hidden" %}                                          
      <input type="hidden" class="form-control" id="{{ key }}" name="{{ key }}" value="{{ value.default}}" >
    <!-- end hidden text type -->                                                  
                                                                                   
    <!-- email type -->                                                            
    {% elif value.tag_type == "email" %}                                           
      <input type="email" class="form-control" id="{{ key }}" name="{{ key }}" placeholder="Enter your email" {% if value.required %}required{%endif%} >
    <!-- end email type -->                                                        
                                                                                   
    <!-- password type -->                                                         
    {% elif value.tag_type == "password" %}                                        
      <input type="password" class="form-control" id="{{ key }}" name="{{ key }}" placeholder="Enter your password" {% if value.required %}required{%endif%} >
    <!-- end password type -->                                                     
                                                                                   
    <!-- select type -->                                                           
    <!-- https://github.com/select2/select2/issues/4220 -->                        
    {% elif value.tag_type == "select" %}                                          
      <select class="js-example-basic-single js-states form-control" id="{{ key }}" name="{{ key }}">
      {% for constraint in value.constraints %}                                    
        <option value="{{ constraint['value'] }}">{{ constraint['label'] }}</option>
      {% endfor %}                                                                 
      </select>                                                                    
    <!-- end select type -->                                                       
                                                                                                                                             
    <!-- radio type -->                                                         
    {% elif value.tag_type == "radio" %}                                        
      {% for constraint in value.constraints %}                                 
        {% if loop.first %}                                                     
          <br><input type="radio" id="{{ key }}" name="{{ key }}" value={{ constraint['value'] }} checked> {{ constraint['label'] }}<br>
        {% else %}                                                              
          <input type="radio" id="{{ key }}" name="{{ key }}" value={{ constraint['value'] }}> {{ constraint['label'] }}<br>
        {% endif %}                                                             
      {% endfor %}                                                              
    <!-- end radio type -->                                                     
                                                                                
    <!-- toggle type -->                                                        
    {% elif value.tag_type == "toggle" %}                                       
      {% for constraint in value.constraints %}                                 
      <div>                                                                     
        <input type="checkbox" data-toggle="toggle" id="{{ key }}" name="{{ key }}" data-size="sm" data-offstyle="dark" value={{ constraint['value'] }}>
      </div>                                                                    
      {% endfor %}                                                              
    <!-- end toggle type -->                                                    
                                                                                
    {% endif %} <!-- end tag type if -->                                        
                                                                                
{% else %}                                                                    
    <input {% if 'password' in key %}type="password"{% else %}type="text"{% endif %} class="form-control" id="{{ key }}" name="{{ key }}" value="{{value.default}}" aria-describedby="help{{ key }}" {% if value.required %}required{%endif%} />
{% endif %}  <!-- end tag type existence if -->                               
{#  <small id="help{{ key }}" class="form-text text-muted">{{ value.description }}</small> #}
</div>             
