Class: BBMB::Html::View::FavoritesComposite

Inherits:
OrderComposite
  • Object
show all
Defined in:
lib/bbmb/html/view/favorites.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => SearchFavorites,
  [1,0] => :barcode_reader,
  [2,0] => :position_count,
  [3,0] => :favorite_transfer,
  [4,0] => :clear_favorites,
  [0,1] => FavoritesForm,
}
CSS_ID_MAP =
[ 'toolbar' ]

Instance Method Summary collapse

Instance Method Details

#barcode_reader(model) ⇒ Object



124
125
126
127
128
# File 'lib/bbmb/html/view/favorites.rb', line 124

def barcode_reader(model)
  if(@session.client_activex? && !@lookandfeel.disabled?(:barcode_reader))
    BarcodeReader.new(model, @session, self)
  end
end

#clear_favorites(model) ⇒ Object



129
130
131
132
133
# File 'lib/bbmb/html/view/favorites.rb', line 129

def clear_favorites(model)
  unless(model.empty?)
    ClearFavorites.new(model, @session, self)
  end
end

#favorite_transfer(model) ⇒ Object



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

def favorite_transfer(model)
  unless(@lookandfeel.disabled?(:transfer_dat))
    TransferDat.new(:favorite_transfer, model, @session, self)
  end
end

#position_count(model) ⇒ Object



139
140
141
142
143
144
# File 'lib/bbmb/html/view/favorites.rb', line 139

def position_count(model)
  span = HtmlGrid::Span.new(model, @session, self)
  span.value = @lookandfeel.lookup(:favorite_positions, model.size)
  span.css_class = 'guide'
  span
end