Class: YDIM::Html::View::AutoInvoiceReminderComposite

Inherits:
HtmlGrid::Composite show all
Defined in:
lib/ydim/html/view/autoinvoice.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0]   =>  :reminder_subject,
  [0,1]   =>  :reminder_body,
  [1,2]   =>  :reminder_date,
}
CSS_MAP =
{
  [0,1]  =>  'top',
}
COMPONENT_CSS_MAP =
{
  [0,0]  =>  'extralarge',
}
LABELS =
true

Constants inherited from HtmlGrid::Composite

HtmlGrid::Composite::LEGACY_INTERFACE

Instance Method Summary collapse

Instance Method Details

#reminder_body(model) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/ydim/html/view/autoinvoice.rb', line 35

def reminder_body(model)
  input = HtmlGrid::Textarea.new(:reminder_body, model, @session, self)
  input.set_attribute('wrap', 'hard')
  input.set_attribute('cols', '72')
  input.set_attribute('style', 'font-family: fixed;')
  input.label = true
  input.unescaped = true
  value = model.reminder_body
  if(value.nil? || value.empty?)
    input.value = @session.state.format_invoice
  end
  input
end

#reminder_date(model) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/ydim/html/view/autoinvoice.rb', line 48

def reminder_date(model)
  body = model.reminder_body.to_s.strip
  subject = model.reminder_subject.to_s.strip
  if(body.empty? || subject.empty? || !model.date)
    @lookandfeel.lookup(:reminder_none)
  else
    (model.date << 1).strftime(@lookandfeel.lookup(:reminder_date))
  end
end