Mercurial > hg > soundsoftware-site
comparison app/helpers/attachments_helper.rb @ 969:e632838adb35 cannam
Merge from branch "live"
author | Chris Cannam |
---|---|
date | Wed, 17 Oct 2012 10:42:55 +0100 |
parents | 19884e9d5eff |
children | bb32da3bea34 |
comparison
equal
deleted
inserted
replaced
965:4018f255c97b | 969:e632838adb35 |
---|---|
40 api.content_url url_for(:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename, :only_path => false) | 40 api.content_url url_for(:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename, :only_path => false) |
41 api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author | 41 api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author |
42 api.created_on attachment.created_on | 42 api.created_on attachment.created_on |
43 end | 43 end |
44 end | 44 end |
45 | |
46 # Returns true if user agent appears (approximately) to be a search | |
47 # bot or crawler | |
48 def user_is_search_bot? | |
49 agent = request.env['HTTP_USER_AGENT'] | |
50 agent and agent =~ /(bot|slurp|crawler|spider)\b/i | |
51 end | |
45 end | 52 end |