<ul class="nav nav-tabs" role="tablist">
<li role="presentation" <%= isActivePage(admin_template_template_path(template)) ? ' class=active' : '' %>>
<%= link_to(_('Template details'), admin_template_template_path(template), { 'aria-controls': 'show_template', role: 'tab' }) %>
</li>
<% template.phases.each do |phase| %>
<li role="presentation" <%= isActivePage(admin_show_phase_path(phase.id)) ? ' class=active' : '' %>>
<%= link_to(phase.title, admin_show_phase_path(phase.id), { 'aria-controls': "#{phase.id}", role: 'tab' }) %>
</li>
<% end %>
<!-- Add another phase button -->
<% if current_user.can_org_admin? && (template.org.funder? || current_user.org.funder? || (template.org == current_user.org)) %>
<li role="presentation" <%= isActivePage(admin_add_phase_path(template)) ? ' class=active' : '' %>>
<%= link_to(_('Add new phase'), admin_add_phase_path(template), { 'aria-controls': 'add_phase', role: 'tab' }) %>
</li>
<% end %>
</ul>