73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
<div class="row">
|
|
<div class="col-xs-12">
|
|
|
|
<div class="page-header">
|
|
<h1>Recipes</h1>
|
|
</div>
|
|
|
|
<% if @recipes.empty? %>
|
|
<p>No Recipes</p>
|
|
<% else %>
|
|
|
|
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %>
|
|
|
|
<%= paginate @recipes, :param_name => 'criteria[page]' %>
|
|
|
|
<div class="table-responsive">
|
|
<table class="recipe-table table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th><%= index_sort_header('Name', :name, @criteria) %></th>
|
|
<th><%= index_sort_header('Rating', :rating, @criteria) %></th>
|
|
<th>Yields</th>
|
|
<th><%= index_sort_header('Time', :total_time, @criteria) %></th>
|
|
<th><%= index_sort_header('Created', :created_at, @criteria) %></th>
|
|
<% if current_user? %>
|
|
<th></th>
|
|
<% end %>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% decorate(@recipes, RecipeDecorator).each do |recipe| %>
|
|
<tr>
|
|
<td><%= link_to recipe.short_name, recipe %></td>
|
|
<td>
|
|
<% if recipe.rating %>
|
|
<%= text_field_tag('rating', recipe.rating, disabled: true, data: {rating: true, size: '20px', interval: '0.25'}) %>
|
|
<% else %>
|
|
--
|
|
<% end %>
|
|
</td>
|
|
<td><%= recipe.yields %></td>
|
|
<td><%= recipe_time(recipe) %></td>
|
|
<td><%= timestamp(recipe.created_at) %></td>
|
|
<% if current_user? %>
|
|
<td>
|
|
<%= link_to new_recipe_log_path(recipe), class: 'btn btn-sm btn-primary' do %>
|
|
<span class="glyphicon glyphicon-copy"></span>
|
|
<% end %>
|
|
<%= 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 %>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<%= paginate @recipes, :param_name => 'criteria[page]' %>
|
|
|
|
<% end %>
|
|
|
|
<br>
|
|
|
|
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %>
|
|
|
|
</div>
|
|
</div> |