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>Yields</th>
|
|
|
|
<th>Time</th>
|
|
|
|
<th>Created</th>
|
2016-04-04 14:28:23 -05:00
|
|
|
<% if current_user? %>
|
|
|
|
<th></th>
|
|
|
|
<% end %>
|
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-04-04 14:28:23 -05:00
|
|
|
<td><%= recipe.yields %></td>
|
|
|
|
<td><%= recipe_time(recipe) %></td>
|
|
|
|
<td><%= timestamp(recipe.created_at) %></td>
|
2016-01-19 17:43:52 -06:00
|
|
|
<% if current_user? %>
|
|
|
|
<td>
|
|
|
|
<%= link_to edit_recipe_path(recipe), class: 'btn btn-sm btn-primary' do %>
|
|
|
|
<span class="glyphicon glyphicon-pencil"></span>
|
|
|
|
<% end %>
|
|
|
|
<%= 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>
|
|
|
|
<% end %>
|
2016-01-18 15:10:25 -06:00
|
|
|
</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>
|