Class: ODDB::View::Drugs::FachinfoComposite

Inherits:
FachinfoPreviewComposite show all
Defined in:
src/view/drugs/fachinfo.rb

Direct Known Subclasses

RootFachinfoComposite

Constant Summary

CHOOSER_CLASS =
View::Drugs::FiChapterChooser
COMPONENTS =
{
  [0,0] =>  :fachinfo_name,
  [1,0] =>  :company_name,
  [0,1] =>  :chapter_chooser,
  [0,2] =>  :document,
}
COLSPAN_MAP =
{
  [0,1] =>  2,
  [0,2] =>  2,
}
CSS_MAP =
{
  [0,0] => 'th',
  [1,0] => 'th right',
  [0,2] => 'list',
}

Constants inherited from FachinfoPreviewComposite

COLSPAN_MAP, COMPONENTS, CSS_CLASS, CSS_MAP, DEFAULT_CLASS

Instance Method Summary (collapse)

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) chapter_chooser(model, session)



209
210
211
212
213
# File 'src/view/drugs/fachinfo.rb', line 209

def chapter_chooser(model, session)
  if(klass = self.class.const_get(:CHOOSER_CLASS))
    klass.new(model, session, self)
  end
end

- (Object) chapter_view(chapter, document)



214
215
216
# File 'src/view/drugs/fachinfo.rb', line 214

def chapter_view(chapter, document)
  View::Chapter.new(chapter, document, @session, self)
end

- (Object) document(model, session)



217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'src/view/drugs/fachinfo.rb', line 217

def document(model, session)
  document = model.send(session.language)
  chapter = @session.user_input(:chapter)
  if(chapter == 'ddd')
    View::Drugs::DDDTree.new(model.atc_class, session, self)
  elsif(chapter == 'changelog')
    View::ChangeLog.new(model.change_log, session, self)
  elsif(chapter != nil)
    chapter_view(chapter, document)
  else
    View::Drugs::FachinfoInnerComposite.new(document, session, self)
  end
end

- (Object) fachinfo_name(model, session)



230
231
232
233
# File 'src/view/drugs/fachinfo.rb', line 230

def fachinfo_name(model, session)
  model = model.send(@session.language)
  super(model, session)
end