Class: ODDB::View::Drugs::PackagesList

Inherits:
HtmlGrid::List show all
Defined in:
src/view/drugs/narcotic.rb

Constant Summary

COMPONENTS =
{
  [0,0]  => :ikskey,
  [1,0]  => :name_base,
  [2,0]  => :size,
}
CSS_MAP =
{
  [0,0]  => 'top list',
  [1,0]  => 'list',
  [2,0]  => 'list',
}
DEFAULT_CLASS =
HtmlGrid::Value
DEFAULT_HEAD_CLASS =
'subheading'
SORT_HEADER =
false
SORT_DEFAULT =
nil
LEGACY_INTERFACE =
false
LOOKANDFEEL_MAP =
{
  :ikskey  => :title_packages,
  :name_base =>  :nbsp,
  :size  => :nbsp,
}

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Instance Method Details

- (Object) ikskey(model)



38
39
40
41
# File 'src/view/drugs/narcotic.rb', line 38

def ikskey(model)
  item = model.ikskey
  self.link(model, item)
end

- (Object) init



32
33
34
35
36
37
# File 'src/view/drugs/narcotic.rb', line 32

def init
  @model = @model.sort_by { |package|
    [package.name_base.to_s, package.size.to_f]
  }
  super
end


49
50
51
52
53
54
# File 'src/view/drugs/narcotic.rb', line 49

def link(model, item)
  link = HtmlGrid::Link.new(:show, model, @session, self)
  link.href = @lookandfeel._event_url(:show, {:pointer => model.pointer})
  link.value = item
  link
end

- (Object) name_base(model)



42
43
44
45
# File 'src/view/drugs/narcotic.rb', line 42

def name_base(model)
  item  = model.name_base
  self.link(model, item)
end

- (Object) size(model)



46
47
48
# File 'src/view/drugs/narcotic.rb', line 46

def size(model)
  model.size
end