

<div id="myblocs" class="myblocs">    
  {% for item in myblocs.keys() %}
  {% if item != 'footer' %}
  <div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;">
    <button class="btn"> {{ item }} - {{ myblocs[item]['type'] }} </button>
    <input class="input-menu" id="bloc-{{ item }}" name="{{ item }}" value="" style="display:none;">
    <button class="btn btn-danger" onclick="deleteItem(this)"> x </button>
  </div>
  {% endif %}
{% endfor %}

</div>
</form>


<script src="/static/vendors/Sortable/Sortable.min.js"></script>
<script type="text/javascript">
 
  var elements = document.getElementsByClassName('myblocs');
  
  for (var i = 0; i < elements.length; i++) {
      
      new Sortable(elements[i], {
	  group: 'shared',
	  animation: 150,
	  invertSwap: true,
	  fallbackOnBody: true,
	  swapThreshold: 0.65,
      })};
 
  </script>
