Class: ODDB::View::LimitForm

Inherits:
Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
src/view/limit.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :query_limit_poweruser_365,
  [2,0] =>  :query_limit_poweruser_a,
  [0,1] =>  :query_limit_poweruser_30,
  [2,1] =>  :query_limit_poweruser_b,
  [0,2] =>  :query_limit_poweruser_1,
  [2,2] =>  :query_limit_poweruser_c,
  [2,3] =>  :submit,
}
CSS_MAP =
{
  [0,0,3,4] =>  'list top',
  [1,0,1,4] =>  'small top',
}
LABELS =
true
LEGACY_INTERFACE =
false
EVENT =
:proceed_poweruser

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Instance Method Summary (collapse)

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Instance Method Details

- (Object) init



28
29
30
31
# File 'src/view/limit.rb', line 28

def init
  super
  error_message
end

- (Object) query_limit_poweruser_1(model)



50
51
52
# File 'src/view/limit.rb', line 50

def query_limit_poweruser_1(model)
  query_limit_poweruser_radio(1)
end

- (Object) query_limit_poweruser_30(model)



53
54
55
# File 'src/view/limit.rb', line 53

def query_limit_poweruser_30(model)
  query_limit_poweruser_radio(30)
end

- (Object) query_limit_poweruser_365(model)



56
57
58
# File 'src/view/limit.rb', line 56

def query_limit_poweruser_365(model)
  query_limit_poweruser_radio(365)
end

- (Object) query_limit_poweruser_a(model)



32
33
34
35
# File 'src/view/limit.rb', line 32

def query_limit_poweruser_a(model)
  query_limit_poweruser_txt(:query_limit_poweruser_a, 
    @session.state.price(365))
end

- (Object) query_limit_poweruser_b(model)



36
37
38
39
40
41
# File 'src/view/limit.rb', line 36

def query_limit_poweruser_b(model)
  price = @session.state.price(30)
  @lookandfeel.lookup(:query_limit_poweruser_b,
    @session.class.const_get(:QUERY_LIMIT),
    @lookandfeel.format_price(price * 100, 'EUR'))
end

- (Object) query_limit_poweruser_c(model)



42
43
44
45
# File 'src/view/limit.rb', line 42

def query_limit_poweruser_c(model)
  query_limit_poweruser_txt(:query_limit_poweruser_c,
    @session.state.price(1))
end

- (Object) query_limit_poweruser_radio(value)



59
60
61
62
63
# File 'src/view/limit.rb', line 59

def query_limit_poweruser_radio(value)
  radio = HtmlGrid::InputRadio.new('days', @model, @session, self)
  radio.value = value
  radio
end

- (Object) query_limit_poweruser_txt(key, price)



46
47
48
49
# File 'src/view/limit.rb', line 46

def query_limit_poweruser_txt(key, price)
  @lookandfeel.lookup(key, 
    @lookandfeel.format_price(price * 100, 'EUR'))
end