Class: ODDB::View::Migel::ResultList

Inherits:
List show all
Defined in:
src/view/migel/result.rb

Constant Summary

Constants inherited from List

COMPONENTS, CSS_CLASS, CSS_HEAD_KEYMAP, CSS_HEAD_MAP, CSS_KEYMAP, CSS_MAP, DEFAULT_CLASS, LEGACY_INTERFACE, LOOKANDFEEL_MAP, SORT_DEFAULT, SORT_HEADER, SYMBOL_MAP

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Methods inherited from List

#init, #limitation_text, #product_description

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, #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

Instance Method Details

- (Object) compose_list(model = @model, offset = [0,0])



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'src/view/migel/result.rb', line 83

def compose_list(model=@model, offset=[0,0])
  bg_flag = false
  group = nil
  model.each { |subgroup|
    if(group != subgroup.group)
      group = subgroup.group
      compose_subheader(group, offset, 'list migel-group')
      offset = resolve_offset(offset, self::class::OFFSET_STEP)
    end
    compose_subheader(subgroup, offset)
    offset = resolve_offset(offset, self::class::OFFSET_STEP)
    products = subgroup.products
    super(products, offset)
    offset[1] += products.size
  }
end

- (Object) compose_subheader(item, offset, css = 'list atc')



99
100
101
102
103
104
105
106
# File 'src/view/migel/result.rb', line 99

def compose_subheader(item, offset, css='list atc')
  xval, yval = offset
  values = [limitation_text(item), nil, item.migel_code, nil,
    product_description(item)]
  @grid.add(values, xval, yval)
  @grid.add_style(css, xval, yval, 3)
  @grid.set_colspan(xval + 2, yval, @width - xval - 1)
end