scinote-web/app/views/reports/_content_document_preview.html.erb
2021-06-09 10:58:27 +02:00

26 lines
1.1 KiB
Plaintext

<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 } %>
<% elsif report_type == 'docx' %>
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: report.docx_preview_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>