socialforge/app/views/users/resource_preview.js.erb

5 lines
181 B
Plaintext

<% if @preview_able %>
top.location.href = '<%=download_named_attachment_path(@file.id, @file.filename, preview: true) %>'
<% else %>
window.alert('该资源不可预览')
<% end %>