Class: ODDB::Html::View::Drugs::Admin::ProductComposite

Inherits:
HtmlGrid::DivComposite
  • Object
show all
Includes:
Snapback
Defined in:
lib/oddb/html/view/drugs/admin/product.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => :snapback, 
  [0,1] => InlineSearch, 
  [0,2] => :name,
  [0,3] => ProductForm,
  [0,4] => "sequences",
  [0,5] => :sequences,
}
CSS_ID_MAP =
[ 'snapback', 'result-search', 'title' ]
CSS_MAP =
{ 0 => 'before-searchbar', 4 => 'divider' }

Instance Method Summary collapse

Instance Method Details

#name(model) ⇒ Object



78
79
80
81
82
83
84
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 78

def name(model)
  name = [model.name]
  if(company = model.company)
    name.push(' - ', company.name)
  end
  name
end

#sequences(model) ⇒ Object



85
86
87
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 85

def sequences(model)
  Sequences.new(model.sequences, @session, self)
end

#snapback(model) ⇒ Object



88
89
90
91
92
# File 'lib/oddb/html/view/drugs/admin/product.rb', line 88

def snapback(model)
  [ super, @lookandfeel.lookup(:breadcrumb_divider),
    @lookandfeel.lookup(:product_details_for, 
                        model.name.send(@session.language)) ]
end