Class: BBMB::Html::View::Products

Inherits:
HtmlGrid::FormList
  • Object
show all
Includes:
Backorder, ListPrices, Multilingual, HtmlGrid::ErrorMessage
Defined in:
lib/bbmb/html/view/result.rb

Direct Known Subclasses

FavoritesProducts

Constant Summary collapse

CSS_CLASS =
'list'
COMPONENTS =
{
  [0,0]	=>	:quantity,
  [1,0]	=>	:description,
  [2,0]	=>	:backorder,
  [3,0] =>  :price,
}
CSS_HEAD_MAP =
{
  [3,0] => 'right',
}
CSS_MAP =
{
  [0,0] => 'tiny',
  [1,0] => 'description',
  [3,0] => 'right'
}
OFFSET_STEP =
[0,1]
HEAD_OFFSET_STEP =
[0,1]
EVENT =
:order_product
FORM_NAME =
'products'
SORT_DEFAULT =
:description

Constants included from ListPrices

ListPrices::BACKGROUND_ROW, ListPrices::BACKGROUND_SUFFIX

Instance Method Summary collapse

Methods included from Multilingual

#description

Methods included from Util::Multilingual

#_

Methods included from ListPrices

#price1, #price2, #price3, #price4, #price5, #price6, #price_levels, #pricex

Methods included from Vat

#vat

Methods included from Backorder

#backorder

Instance Method Details



69
70
71
# File 'lib/bbmb/html/view/result.rb', line 69

def compose_footer(matrix)
  super unless(@model.empty?)
end

#initObject



65
66
67
68
# File 'lib/bbmb/html/view/result.rb', line 65

def init
  super
  error_message
end

#quantity(product) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/bbmb/html/view/result.rb', line 72

def quantity(product)
  name = "quantity[#{product.article_number}]"
  input = HtmlGrid::InputText.new(name, product, @session, self)
  input.value = @model.ordered_quantity(product)
  input.css_class = 'tiny'
  script = "if(this.value == '0') this.value = '';"
  input.set_attribute('onFocus', script)
  script = "if(this.value == '') this.value = '0';"
  input.set_attribute('onBlur', script)
  input
end