anchor.diff:  
   <table>
   <% for attachment in attachments %>
  +<% caption = "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %>
   <tr>
     <td>
       <% if attachment.is_image? %>
  
positive.code:       <%= link_to l(:button_view),
                    { :controller => 'attachments', :action => 'download_inline', :id => attachment, :filename => attachment.filename },
                    :class => 'icon-only icon-magnifier lightbox_preview pdf',
                    :rel => 'attachments', :title => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }",
                    :data  => {
                      :type => 'iframe',
                      :fancybox => 'attachments',
                      :caption => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }"
                    } %>
  
      <% else %>
  
negative.code:   <% if images.any? %>
    <div class="thumbnails images">
      <% images.each do |attachment| %>
        <% caption = "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %>
        <div>
          <%=
            link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
            { :controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename },
            :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => l(:label_preview) + ': ' + caption,
            :data  => {
              :type => attachment.is_pdf? ? 'iframe' : 'image',
              :fancybox => 'thumbnails',
              :caption => caption
            }
          %>
        </div>
  