Added quantity filtering by domain
This commit is contained in:
@@ -15,7 +15,7 @@ module IngredientsHelper
|
||||
end
|
||||
|
||||
def visibility_options(selected)
|
||||
options = [["all", nil], ["visible", 1], ["hidden", 0]]
|
||||
options = [["visible", 1], ["hidden", 0]]
|
||||
options_for_select(options, selected)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
module QuantitiesHelper
|
||||
def domain_options
|
||||
translations = t('.domains')
|
||||
translations = t('quantities.form.domains')
|
||||
Quantity.domains.map do |k,v|
|
||||
[translations[k.to_sym], k]
|
||||
end
|
||||
end
|
||||
|
||||
def domain_options_tag(selected)
|
||||
options_for_select(domain_options, selected)
|
||||
end
|
||||
|
||||
def parent_options(domain)
|
||||
options = nested_set_options(@quantities.send(domain), @quantity) do |i|
|
||||
raw("#{' ' * i.level}#{i.name}")
|
||||
|
||||
Reference in New Issue
Block a user