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 %>
|
|
|
|
|
2017-02-21 12:57:56 -06:00
|
|
|
<% if current_user? %>
|
|
|
|
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %><br/>
|
|
|
|
<% end %>
|
2016-09-28 17:09:52 -05:00
|
|
|
|
2016-09-28 17:28:40 -05:00
|
|
|
<%= paginate @recipes %>
|
2016-09-28 17:08:43 -05:00
|
|
|
|
2016-01-18 15:10:25 -06:00
|
|
|
<div class="table-responsive">
|
2016-08-15 17:43:02 -05:00
|
|
|
<table class="recipe-table table table-striped table-hover">
|
2016-01-18 15:10:25 -06:00
|
|
|
<thead>
|
2016-01-12 18:43:00 -06:00
|
|
|
<tr>
|
2016-09-28 17:08:43 -05:00
|
|
|
<th><%= index_sort_header('Name', :name, @criteria) %></th>
|
2016-10-20 18:06:53 -05:00
|
|
|
<th>Tags</th>
|
2016-09-28 17:08:43 -05:00
|
|
|
<th><%= index_sort_header('Rating', :rating, @criteria) %></th>
|
2016-01-18 15:10:25 -06:00
|
|
|
<th>Yields</th>
|
2016-09-28 17:08:43 -05:00
|
|
|
<th><%= index_sort_header('Time', :total_time, @criteria) %></th>
|
|
|
|
<th><%= index_sort_header('Created', :created_at, @criteria) %></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>
|
2016-07-06 16:23:06 -05:00
|
|
|
<% decorate(@recipes, RecipeDecorator).each do |recipe| %>
|
2016-01-18 15:10:25 -06:00
|
|
|
<tr>
|
2016-07-06 16:23:06 -05:00
|
|
|
<td><%= link_to recipe.short_name, recipe %></td>
|
2016-10-20 18:06:53 -05:00
|
|
|
<td><%= recipe.tag_names %></td>
|
2016-08-15 17:43:02 -05:00
|
|
|
<td>
|
2016-09-28 17:18:17 -05:00
|
|
|
<% if recipe.rating %>
|
|
|
|
<%= text_field_tag('rating', recipe.rating, disabled: true, data: {rating: true, size: '20px', interval: '0.25'}) %>
|
2016-08-15 17:43:02 -05:00
|
|
|
<% else %>
|
|
|
|
--
|
|
|
|
<% end %>
|
|
|
|
</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>
|
2016-07-27 22:30:57 -05:00
|
|
|
<%= link_to new_recipe_log_path(recipe), class: 'btn btn-sm btn-primary' do %>
|
|
|
|
<span class="glyphicon glyphicon-copy"></span>
|
|
|
|
<% end %>
|
2016-01-19 17:43:52 -06:00
|
|
|
<%= 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
|
|
|
|
2016-09-28 17:28:40 -05:00
|
|
|
<%= paginate @recipes %>
|
2016-09-28 17:08:43 -05:00
|
|
|
|
2016-01-12 18:43:00 -06:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
2017-02-21 12:57:56 -06:00
|
|
|
<% if current_user? %>
|
|
|
|
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %><br/>
|
|
|
|
<% end %>
|
2016-01-12 18:43:00 -06:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|