<%%projects = current_user.admin? ? Project.find(:all) : current_user.projects%>

Projects

<%%=h pluralize(projects.length, 'Project')%> listed for you <%% if projects.empty? %>
No projects listed for you.

<%% else %> <%% for project in projects %> <%%if current_user.admin?%> <%%end%> <%% end %>
Name Description #Stages #Deploy. Created At
<%%= link_to h(project.name), project_path(project) %> <%%=h project.description %> <%%=h project.stages.count %> <%%=h project.deployments.count %> <%%=h project.created_at.to_s(:date_with_day) %> <%%= link_to 'Edit', edit_project_path(project) %><%%= link_to 'Delete', project_path(project), :confirm => 'Are you sure?', :method => :delete %>
<%% end %>
<%%if current_user.admin?%> <%%= link_to 'New project', new_project_path, :class => 'arrow_link' %> <%%end%>