1 2 3 4 5
<div class="signal_level"> {% for i in range(5) %} <div{% if i < level %} class="yes"{% endif %}></div> {% endfor %} </div>