<% followed_projects.each do |project| %>
<% if project == current_project %>
<%= project.name %>
<% else %>
<% path = if !current_feature
# we're not on a project page,
# just refresh the page and set the project
"?project=#{project.slug}"
elsif !project.features.include?(current_feature)
# we're using a feature that this project
# doesn't support. Navigate to the root URL
# and set the project
main_app.root_path(project: project.slug)
else
feature_path(project, current_feature)
end %>
<%= link_to path do %>
<%= project.name %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if current_project.features.any? %>
<% current_project.features.each do |feature| %>
<%= render_nav_for_feature(feature) %>
<% end %>
<% else %>
No features are enabled for <%= current_project.name %>.
<% if can?(:update, current_project) %>
You can enable features in <%= link_to "Project Settings", main_app.edit_project_path(current_project) %>.
<% end %>