Implement favoriting of projects

This commit is contained in:
2020-05-29 10:29:20 +02:00
parent c9f93d6fd8
commit 04245d63dc
8 changed files with 86 additions and 4 deletions
+33 -2
View File
@@ -1,3 +1,34 @@
<%= render(:partial => "nav")%>
<%= render(:partial => "nav") %>
<p>Fav Projects</p>
<h1>Favorite Projects</h1>
<% if !@favorite_projects[0].blank? %>
<div class="table_wrapper">
<table>
<tr>
<th><%= sortable "Title", "title" %></th>
<th><%= sortable "Registration Date", "created_at" %></th>
<th></th>
<th></th>
</tr>
<% for project in @favorite_projects %>
<tr>
<td>
<%= project['title'] %>
</td>
<td>
<%= project['created_at'] %>
</td>
<td>
<%= button_to 'Details', crawlers_projects_crawler_show_detail_url(:id => project['id']) %>
</td>
<td>
<%= button_to 'Delete', {:action => "delete_project", :id => project['id']}, :method => 'delete' %>
</td>
</tr>
<% end %>
</table>
</div>
<% else %>
No favorite projects added yet!
<% end %>