parsley/app/views/recipes/index.html.erb

56 lines
1.6 KiB
Plaintext
Raw Normal View History

2016-01-12 18:43:00 -06:00
<div class="row">
<div class="col-xs-12">
2016-01-14 15:22:15 -06:00
<div class="page-header">
2016-01-18 12:58:54 -06:00
<h1>Recipes</h1>
2016-01-14 15:22:15 -06:00
</div>
2016-01-12 18:43:00 -06:00
<% if @recipes.empty? %>
<p>No Recipes</p>
<% else %>
2016-01-18 15:10:25 -06:00
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
2016-01-12 18:43:00 -06:00
<tr>
2016-01-18 15:10:25 -06:00
<th>Name</th>
<th colspan="2"></th>
<th>Yields</th>
<th>Time</th>
<th>Created</th>
<th>Modified</th>
2016-01-12 18:43:00 -06:00
</tr>
2016-01-18 15:10:25 -06:00
</thead>
<tbody>
<% @recipes.each do |recipe| %>
<tr>
2016-01-19 17:26:23 -06:00
<td><%= link_to recipe.display_name, recipe %></td>
2016-01-18 15:10:25 -06:00
<td>
<%= link_to edit_recipe_path(recipe), class: 'btn btn-sm btn-primary' do %>
<span class="glyphicon glyphicon-pencil"></span>
<% end %>
</td>
<td>
<%= link_to recipe, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</td>
<td><%= recipe.yields %></td>
<td><%= recipe_time(recipe) %></td>
<td><%= timestamp(recipe.created_at) %></td>
<td><%= timestamp(recipe.updated_at) %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
2016-01-12 18:43:00 -06:00
<% end %>
<br>
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %>
</div>
</div>