% cache [current_user, project] do %>
<% active = !project.archived %>
<% if (active && (can_manage_project?(project) || can_archive_project?(project))) || (!active && can_restore_project?(project)) %>
<% project_form = nil %>
<%= form_for project, format: :json, method: :put, remote: true, html: {id: "edit-project-#{view}-form-#{project.id}" } do |f| %>
<% project_form = f %>
<%= f.hidden_field :archived, value: active %>
<% end %>
<% end %>
<% end %>