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



134
135
136
137
138
# File 'lib/bbmb/html/view/customers.rb', line 134

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



120
121
122
# File 'lib/bbmb/html/view/customers.rb', line 120

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

#pager(model) ⇒ Object



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/bbmb/html/view/customers.rb', line 123

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