<%=
# vim: set ts=2 sw=2 et ai ft=eruby:

  extra = $item_by_id.fetch('/assets/style/sprite/')[:sprites]

  # calculate offsets
  logos = begin
            h = {}
            sponsors.each do |s|
              has_logo = if s.cornerstone?
                           s.logo?
                         else
                           s.thumb?
                         end
              if has_logo
                css_class, logo = if s.cornerstone?
                                    [ ".logo-sponsor-name-#{s.id}", s.logo ]
                                  else
                                    [ ".logo-list .logo-sponsor-name-#{s.id} a", s.thumb ]
                                  end
#                image = Magick::Image.from_blob(IO.read(logo[:filename])).first
                image = Magick::Image.from_blob(IO.read(logo[:filename])).first
                h[css_class] = logo[:filename]
              end
            end
            extra.each do |css, id|
              h[css] = $item_by_id.fetch id
            end
            h
          end

  sprite_css(logos)
%>
