Class: ODDB::View::Migel::List

Inherits:
HtmlGrid::List show all
Includes:
AdditionalInformation, DataFormat, LookandfeelComponents
Defined in:
src/view/migel/result.rb

Direct Known Subclasses

AlphabeticalList, ResultList

Constant Summary

COMPONENTS =
{}
CSS_CLASS =
'composite'
CSS_HEAD_KEYMAP =
{
  :feedback             => 'th right',
  :google_search        => 'th right',
  :notify               => 'th right',
  :price                => 'th right',
}
CSS_KEYMAP =
{
  :date                 => 'list',
  :feedback             => 'list right',
  :google_search        => 'list right',
  :limitation_text      => 'list',
  :migel_code           => 'list',
  :notify               => 'list right',
  :price                => 'list right',
  :product_description  => 'list',
  :qty_unit             => 'list',
}
CSS_HEAD_MAP =
{}
CSS_MAP =
{}
LOOKANDFEEL_MAP =
{
  :limitation_text => :nbsp,
}
SORT_HEADER =
false
SYMBOL_MAP =
{
  :date   => HtmlGrid::DateValue,
}
DEFAULT_CLASS =
HtmlGrid::Value
SORT_DEFAULT =
nil
LEGACY_INTERFACE =
false

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Methods included from LookandfeelComponents

#reorganize_components

Methods included from DataFormat

#breakline, #company_name, #most_precise_dose, #name_base, #price, #price_exfactory, #price_public

Methods included from ExternalLinks

#contact_link, #data_declaration, #external_link, #faq_link, #generic_definition, #help_link, #legal_note, #meddrugs_update, #wiki_link

Methods included from AdditionalInformation

#_fachinfo, #atc_ddd_link, #atc_description, #comarketing, #complementary_type, #compositions, #ddd_price, #deductible, #fachinfo, #feedback, #google_search, #ikscat, #limitation_link, #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

Instance Method Details

- (Object) init



55
56
57
58
59
# File 'src/view/migel/result.rb', line 55

def init
  reorganize_components(:migel_list_components)
  @width = @components.keys.collect { |x, y| x }.max
  super
end

- (Object) limitation_text(model)



60
61
62
63
64
65
66
# File 'src/view/migel/result.rb', line 60

def limitation_text(model)
  if(sltxt = model.limitation_text)
    limitation_link(sltxt)
  else
    ''
  end
end

- (Object) product_description(model)



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'src/view/migel/result.rb', line 67

def product_description(model)
  link = PointerLink.new(:to_s, model, @session, self)
  text = [
    model,
    (model.product_text if(model.respond_to?(:product_text))),
  ].compact.collect { |item| 
    item.send(@session.language) 
  }.join(': ').gsub("\n", ' ')
  if(text.size > 60)
    text = text[0,57] << '...'
  end
  link.value = text
  link
end