Added Ingredient visibility filter
Fixed index display (many? -> any? persisted)
This commit is contained in:
@@ -1,21 +1,26 @@
|
||||
<fieldset id="filters" class="collapsible">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<%= form_tag url, id: 'filters_form', method: :get, remote: true do %>
|
||||
<table>
|
||||
<table class="filter">
|
||||
<tr>
|
||||
<td style="width:100%;"></td>
|
||||
<td>
|
||||
<%= text_field_tag 'filters[name]', session[:filters][:name],
|
||||
placeholder: 'name filter' %>
|
||||
placeholder: 'name' %>
|
||||
</td>
|
||||
<td style="padding-left:8px;">
|
||||
<td>
|
||||
<%= select_tag 'filters[visibility]',
|
||||
visibility_options(session[:filters][:visibility]),
|
||||
:onchange => '$("#filters_form").submit(); return false;' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to l(:button_apply), '#', :class => "icon icon-checked",
|
||||
:onclick => '$("#filters_form").submit(); return false;' %>
|
||||
</td>
|
||||
<td style="padding-left:8px;">
|
||||
<td>
|
||||
<%= link_to l(:button_clear), '#', :class => "icon icon-reload",
|
||||
:onclick => '$("#filters_form input").val(""); $("#filters_form").submit();
|
||||
return false;' %>
|
||||
:onclick => '$("#filters_form input, #filters_form select").val("");
|
||||
$("#filters_form").submit(); return false;' %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if @ingredients.many? %>
|
||||
<% if @ingredients.any? { |i| i.persisted? } %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if @quantities.many? %>
|
||||
<% if @quantities.any? { |q| q.persisted? } %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<% if @sources.many? %>
|
||||
<% if @sources.any? { |s| s.persisted? } %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<% if @units.many? %>
|
||||
<% if @units.any? { |u| u.persisted? } %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user