Technologies: Django/Python, Coffeescript/Eco Templates/Backbone.js.
Eco templates: https://github.com/sstephenson/eco
I'm using .eco templates with backbone to populate my django views. So, Django has its ways of counting iterations, etc. -- which is great -- but how do I translate that into an .eco template syntax?
I want it to do output like this every 2 iterations until loop is finished:
<div class="row">
<div class="col-md-6">test</div>
<div class="col-md-6">test</div>
</div>
Here is the code I'm trying to use:
<% for thing in @things.models: %>
<% if forloop.counter|divisibleby:'2': %> ### so what would be the eco equivalent to something like this in django?
<div class="row">
<div class="col-md-6">test</div>
<div class="col-md-6">test</div>
</div>
{% endif %}
{% endfor %}
The .eco template gives me an error which I can't understand for the above code.