Module: ODDB::View::AlphaHeader

Included in:
ODDB::View::Admin::IndicationList, ODDB::View::Admin::OrphanedFachinfosList, ODDB::View::Admin::OrphanedPatinfosList, ODDB::View::Admin::PatinfoDeprivedSequencesList, ODDB::View::Admin::PatinfoStatsList, ODDB::View::Analysis::AlphabeticalList, Companies::RootCompanyList, Drugs::FachinfoList, Drugs::LimitationTextList, Drugs::NarcoticList, Drugs::PatinfoList, Drugs::SequenceList, Hospitals::HospitalList, Migel::AlphabeticalList, Substances::List
Defined in:
src/view/alphaheader.rb

Constant Summary

EMPTY_LIST_KEY =
:choose_range

Instance Method Summary (collapse)

Instance Method Details

- (Object) compose_header(offset = [0,0])



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'src/view/alphaheader.rb', line 8

def compose_header(offset=[0,0])
  offset = super
  divider = false
  current_range = @session.state.interval
  @session.state.intervals.each {|range|
    @grid.add(divider, *offset) if divider
    divider = @lookandfeel.lookup(:navigation_divider) 
    link = HtmlGrid::Link.new(:range, @model, @session, self)
    link.value = @lookandfeel.lookup(range.intern)
    unless(range == current_range)
      link.href = @lookandfeel._event_url(@session.direct_event, 
        {'range' => range})
    end
    link.set_attribute('class', 'subheading bold')
    @grid.add(link, *offset)
  }
  @grid.set_colspan(offset.at(0), offset.at(1), full_colspan)
  @grid.add_style('subheading bold', *offset)
  resolve_offset(offset, self::class::OFFSET_STEP)
end