Class: ODDB::View::NotifyInnerComposite

Inherits:
HtmlGrid::Composite show all
Includes:
HtmlGrid::ErrorMessage, Captcha
Defined in:
src/view/notify.rb

Constant Summary

COMPONENTS =
{
  [0,0]     =>  :name,
  [0,1]     =>  :notify_sender,
  [0,2]     =>  :notify_recipients,
  [0,3]     =>  :notify_message,
}
CSS_MAP =
{
  [0,0,2,5] =>  'list',
  [0,3] =>  'list top',
}
COMPONENT_CSS_MAP =
{
  [1,0,1,3] => 'xl',
}
CSS_CLASS =
'component'
LABELS =
true
LEGACY_INTERFACE =
false
LOOKANDFEEL_MAP =
{
  :name => :name_sender,
}

Instance Method Summary (collapse)

Methods included from Captcha

#captcha, #captcha_image, #challenge

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) init



50
51
52
53
54
55
56
57
58
# File 'src/view/notify.rb', line 50

def init
  unless(@session.state.passed_turing_test)
    components.update [0,4] => :captcha, [1,5] => :captcha_image
    colspan_map.store [1,5], 2
    css_map.store [1,5], 'list'
  end
  super
  error_message()
end

- (Object) notify_message(model)



59
60
61
62
63
64
65
66
# File 'src/view/notify.rb', line 59

def notify_message(model)
  input = HtmlGrid::Textarea.new(:notify_message, model, @session, self)
  input.set_attribute('wrap', true)
  js = "if(this.value.length > 500) { (this.value = this.value.substr(0,500))}" 
  input.set_attribute('onKeypress', js)
  input.label = true
  input
end

- (Object) notify_recipients(model)



67
68
69
70
71
# File 'src/view/notify.rb', line 67

def notify_recipients(model)
  input = HtmlGrid::InputText.new(:notify_recipient, model, @session, self)
  input.value = (model.notify_recipient || []).join(', ')
  input
end