%= content_tag :div, :class => 'spud_media_picker_item',
'data-id' => media.id,
'data-type' => (media.is_image? ? 'img' : 'file'),
'data-url' => media.attachment.url,
'data-name' => media.attachment_file_name,
'data-size' => media.attachment_file_size,
'data-lastmod' => media.attachment_updated_at.blank? == false ? media.attachment_updated_at.strftime("%l:%M %p, %D") : '',
'data-protected' => (media.is_protected ? 'Yes' : 'No') do %>
<% if media.is_protected && (media.is_image? || media.is_pdf?) %>
<% else %>
<%= image_tag(media.image_from_type) %>
<% end %>
<%= media.attachment_file_name %>
<% end %>