Filtering ingredients by name
Nutrients link in sidebar
This commit is contained in:
@@ -5,7 +5,11 @@
|
||||
|
||||
<h3><%= t ".heading_diet" %></h3>
|
||||
<ul>
|
||||
<li><%= link_to t(".link_ingredients"), project_ingredients_path(@project) %></li>
|
||||
<li>
|
||||
<%= link_to t(".link_ingredients"), project_ingredients_path(@project) %>
|
||||
/
|
||||
<%= link_to t(".link_nutrients"), nutrients_project_ingredients_path(@project) %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3><%= t ".heading_common" %></h3>
|
||||
|
||||
19
app/views/ingredients/_filters.html.erb
Normal file
19
app/views/ingredients/_filters.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<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>
|
||||
<tr>
|
||||
<td style="width:100%;"></td>
|
||||
<td>
|
||||
<%= text_field_tag 'filters[name]', session[:filters][:name],
|
||||
placeholder: 'name filter' %>
|
||||
</td>
|
||||
<td style="padding-left:8px;">
|
||||
<%= link_to l(:button_apply), '#',
|
||||
:class => "icon icon-checked",
|
||||
:onclick => '$("#filters_form").submit(); return false;' %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
@@ -6,7 +6,7 @@
|
||||
<th><%= l(:field_reference) %></th>
|
||||
<th><%= l(:field_group) %></th>
|
||||
<th><%= l(:field_source) %></th>
|
||||
<th style="width:15%"><%= l(:field_action) %></th>
|
||||
<th style="width:10%"><%= l(:field_action) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
id: 'add_nutrient_column', method: :post, remote: true do %>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="100%"></td>
|
||||
<td style="width:100%"></td>
|
||||
<td>
|
||||
<%= select_tag 'id', nutrient_column_options %>
|
||||
</td>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<%= render :partial => 'ingredients/form' %>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<%= render :partial => 'ingredients/filters',
|
||||
:locals => {:url => filter_project_ingredients_path(@project)} %>
|
||||
<div id='ingredients'>
|
||||
<%= render :partial => 'ingredients/list' %>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<%= render :partial => 'ingredients/form' %>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<%= render :partial => 'ingredients/filters',
|
||||
:locals => {:url => filter_nutrients_project_ingredients_path(@project)} %>
|
||||
<div id='nutrients'>
|
||||
<%= render :partial => 'ingredients/list_nutrients' %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user