{% load templates %}
{% for tab in tabs %} {% if tab.selected and tab.id == tab.selected %} {% elif not tab.selected and forloop.first %} {% else %} {% endif %} {% endfor %}
{% for tab in tabs %} {% if not tab.selected and forloop.first %}
{% elif tab.selected and tab.selected == tab.id %}
{% else %} {% endfor %}