:ruby
  classes = %w[snapshot-card thumbnail]
  classes << 'snapshot-card-pending' if snapshot.pending?
  data = {
    keyboard_focusable: true,
    auto_refresh_type: 'snapshot',
    auto_refresh_id:   snapshot.id,
  }
  link_options = { class: classes, title: snapshot.title, data: data }
  link_options['aria-selected'] = true if local_assigns[:active]

= link_to snapshot_path(snapshot), link_options do
  - if snapshot.image?
    = image_tag snapshot.image.url(:thumb)
  - else
    .glyphicon.glyphicon-time

  .snapshot-indicator.snapshot-color-icon.glyphicon{ class: glyphicon_for(snapshot) }

  .caption
    = time_tag snapshot.created_at, class: 'text-muted' do
      = t(:time_ago, time: time_ago_in_words(snapshot.created_at))
    - if diff = snapshot.snapshot_diff
      %meter{ max: 100, optimum: 0, low: 5, high: 20, value: diff.diff_in_percent }<
        %span.text-warning<
          = t('.diff',
              diff: number_to_percentage(diff.diff_in_percent, precision: 2))

:ruby
  classes = %w[snapshot-card thumbnail]
  classes << 'snapshot-card-pending' if snapshot.pending?
  data = {
    keyboard_focusable: true,
    auto_refresh_type: 'snapshot',
    auto_refresh_id:   snapshot.id,
  }
  link_options = { class: classes, title: snapshot.title, data: data }
  link_options['aria-selected'] = true if local_assigns[:active]

= link_to snapshot_path(snapshot), link_options do
  - if snapshot.image?
    = image_tag snapshot.image.url(:thumb),
      alt: "#{snapshot.title} @ #{snapshot.viewport}"
  - else
    .glyphicon.glyphicon-time

  .snapshot-indicator.snapshot-color-icon.glyphicon{ class: glyphicon_for(snapshot) }

  .caption
    = time_tag snapshot.created_at, class: 'text-muted' do
      = t(:time_ago, time: time_ago_in_words(snapshot.created_at))
    - if diff = snapshot.snapshot_diff
      %meter{ max: 100, optimum: 0, low: 5, high: 20, value: diff.diff_in_percent }<
        %span.text-warning<
          = t('.diff',
              diff: number_to_percentage(diff.diff_in_percent, precision: 2))

Improve alt text of snapshot thumbnails
Improve alt text of snapshot thumbnails

The default alt text for these images was the filename, which is just a
bunch of letters and numbers. This wasn't helping anyone. Using the
title and viewport width is much better and will benefit people using
assistive technologies.
