Class: ODDB::Html::View::PayPal::ReturnDownloads

Inherits:
HtmlGrid::List
  • Object
show all
Includes:
Util::Download
Defined in:
lib/oddb/html/view/paypal/collect.rb

Constant Summary collapse

COMPONENTS =
{
	[0,0]	=>	:download_link	
}
LEGACY_INTERFACE =
false
OMIT_HEADER =
true
STRIPED_BG =
false

Instance Method Summary collapse

Methods included from Util::Download

compressed_download, #compressed_download

Instance Method Details



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/oddb/html/view/paypal/collect.rb', line 20

def download_link(model)
   invoice = @container.model
	if model.expired?
		time = model.expiry_time
		timestr = (time) \
			? time.strftime(@lookandfeel.lookup(:time_format_long)) \
			: @lookandfeel.lookup(:paypal_e_invalid_time)
		@lookandfeel.lookup(:paypal_e_expired, model.text, timestr)
   elsif @session.allowed?('download',
                           "#{ODDB.config.auth_domain}.#{model.text}") \
           || invoice.status == 'completed'
     link = HtmlGrid::Link.new(:paypal_download, model, @session, self)
     args = [ :invoice, invoice.id,
              :file, compressed_download(model)]
     link.href = link.value = @lookandfeel._event_url(:collect, args)
     link
   elsif @session.allowed?('view', ODDB.config.auth_domain)
     @lookandfeel.lookup(:paypal_explain_poweruser)
   else
		link = HtmlGrid::Link.new(:paypal_explain_login1, model, @session, self)
		link.href = @lookandfeel._event_url(:login)
     [ 
       @lookandfeel.lookup(:paypal_explain_login0),  
       link, 
       @lookandfeel.lookup(:paypal_explain_login2),  
     ]
	end
end