{#
Inserts a stepped progress indicator for the new package form. Each stage can
have one of three states, "uncomplete", "complete" and "active".

stages - A list of states for each of the three stages. Missing stages default
         to "uncomplete".

Example:

    {% snippet 'package/snippets/stages.html', stages=['active'] %}
    {% snippet 'package/snippets/stages.html', stages=['complete', 'active'] %}
    {% snippet 'package/snippets/stages.html', stages=['active', 'complete'] %}

#}
{% set s1 = stages[0] or 'active' %}
{% set s2 = stages[1] or 'uncomplete' %}
{% if s1 != 'uncomplete' %}{% set class = 'stage-1' %}{% endif %}
{% if s2 != 'uncomplete' %}{% set class = 'stage-2' %}{% endif %}

<ol class="stages {{ class }}">
  <li class="first {{ s1 }}">
    {% if s1 != 'complete' %}
      <span class="highlight">{{ _('Create dataset') }}</span>
    {% else %}
      <button class="highlight" name="save" value="go-dataset" type="submit">{{ _('Create dataset') }}</button>
    {% endif %}
  </li>
  <li class="last {{ s2 }}">
    {% if s2 != 'complete' %}
      <span class="highlight">{{ _('Add data') }}</span>
    {% else %}
      {% if s1 == 'active' %}
        {# stage 1 #}
        <button class="highlight" name="save" value="go-resources" type="submit">{{ _('Add data') }}</button>
      {% else %}
        {% link_for _('Add data'), controller='package', action='new', class_="highlight" %}
      {% endif %}
    {% endif %}
  </li>
</ol>
