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

Version Path
umlaut-3.0.0alpha11 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha10 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha9 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha8 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha7 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha6 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha5 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha4 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha3 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha2 app/views/resolve/_cover_image.html.erb
umlaut-3.0.0alpha1 app/views/resolve/_cover_image.html.erb