Class: ODDB::View::Admin::SelectSubstanceForm

Inherits:
HtmlGrid::Form
  • Object
show all
Defined in:
src/view/admin/selectsubstance.rb

Constant Summary

CSS_CLASS =
'composite'
COMPONENTS =
{
  [0,0]     =>  :selection_list,
  [0,1,0]   => :pointer,
  [0,1,1]   => :user_input,
  [0,1,2]   => :user_input_hint,
  [0,2]     =>  :submit,
}
LABELS =
false
SYMBOL_MAP =
{
  :user_input_hint =>  HtmlGrid::Text,
}
EVENT =
:update

Instance Method Summary (collapse)

Instance Method Details

- (Object) init



41
42
43
44
45
46
47
48
49
50
51
# File 'src/view/admin/selectsubstance.rb', line 41

def init
  if(@model.selection.empty?)
    @components = {
      [0,0,0]   => :pointer,
      [0,0,1]   => :user_input,
      [0,0,2]   =>  :user_input_hint,
      [0,1]     =>  :submit,
    }
  end
  super
end

- (Object) pointer(model, session)



52
53
54
# File 'src/view/admin/selectsubstance.rb', line 52

def pointer(model, session)
  HtmlGrid::InputRadio.new(:pointer, model.new_substance, session, self)
end

- (Object) selection_list(model, session)



55
56
57
# File 'src/view/admin/selectsubstance.rb', line 55

def  selection_list(model, session)
  SelectionList.new(model.selection, session, self)
end

- (Object) user_input(model, session)



58
59
60
# File 'src/view/admin/selectsubstance.rb', line 58

def user_input(model, session)
  model.user_input[:substance]
end