Module: ODDB::Html::View::AlphaHeader

Included in:
Drugs::ProductsList
Defined in:
lib/oddb/html/view/alpha_header.rb

Constant Summary collapse

EMPTY_LIST_KEY =
:choose_range

Instance Method Summary collapse

Instance Method Details

#compose_header(offset = [0,0]) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/oddb/html/view/alpha_header.rb', line 9

def compose_header(offset=[0,0])
  offset = super
  current_range = @model.query
  @session.state.intervals.each { |range|
    link = HtmlGrid::Link.new(:range, @model, @session, self)
    link.value = range
    unless(range == current_range)
      link.href = @lookandfeel._event_url(@session.direct_event,
        'range' => range)
    end
    @grid.add(link, *offset)
  }
  @grid.set_colspan(offset.at(0), offset.at(1), full_colspan)
  @grid.add_attribute('id', 'alphaheader', *offset)
  resolve_offset(offset, self::class::OFFSET_STEP)
end