Class: BBMB::Html::View::AdditionalInformation

Inherits:
HtmlGrid::Composite show all
Defined in:
lib/bbmb/html/view/order.rb

Constant Summary collapse

COMPONENTS =
{}
CSS_CLASS =
'list'
LABELS =
true
VERTICAL =
true
DEFAULT_CLASS =
HtmlGrid::Value
SYMBOL_MAP =
{
  :order_total => HtmlGrid::LabelText, 
}

Constants inherited from HtmlGrid::Composite

HtmlGrid::Composite::LEGACY_INTERFACE

Instance Method Summary collapse

Instance Method Details

#initObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/bbmb/html/view/order.rb', line 20

def init
  idx = 0
  [:reference, :comment, :priority].each { |key|
    if(@model.send(key))
      components.store([0,idx], key)
      css_map.store([0,idx,1,2], 'additional-info')
      idx += 2
    end
  }
  components.update([0,idx,0] => :order_total, [0,idx,1] => :total)
  css_map.store([0,idx], 'order-total')
  super
end

#priority(model) ⇒ Object



33
34
35
36
37
# File 'lib/bbmb/html/view/order.rb', line 33

def priority(model)
  item = HtmlGrid::Value.new(:priority, model, @session, self)
  item.value = @lookandfeel.lookup("priority_#{model.priority}")
  item
end

#total(model) ⇒ Object



38
39
40
41
42
43
# File 'lib/bbmb/html/view/order.rb', line 38

def total(model)
  span = HtmlGrid::Span.new(model, @session, self)
  span.css_id = 'total'
  span.value = model.total
  span
end