Class: ODDB::View::Drugs::FiChapterChooser

Inherits:
HtmlGrid::Composite show all
Includes:
AdditionalInformation, Print
Defined in:
src/view/drugs/fachinfo.rb

Direct Known Subclasses

EditFiChapterChooser

Constant Summary

XWIDTH =
8
COLSPAN_MAP =
{
  [2,0] =>  XWIDTH - 3,
}
COMPONENTS =
{
  [0,0] =>  :full_text,
  [1,0] =>  :ddd,
  #[2,0]  => :print,
}
COMPONENT_CSS_MAP =
{
  [0,0,2] =>  'chapter-tab',
  [2,0]   => 'chapter-tab bold',
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0,2] =>  'chapter-tab',
  [2,0]   => 'chapter-tab bold',
  [XWIDTH-1,0]    =>  'chapter-tab bold',
}

Instance Method Summary (collapse)

Methods included from Print

#print, #print_edit

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 AtcDddLink

#atc_ddd_link

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) changelog(model, session)



99
100
101
102
# File 'src/view/drugs/fachinfo.rb', line 99

def changelog(model, session)
  View::Drugs::FiChapterChooserLink.new(:changelog, 
    model, session, self)
end

- (Object) ddd(model, session)



103
104
105
106
107
108
# File 'src/view/drugs/fachinfo.rb', line 103

def ddd(model, session)
  if(atc = model.atc_class)     
    View::Drugs::FiChapterChooserLink.new(:ddd, 
      model, session, self)
  end
end

- (Object) display_names(document)



109
110
111
# File 'src/view/drugs/fachinfo.rb', line 109

def display_names(document)
  document.chapter_names
end

- (Object) full_text(model, session)



112
113
114
115
116
117
118
119
120
121
122
123
# File 'src/view/drugs/fachinfo.rb', line 112

def full_text(model, session)
  if(@model.pointer.skeleton == [:create])
    @lookandfeel.lookup(:fachinfo_all)
  else
    link = HtmlGrid::Link.new(:fachinfo_all, model, session, self)
    link.set_attribute('title', @lookandfeel.lookup(:fachinfo_all_title))
    unless(@session.user_input(:chapter).nil?)
      link.href = @lookandfeel._event_url(:resolve, {:pointer => model.pointer})
    end
    link
  end
end

- (Object) init



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'src/view/drugs/fachinfo.rb', line 67

def init
  xwidth = self::class::XWIDTH
  unless(@model.pointer.skeleton == [:create])
    if(@session.state.allowed?)
      components.store([2,0], :print_edit)
      components.store([xwidth-1,0], :changelog)
    else
      components.store([2,0], :print)
    end
  end
  document = @model.send(@session.language)
  names = display_names(document)
  xx = 0
  yy = 0
  xoffset = xwidth
  pos = [0,0]
  names.each { |name|
    next if(name == :amzv)
    if((xx % xwidth) == 0)
      yy += 1
      xoffset -= xwidth
    end
    pos = [xx + xoffset, yy]
    components.store(pos, name)
    css_map.store(pos, 'chapter-tab')
    component_css_map.store(pos, 'chapter-tab')
    symbol_map.store(name, View::Drugs::FiChapterChooserLink)
    xx += 1
  }
  colspan_map.store(pos, xwidth - pos.at(0))
  super
end