%- content_for :stylesheets do -%> <%= stylesheet_link_tag 'admin/jquery.fancybox', :media => 'screen' %> <%- end -%> <%- content_for :javascripts do -%> <%= javascript_include_tag 'admin/jquery-1.3.2.min' %> <%= javascript_include_tag 'admin/jquery.fancybox-1.2.1.min' %> <%- end -%> <% attachment = attribute.split('_file_name').first file_preview = Typus::Configuration.options[:file_preview] file_thumbnail = Typus::Configuration.options[:file_thumbnail] unless @item.send(attribute).blank? item = @item.send(attachment) preview = if @item.send("#{attachment}_content_type") =~ /^image\/.+/ && item.styles.member?(file_thumbnail) <<-HTML #{image_tag item.url(file_thumbnail)} HTML else <<-HTML #{link_to @item.send(attribute), item.url} HTML end end %>