13 changed files with 58 additions and 37 deletions
@ -1,20 +1,24 @@ |
|||||||
class Form::Setup::Pages::Location < ::Form::Page |
class Form::Setup::Pages::Location < ::Form::Page |
||||||
def initialize(id, hsh, subsection) |
def initialize(_id, hsh, subsection) |
||||||
super("location", hsh, subsection) |
super("location", hsh, subsection) |
||||||
@header = "" |
@header = "" |
||||||
@description = "" |
@description = "" |
||||||
@questions = questions |
@questions = questions |
||||||
# Only display if there is more than one location |
# Only display if there is more than one location |
||||||
@depends_on = [{ |
@depends_on = [{ |
||||||
"supported_housing_schemes_enabled?" => true, |
"supported_housing_schemes_enabled?" => true, |
||||||
# scheme.locations.size > 1 => true |
"needstype" => 2, |
||||||
}] |
"scheme.locations.size" => { |
||||||
|
"operator" => ">", |
||||||
|
"operand" => 1, |
||||||
|
}, |
||||||
|
}] |
||||||
@derived = true |
@derived = true |
||||||
end |
end |
||||||
|
|
||||||
def questions |
def questions |
||||||
[ |
[ |
||||||
Form::Setup::Questions::Location.new(nil, nil, self) |
Form::Setup::Questions::Location.new(nil, nil, self), |
||||||
] |
] |
||||||
end |
end |
||||||
end |
end |
||||||
|
@ -1,17 +1,19 @@ |
|||||||
class Form::Setup::Pages::Scheme < ::Form::Page |
class Form::Setup::Pages::Scheme < ::Form::Page |
||||||
def initialize(id, hsh, subsection) |
def initialize(_id, hsh, subsection) |
||||||
super("scheme", hsh, subsection) |
super("scheme", hsh, subsection) |
||||||
@header = "" |
@header = "" |
||||||
@description = "" |
@description = "" |
||||||
@questions = questions |
@questions = questions |
||||||
|
@depends_on = [{ |
||||||
@depends_on = [{ "supported_housing_schemes_enabled?" => true }] |
"supported_housing_schemes_enabled?" => true, |
||||||
|
"needstype" => 2, |
||||||
|
}] |
||||||
@derived = true |
@derived = true |
||||||
end |
end |
||||||
|
|
||||||
def questions |
def questions |
||||||
[ |
[ |
||||||
Form::Setup::Questions::SchemeId.new(nil, nil, self) |
Form::Setup::Questions::SchemeId.new(nil, nil, self), |
||||||
] |
] |
||||||
end |
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue