Class: ODDB::View::Drugs::PackageComposite

Inherits:
HtmlGrid::Composite show all
Includes:
AdditionalInformation, Admin::SwissmedicSource, Facebook
Defined in:
src/view/drugs/package.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :package_name,
  [0,1] =>  View::Drugs::PackageInnerComposite,
  [0,2] =>  'composition',
  [0,3] =>  :composition_text,
  [0,4] =>  'th_parts',
  [0,5] =>  :parts,
  [0,6] =>  'th_source',
  [0,7] =>  :source,
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] =>  'th',
  [0,2] =>  'subheading',
  [0,3] =>  'list',
  [0,4] =>  'subheading',
  [0,6] =>  'subheading',
  [0,7] =>  'list',
}
DEFAULT_CLASS =
HtmlGrid::Value

Instance Method Summary (collapse)

Methods included from AdditionalInformation

#_fachinfo, #atc_ddd_link, #atc_description, #comarketing, #complementary_type, #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 AtcDddLink

#atc_ddd_link

Methods included from Facebook

#facebook_fan, #facebook_share

Methods included from Admin::SwissmedicSource

#format_source, #package_source, #registration_source, #sequence_source

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) compositions(model, session = @session)



254
255
256
# File 'src/view/drugs/package.rb', line 254

def compositions(model, session=@session)
  View::Admin::Compositions.new(model.compositions, @session, self)
end

- (Object) init



243
244
245
246
247
248
249
250
251
252
253
# File 'src/view/drugs/package.rb', line 243

def init
  if @lookandfeel.enabled?(:twitter_share)
    components.store [0,8,0], :twitter_share
    css_map.store [0,8], 'list'
  end
  if @lookandfeel.enabled?(:facebook_share)
    components.store [0,8,1], :facebook_share
    css_map.store [0,8], 'list spaced'
  end
  super
end

- (Object) package_name(model, session)



257
258
259
# File 'src/view/drugs/package.rb', line 257

def package_name(model, session)
  [model.name, model.size].compact.join(' - ')
end

- (Object) parts(model, session = @session)



260
261
262
# File 'src/view/drugs/package.rb', line 260

def parts(model, session=@session)
  View::Drugs::Parts.new(model.parts, @session, self)
end

- (Object) source(model, session = @session)



263
264
265
266
267
# File 'src/view/drugs/package.rb', line 263

def source(model, session=@session)
  val = HtmlGrid::Value.new(:source, model, @session, self)
  val.value = package_source(model) if model
  val
end