Class: ODDB::View::Admin::RootPackageComposite

Inherits:
PackageComposite show all
Includes:
HtmlGrid::FormMethods, FormMethods
Defined in:
src/view/admin/package.rb

Direct Known Subclasses

DeductiblePackageComposite

Constant Summary

LEGACY_INTERFACE =
false
COMPONENTS =
{
  [0,0] =>  :package_name,
  [0,1] =>  View::Admin::PackageForm,
  [0,2] =>  'th_source',
  [0,3] =>  :source,
}
CSS_MAP =
{
  [0,0] =>  'th',
  [0,2] =>  'subheading',
}

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Constants inherited from PackageComposite

COMPONENTS, CSS_CLASS, CSS_MAP

Instance Method Summary (collapse)

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Methods inherited from PackageComposite

#package_name, #source

Methods included from 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) init



325
326
327
328
329
330
331
332
333
334
335
336
# File 'src/view/admin/package.rb', line 325

def init
  unless @model.is_a?(Persistence::CreateItem)
    components.update(
      [0,2] =>  :parts,
      [0,3] =>  :parts_form,
      [0,4] =>  'th_source',
      [0,5] =>  :source
    )
    css_map.store [0,4], 'subheading'
  end
  super
end

- (Object) parts(model)



337
338
339
340
# File 'src/view/admin/package.rb', line 337

def parts(model)
  key = model.parts.size > 1 ? :parts : :package_and_substances
  @lookandfeel.lookup(key)
end

- (Object) parts_form(model)



341
342
343
# File 'src/view/admin/package.rb', line 341

def parts_form(model)
  Parts.new(model.parts, @session, self)
end