<%- model_class = Plan -%>
<% javascript "toolbar.js" %>
<h1>
<%= _('My plans') %>
</h1>
<!-- if the user has projects -->
<% if @plans.count > 0 %>
<p>
<%= raw _('<p>The table below lists the plans that you have created, and any that have been shared with you by others.</br>These can be edited, shared, exported or deleted at anytime.</p>')%>
</p>
<%= render(partial: "toolbar") %>
<table id="dmp_table" class="dmp_table tablesorter">
<thead>
<%= render(partial: "plan_list_head") %>
</thead>
<tbody>
<% @plans.each do |plan| %>
<%= render(partial: "plan_list_item", locals: { plan: plan } ) %>
<% end %>
</tbody>
</table>
<!-- if the user does not have projects -->
<% else %>
<p>
<%= raw _("<p><strong>Welcome.</strong></br> You are now ready to create your first DMP.</br>Click the 'Create plan' button below to begin.</p>")%>
</p>
<% end %>
<!-- link button to create a new project -->
<p>
<%= link_to _('Create plan'),
new_plan_path,
:class => "btn btn-primary" %>
</p>