scinote-web/app/views/reports/_content_document_preview.html.erb
2021-04-07 11:15:22 +02:00

23 lines
932 B
Text

<div class="modal-header">
<span class="file-name"><%= report.name %></span>
<div class="sci-btn-group">
<a class="btn btn-light file-download-link" href="<%= rails_blob_path(report_type == 'docx' ? report.docx_file : report.pdf_file, disposition: 'attachment') %>" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<button type="button" class="btn icon-btn btn-light" data-dismiss="modal"><span class="fas fa-times"></span></button>
</div>
</div>
<div class="modal-body">
<div class="file-preview-container">
<% if report_type == 'pdf' %>
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: report.pdf_file, report_document: true } %>
<% else %>
<div>
<i class="fas fa-10x fa-file-word"></i>
<h3 class="file-name"><%= report.name %></h3>
</div>
<% end %>
</div>
</div>
<div class="modal-footer">
</div>