{% macro form_item(item_name, item_value, col=5, disabled=False, is_json=False, validation='') %}
  <div class="form-group">
    <label for="{{ item_name }}" class="col-md-2 control-label">{{ item_name }}</label>
    <div class="col-md-{{ col }}">
      {% if item_name == 'source' and item_value is not string %}
        <select ng-model="source" flat-select class="selectpicker" {{ validation }}>
          {% for source in item_value %}
            <option value="{{source}}">{{source}}</option>
          {% endfor %}
        </select>
      {% elif is_json %}
        <div id="json-value" style="display:none">
          {{item_value|tojson if item_value is defined else ''}}
        </div>
        <textarea ng-model="json" class="form-control" id="{{ item_name }}"
          rows="10" placeholder="input json" spellcheck="false" {{ validation }}></textarea>
      {% else %}
        {% with %}
          {% set value = item_value if item_value is defined else '' %}
          {% set model_name = item_name.replace(' ', '') %}
          <input ng-model="{{ model_name }}" ng-init="{{ model_name }}='{{ value }}'" type="text"
            class="form-control" id="{{ item_name }}" placeholder="{{ item_name }}"
            {{ "disabled" if disabled else '' }} {{ validation }}>
        {% endwith %}
      {% endif %}
    </div>
  </div>
{% endmacro %}
