Class: ODDB::Html::View::PayPal::CollectComposite

Inherits:
HtmlGrid::DivComposite
  • Object
show all
Defined in:
lib/oddb/html/view/paypal/collect.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => InlineSearch, 
  [0,1] => :title,
  [0,2] => :message,
  [0,3] => :download_links,
}
CSS_ID_MAP =
['result-search', 'title']
CSS_MAP =
{ 2 => 'explain' }
LEGACY_INTERFACE =
false

Instance Method Summary collapse

Instance Method Details



74
75
76
77
78
# File 'lib/oddb/html/view/paypal/collect.rb', line 74

def download_links(model)
  if(model && model.status == 'completed')
    ReturnDownloads.new(model.items, @session, self)
  end
end

#message(model) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/oddb/html/view/paypal/collect.rb', line 59

def message(model)
  key = if(model.nil?)
          :paypal_e_missing_invoice
        elsif(model.status == 'completed')
          suffix = @model.items.size == 1 ? @model.types.first : 'p'
          "paypal_msg_succ_#{suffix}"
        else
          :paypal_msg_unconfirmed
        end
  @lookandfeel.lookup key
end

#title(model) ⇒ Object



70
71
72
73
# File 'lib/oddb/html/view/paypal/collect.rb', line 70

def title(model)
  msg = @lookandfeel.lookup("paypal_#{model.status}".downcase) if model
  msg || @lookandfeel.lookup(:paypal_failed)
end