<nav class="<%= "legislation-process-list" if process.enabled_phases? %>">
  <div class="row">
    <div class="small-12 column">
      <% if process.enabled_phases? %>
        <h3><%= t("legislation.processes.shared.key_dates") %></h3>
      <% end %>

      <ul class="key-dates">
        <% if process.homepage_enabled? && process.homepage.present? %>
          <li <%= "class=is-active" if phase.to_sym == :homepage %>>
            <%= link_to legislation_process_path(process) do %>
              <h4><%= t("legislation.processes.shared.homepage") %></h4>
              <br>
            <% end %>
          </li>
        <% end %>

        <% if process.debate_phase.enabled? %>
          <li <%= "class=is-active" if phase.to_sym == :debate_phase %>>
            <%= link_to debate_legislation_process_path(process) do %>
              <h4><%= t("legislation.processes.shared.debate_dates") %></h4>
              <span><%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %></span>
            <% end %>
          </li>
        <% end %>

        <% if process.proposals_phase.enabled? %>
          <li <%= "class=is-active" if phase.to_sym == :proposals %>>
            <%= link_to proposals_legislation_process_path(process) do %>
              <h4><%= t("legislation.processes.shared.proposals_dates") %></h4>
              <span><%= format_date(process.proposals_phase_start_date) %> - <%= format_date(process.proposals_phase_end_date) %></span>
            <% end %>
          </li>
        <% end %>

        <% if process.allegations_phase.enabled? %>
          <li <%= "class=is-active" if phase.to_sym == :allegations_phase %>>
            <%= link_to allegations_legislation_process_path(process) do %>
              <h4><%= t("legislation.processes.shared.allegations_dates") %></h4>
              <span><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></span>
            <% end %>
          </li>
        <% end %>

        <% if process.milestones.any? || process.progress_bars.any? %>
          <li class="milestones <%= "is-active" if phase == :milestones %>">
            <%= link_to milestones_legislation_process_path(process) do %>
              <h4><%= t("legislation.processes.shared.milestones_date") %></h4>
              <% if process.milestones.any? %>
                <span><%= format_date(process.milestones.order_by_publication_date.last.publication_date) %></span>
              <% end %>
            <% end %>
          </li>
        <% end %>

        <% if can?(:summary, process) %>
          <li <%= "class=is-active" if phase == :summary %>>
            <%= link_to summary_legislation_process_path(process) do %>
              <h4><%= t("legislation.summary.title") %></h4>
              <span><%= format_date(process.result_publication_date) %></span>
            <% end %>
          </li>
        <% end %>
      </ul>
    </div>
  </div>
</nav>
