Sha256: bbf3913ec38eac64c06f548747cc5990842d17f35fed77062d40a4a52ee2111d

Contents?: true

Size: 1.82 KB

Versions: 1

Compression:

Stored size: 1.82 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="<%= sufia.download_path(@generic_file.noid) %>" target="_new"><img src="<%= sufia.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="<%= sufia.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="<%= sufia.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="<%= sufia.download_path(@generic_file.noid) %>" target="_new"><img src="<%= sufia.download_path(@generic_file.noid, {:datastream_id => 'thumbnail'}) %>" width="338" height="493" /></a>
<% else %>
  <a href="<%= sufia.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.pre2 app/views/generic_files/_media_display.html.erb