Class: BBMB::Html::View::CustomersComposite

Inherits:
HtmlGrid::DivComposite
  • Object
show all
Defined in:
lib/bbmb/html/view/customers.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0]	=>	Filter,
  [0,1]	=>	:pager,
  [0,2]	=>	:customers,
}
CSS_ID_MAP =
['filter', 'pager']

Instance Method Summary collapse

Instance Method Details



127
128
129
130
131
# File 'lib/bbmb/html/view/customers.rb', line 127

def _pager_link(key, index)
  link = HtmlGrid::Link.new(key, @model, @session, self)
  link.href = @lookandfeel._event_url(:customers, :index => index)
  link
end

#customers(model) ⇒ Object



113
114
115
# File 'lib/bbmb/html/view/customers.rb', line 113

def customers(model)
  CustomersList.new(model.customers, @session, self)
end

#pager(model) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
# File 'lib/bbmb/html/view/customers.rb', line 116

def pager(model)
  pager = []
  if(model.index > 0)
    pager.push(_pager_link(:previous, model.index - model.step))
  end
  pager.push(@lookandfeel.lookup(:pager_index, model.first, model.last))
  if(model.last < model.total)
    pager.push(_pager_link(:next, model.index + model.step))
  end
  pager.push(@lookandfeel.lookup(:pager_total, model.total))
end