1
0

Renamed Ingredient comment -> notes

This commit is contained in:
cryptogopher 2020-03-25 00:26:35 +01:00
parent 08860cbfab
commit c262e82c7b
6 changed files with 10 additions and 10 deletions

View File

@ -27,8 +27,8 @@ class BodyTrackersController < BodyTrackingPluginController
attrs = q.attributes.except('id', 'project_id', 'parent_id', 'lft', 'rgt',
'created_at', 'updated_at')
attrs['parent'] = q.parent ? available[[q.parent.name, q.parent.domain]] : nil
attrs['formula_attributes'] = q.formula.attributes.except('id', 'quantity_id',
'created_at', 'updated_at')
attrs['formula_attributes'] = q.formula ? q.formula.attributes
.except('id', 'quantity_id', 'created_at', 'updated_at') : {}
obj = @project.quantities.create(attrs)
available[[q.name, q.domain]] = obj
end

View File

@ -95,7 +95,7 @@ class IngredientsController < BodyTrackingPluginController
i_params = {
name: r.delete('Name'),
comment: r.delete('Comment'),
notes: r.delete('Notes'),
ref_amount: 100.0,
ref_unit: units['g'],
group: r.delete('Group') || :other,
@ -184,7 +184,7 @@ class IngredientsController < BodyTrackingPluginController
def ingredient_params
params.require(:ingredient).permit(
:name,
:comment,
:notes,
:ref_amount,
:ref_unit_id,
:group,

View File

@ -2,7 +2,7 @@
<div class="box tabular">
<p><%= f.text_field :name, size: 40, required: true %></p>
<p><%= f.text_area :comment, cols: 40, rows: 3, required: false,
<p><%= f.text_area :notes, cols: 40, rows: 3, required: false,
style: "width: 100%;" %></p>
<p>
<%= f.number_field :ref_amount, size: 8, required: true, min: 0,

View File

@ -8,7 +8,7 @@
<thead>
<tr>
<th style="width:50%"><%= l(:field_name) %></th>
<th><%= l(:field_comment) %></th>
<th><%= l(:field_notes) %></th>
<th><%= l(:field_reference) %></th>
<th><%= l(:field_group) %></th>
<th><%= l(:field_source) %></th>
@ -28,7 +28,7 @@
} %>
<%= i.name %>
</td>
<td class="comment ellipsible"><%= i.comment %></td>
<td class="notes ellipsible"><%= i.notes %></td>
<td class="reference value"><%= i.ref_amount %> [<%= i.ref_unit.shortname %>]</td>
<td class="group"><%= i.group %></td>
<td class="source">

View File

@ -5,7 +5,7 @@ en:
field_taken_at_date: 'Taken at'
field_order: 'Order'
field_action: 'Action'
field_comment: 'Comment'
field_notes: 'Notes'
field_reference: 'Reference'
field_group: 'Group'
field_source: 'Source'
@ -87,7 +87,7 @@ en:
import_hints: 'CSV file has to include header with column names. Recognized column
names are:
(1) ingredient attributes, case sensitive:
"Name" - required, "Comment" - optional, "Reference" - defaults to 100[g],
"Name" - required, "Notes" - optional, "Reference" - defaults to 100[g],
"Group" - defaults to "other", "Source" - optional, "SourceIdent" - optional,
(2) quantities'' names with unit short name in square brackets.
Sample header: "Name,Reference,Group,Proteins[g],Fats[g],Carbohydrates[g]".

View File

@ -47,7 +47,7 @@ class CreateSchema < ActiveRecord::Migration
create_table :ingredients do |t|
t.references :project
t.string :name
t.text :comment
t.text :notes
t.decimal :ref_amount, precision: 12, scale: 6
t.references :ref_unit
t.integer :group