Class: ODDB::View::Interactions::FiList

Inherits:
HtmlGrid::Component show all
Includes:
AdditionalInformation
Defined in:
src/view/interactions/basket.rb

Instance Method Summary (collapse)

Methods included from AdditionalInformation

#_fachinfo, #atc_ddd_link, #atc_description, #comarketing, #complementary_type, #compositions, #ddd_price, #deductible, #fachinfo, #feedback, #google_search, #ikscat, #limitation_link, #limitation_text, #minifi, #narcotic, #notify, #patent, #patinfo, #qty_unit, #square, #twitter_share

Methods included from PartSize

#comparable_size, #part_size

Methods included from Drugs::AtcDddLink

#atc_ddd_link

Methods inherited from HtmlGrid::Component

#additional_javascripts, #dynamic_html

Instance Method Details

- (Object) to_html(context)



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'src/view/interactions/basket.rb', line 102

def to_html(context)
  lang = @session.language
  content = @model.collect { |substance, interactions| 
    next unless substance
    text = HtmlGrid::RichText.new(@model, @session, self)
    text << substance.send(lang) << "<br>"
    interactions.each { |interaction|
      (fi = interaction.fachinfo) && (doc = fi.send(lang)) or next
      link = _fachinfo(fi)
      link.href << "/chapter/interactions/highlight/" << interaction.match
      name = HtmlGrid::Link.new(:name, doc, @session, self)
      name.href = link.href
      name.value = doc.name
      text << link << name << '<br>'
    }
    context.li { text.to_html(context) } 
  }.join
  context.ul { content } unless(content.empty?)
end