django-formtools icon indicating copy to clipboard operation
django-formtools copied to clipboard

StepsHelper is not iterable

Open nerdoc opened this issue 1 year ago • 1 comments

A StepsHelper must be made iterable to create useful wizard steps graphics, e.g. in Django (any jinja2 template too):

  <ul class="steps steps-counter">
    {% for step in wizard.steps %}
      <li class="step-item{% if wizard.steps.current == step %} active{% endif %}">{{ step }}</li>
    {% endfor %}
  </ul>

You need to iter over the wizard steps to do that, but the StepsHelper class is not iterable.

I may add a simple PR to do that?

nerdoc avatar Jul 08 '24 11:07 nerdoc

It could be a workaround (or a solution?) to use for step in wizard.steps.all?

nerdoc avatar Jul 08 '24 11:07 nerdoc