<div 
  class="control-group form-group"
  data-templates="{{ dataTemplates|json_encode }}"
  data-favorites="{{ {squelette:favoriteSquelette,style:favoriteStyle,preset:favoritePreset}|json_encode }}"
  data-presets="{{ presets|json_encode }}"
  data-update-url="{{ updateUrl is same as true ? 'true' : 'false' }}"
  >
  <label class="control-label {{ sizeClass }}">{{ _t('TEMPLATE_THEME') }}</label>
  <div class="controls {{ sizeClass }}">
    <select class="form-control" name="theme_select">
      {% for key,value in templates %}
        <option value="{{ key }}"{% if key == favoriteTheme %} selected{% endif %}>{{ key }}</option>
      {% endfor %}
    </select>
  </div>
</div>

<div class="control-group form-group">
  <label class="control-label {{ sizeClass }}">{{ _t('TEMPLATE_SQUELETTE') }}</label>
  <div class="controls {{ sizeClass }}">
    <select class="form-control" name="squelette_select">
      {% for key,value in squelettes|sort %}
        <option value="{{ value }}"{% if key == favoriteSquelette %} selected{% endif %}>{{ value }}</option>
      {% endfor %}
    </select>
  </div>
</div>

<div class="control-group form-group">
  <label class="control-label {{ sizeClass }}">{{ _t('TEMPLATE_STYLE') }}</label>
  <div class="controls {{ sizeClass }}">
    <select class="form-control" name="style_select">
      {% for key,value in styles %}
        <option value="{{ key }}"{% if key == favoriteStyle %} selected{% endif %}>{{ value|replace({'.css':''}) }}</option>
      {% endfor %}
    </select>
  </div>
</div>

{% if presets is not empty %}
 {% block presetpart %}
  <div class="control-group form-group"{% if templates[favoriteTheme].presets is empty %} style="display:none;"{% endif %}>
    <label class="control-label {{ sizeClass }}">{{ _t('TEMPLATE_PRESET') }}</label>
    <div class="controls {{ sizeClass }}">
      <select class="form-control" name="preset_select">
        {% block firstoptionpreset %}{% endblock %}
        {% for key,value in presets %}
          <option value="{{ key }}"{% if key == favoritePreset %} selected{% endif %}>{{ value|replace({'.css':''}) }}</option>
        {% endfor %}
      </select>
    </div>
  </div>
 {% endblock presetpart %}
{% endif %}

{{ include_javascript('tools/templates/javascripts/change-theme.js') }}