Sha256: 54d710af6bd3e03e7b7d51b4b6bf2bea45ad021694a96ddb44f89ff67c111773

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

<%#
Copyright © 2012 The Pennsylvania State University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
%>

<% if ['image/jpeg', 'image/png', 'image/bmp', 'image/gif', 'image/jpg'].include?(@generic_file.mime_type) %>
  <a href="<%= download_path(@generic_file.noid) %>" target="_new"><img src="<%= download_path(@generic_file.noid) %>" width="338" /></a>
<% elsif ['video/mp4'].include?(@generic_file.mime_type) %>
  <video controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
    <source src="<%= download_path(@generic_file.noid) %>" type="<%= @generic_file.mime_type %>" />
    Your browser does not support the audio tag.
  </video>
<% elsif ['audio/mp3', 'audio/mpeg'].include?(@generic_file.mime_type) %>
  <audio src="<%= download_path(@generic_file.noid, format:'audio') %>" type="<%= @generic_file.mime_type %>" />
    Your browser does not support the audio tag.
    </audio>
<% elsif ['application/pdf'].include?(@generic_file.mime_type) %>
  <a href="<%= download_path(@generic_file.noid) %>" target="_new"><img src="<%= download_path(@generic_file.noid, {:datastream_id => 'thumbnail'}) %>" width="338" height="493" /></a>
<% else %>
  <a href="<%= download_path(@generic_file.noid) %>" target="_new"><img src="/assets/default.png" alt="No preview available" width="338" height="493" /></a>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sufia-0.0.1.pre1 app/views/generic_files/_media_display.html.erb