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

51 lines
1.3 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>Ingredients</h1>
2016-01-14 15:22:15 -06:00
</div>
2016-01-12 18:43:00 -06:00
<% if @ingredients.empty? %>
<p>No Ingredients</p>
<% else %>
2016-01-12 18:43:00 -06:00
2016-06-29 19:14:17 -05:00
<%= link_to 'New Ingredient', new_ingredient_path, class: 'btn btn-default' %>
<br/>
2016-01-30 17:02:19 -06:00
<table class="table table-condensed table-hover">
<thead>
2016-01-12 18:43:00 -06:00
<tr>
<th>Name</th>
2016-07-05 11:19:18 -05:00
<th>USDA</th>
2016-01-30 17:02:19 -06:00
<th>KCal per 100g</th>
2016-07-05 11:19:18 -05:00
<th>Density (oz/cup)</th>
2016-01-30 17:02:19 -06:00
<th></th>
2016-01-12 18:43:00 -06:00
</tr>
</thead>
2016-01-12 18:43:00 -06:00
<tbody>
2016-07-05 11:19:18 -05:00
<% decorate(@ingredients, IngredientDecorator).each do |ingredient| %>
<tr>
<td><%= link_to ingredient.name, edit_ingredient_path(ingredient) %></td>
2016-07-05 11:19:18 -05:00
<td><%= ingredient.ndbn_check %></td>
2016-01-30 17:02:19 -06:00
<td><%= ingredient.kcal %></td>
<td><%= ingredient.density %></td>
2016-01-30 17:02:19 -06:00
<td>
2016-07-05 11:19:18 -05:00
<%= link_to ingredient, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-xs btn-danger' do %>
2016-01-30 17:02:19 -06:00
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
2016-01-12 18:43:00 -06:00
<br/>
<%= link_to 'New Ingredient', new_ingredient_path, class: 'btn btn-default' %>
2016-01-12 18:43:00 -06:00
</div>
</div>