Class: BBMB::Html::View::FavoritesPositions

Inherits:
Positions
  • Object
show all
Includes:
Backorder, PositionMethods
Defined in:
lib/bbmb/html/view/favorites.rb

Constant Summary collapse

CSS_ID =
'favorites'
COMPONENTS =
{
  [0,0]  =>  :delete_position,
  [1,0]  =>  :quantity,
  [2,0]  =>  :description,
  [3,0]  =>  :backorder,
  [4,0]  =>  :price_base,
  [5,0]  =>  :total,
}
CSS_MAP =
{
  [0,0] => 'delete',
  [1,0] => 'tiny right',
  [2,0] => 'description',
  [4,0] => 'right',
  [5,0] => 'total',
}
CSS_HEAD_MAP =
{
  [1,0] => 'right',
  [4,0] => 'right',
  [5,0] => 'right',
}
SORT_DEFAULT =
:description

Constants inherited from Positions

Positions::CSS_CLASS

Constants included from ListPrices

ListPrices::BACKGROUND_ROW, ListPrices::BACKGROUND_SUFFIX, ListPrices::HEAD_OFFSET_STEP, ListPrices::OFFSET_STEP

Instance Method Summary collapse

Methods included from PositionMethods

#position_modifier

Methods included from Backorder

#backorder

Methods included from ListPrices

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

Methods included from Vat

#vat

Instance Method Details

#delete_position(model) ⇒ Object



71
72
73
# File 'lib/bbmb/html/view/favorites.rb', line 71

def delete_position(model)
  super(model, :favorite_product)
end

#description(model) ⇒ Object



74
75
76
# File 'lib/bbmb/html/view/favorites.rb', line 74

def description(model)
  position_modifier(model, :description, :search_favorites)
end

#quantity(model) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/bbmb/html/view/favorites.rb', line 77

def quantity(model)
  name = "quantity[#{model.article_number}]"
  input = HtmlGrid::InputText.new(name, model, @session, self)
  input.value = model.quantity
  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