Class: ODDB::View::Admin::SelectSubstanceComposite

Inherits:
HtmlGrid::Composite show all
Defined in:
src/view/admin/selectsubstance.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :agent_name,
  [0,1] =>  :select_substance_list,
  [0,2] =>  View::Admin::SelectSubstanceForm,
  [0,3] =>  :assigned_substances,
  [0,4] =>  :assigned_list,
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] =>  'th',
  [0,1] =>  'subheading',
  [0,3] =>  'subheading',
}
SYMBOL_MAP =
{
  :assigned_substances =>  HtmlGrid::Text,
  :select_substance_list  => HtmlGrid::Text,
}

Instance Method Summary (collapse)

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) agent_name(model, session)



106
107
108
109
# File 'src/view/admin/selectsubstance.rb', line 106

def agent_name(model, session)
  sequence = model.active_agent.sequence
  [sequence.name, @lookandfeel.lookup(:select_substance)].compact.join(' - ') 
end

- (Object) assigned_list(model, session)



110
111
112
# File 'src/view/admin/selectsubstance.rb', line 110

def assigned_list(model, session)
  View::Admin::AssignedList.new(model.assigned, session, self)  
end

- (Object) init



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'src/view/admin/selectsubstance.rb', line 90

def init
  if(@model.selection.empty?)
    @components = {
      [0,0] =>  :agent_name,
      [0,1] =>  :select_substance_list_user,
      [0,2] =>  View::Admin::SelectSubstanceForm,
      [0,3] =>  :assigned_substances,
      [0,4] =>  :assigned_list,
    }
    @symbol_map = {
      :assigned_substances =>  HtmlGrid::Text,
      :select_substance_list_user =>  HtmlGrid::Text,
    }
  end
  super
end