Class: ODDB::Html::View::Drugs::ProductsList

Inherits:
List
  • Object
show all
Includes:
AlphaHeader, ProductMethods, Google, OffsetHeader
Defined in:
lib/oddb/html/view/drugs/products.rb

Constant Summary

Constants included from AlphaHeader

AlphaHeader::EMPTY_LIST_KEY

Constants inherited from List

List::BACKGROUND_ROW, List::BACKGROUND_SUFFIX, List::LEGACY_INTERFACE, List::SORT_DEFAULT

Instance Method Summary collapse

Methods included from Google

#google

Methods included from ProductMethods

#company

Methods included from OffsetHeader

#compose_header

Methods included from AlphaHeader

#compose_header

Methods inherited from List

#query_args, #sort_link

Instance Method Details

#atc(model) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/oddb/html/view/drugs/products.rb', line 35

def atc(model)
  atcs = model.atcs.sort
  unless(atcs.empty?)
    span = HtmlGrid::Span.new(model, @session, self)
    names = []
    codes = []
    atcs.each { |atc|
      names.push(atc.name.send(@session.language))
      codes.push(atc.code)
    }
    span.value = codes.join(', ')
    span.css_id = "atc_#@list_index"
    span.dojo_title = codes.join(', ')
    span
  end
end


51
52
53
54
55
56
57
58
# File 'lib/oddb/html/view/drugs/products.rb', line 51

def fachinfo_link(model)
  if(seq = model.sequences.find { |sq| sq.fachinfo.send(@session.language) })
    link = HtmlGrid::Link.new(:square_fachinfo, seq, @session, self)
    link.css_class = 'square fachinfo'
    link.href = @lookandfeel._event_url(:fachinfo, [:uid, seq.uid])
    link
  end
end

#initObject



27
28
29
30
31
32
33
34
# File 'lib/oddb/html/view/drugs/products.rb', line 27

def init
  @components = @lookandfeel.products_components
  @components.each { |key, val|
    css_map.store(key, val.to_s)
  }
  @css_head_map = @css_map
  super
end


59
60
61
62
63
64
65
66
# File 'lib/oddb/html/view/drugs/products.rb', line 59

def patinfo_link(model)
  if(seq = model.sequences.find { |sq| sq.patinfo.send(@session.language) })
    link = HtmlGrid::Link.new(:square_patinfo, seq, @session, self)
    link.css_class = 'square patinfo'
    link.href = @lookandfeel._event_url(:patinfo, [:uid, seq.uid])
    link
  end
end

#product(model) ⇒ Object



67
68
69
70
71
72
73
74
# File 'lib/oddb/html/view/drugs/products.rb', line 67

def product(model)
  link = HtmlGrid::Link.new(:product, model, @session, self)
  name = model.name.send(@session.language)
  link.value = name
  link.href = @lookandfeel._event_url(:search, 
                                      [:query, name, :dstype, 'tradename'])
  link
end

#query_keyObject



75
76
77
# File 'lib/oddb/html/view/drugs/products.rb', line 75

def query_key
  :range
end