Sha256: 5b568447cff607df514f959b07cb0221e84e4815e128646a06376d80b2da5ba2
Contents?: true
Size: 1.09 KB
Versions: 11
Compression:
Stored size: 1.09 KB
Contents
<%= # Set parameter for size, small|medium|large if you like size ||= "medium" fix_size ||= true # small med and x-large correspond roughly to amazon sm, med and lg. # large corresponds roughly to google medium. Just one dimension to # prevent disproportionate scaling. dimensions = { "small" => { "height" => 80 }, "medium" => { "height" => 160}, "large" => { "height" => 200 }, "extra-large" => { "height" => 475}} img_st = cover_image_response(size) if img_st img_data = img_st.view_data img_params = {'src'=>img_data[:url], 'class'=>'cover_image', 'alt'=>h(img_data[:display_text])} # If we're in https mode, and the original url is http, use # Umlaut proxy to avoid browser security warning. if (request.protocol != img_params['src'][0..6]) img_params['src'] = url_for(:controller => "resource", :action => "proxy", :id => img_st.id ) end img_params.merge!( dimensions[size]) if fix_size tag('img', img_params ) end %>
Version data entries
11 entries across 11 versions & 1 rubygems