app/views/topics/related_items_for_topics/_still_images.html.haml

Summary

Maintainability
Test Coverage
-if related_still_images.empty?
  - visible_class = "no-items"
-else
  - visible_class = "related-items-section"

- related_to_path = basket_search_related_to_path({related_item_id: @topic.id, related_item_type: 'Topic', controller_name_for_zoom_class: 'StillImage', urlified_name: @topic.basket.urlified_name})

#detail-linked-images{:class => visible_class}
  %h4
    %a.small{:href => related_to_path}
      = "Images (#{related_still_images.count})"
      %img.expand_collapse_image{:alt => "Related_items_collapsed", :src => "/assets/related_items_collapsed.gif"}/
  %hr/

  #related_still_image_container
    %ul.results-list.images-list
      - last_five_related_still_images = related_still_images.last(5).reverse

      - last_five_related_still_images.each do |related_item|
        - small_sq_image_file = related_item.image_files.where(thumbnail: 'small_sq').first
        %li
          %a{:href => basket_aware_url_for(related_item)}
            %img{:alt => related_item.title, :src => small_sq_image_file.public_filename, :size => small_sq_image_file.image_size }/

      - if  related_still_images.count > 5
        - overflow = related_still_images.count - 5
        %li.more
          %a.small{:href => related_to_path}=  "#{overflow} more like this >>".html_safe

  #related_items_slideshow.slideshow_div

  #related_items_slideshow_controls.slideshow_div
    %p.buttons.one_button
      %a#play_slideshow{:href => not_implemented_path}
        %img{:alt => "Play Slideshow. ", :src => "/assets/slideshow_play.gif?1323654851", :title => "Play Slideshow. "}/