mirror of
https://github.com/itflow-org/itflow
synced 2026-09-15 19:25:12 +00:00
Enhancement: Files: Document and Files are easily distinguashable now with the option to choose all docs or just files. Thumbnails view now shows all files, Previews now available for documents, pdfs, txts etc, List view and Thumbnail view now retain in search param when navigating folders
This commit is contained in:
@@ -1,23 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* ITFlow - File preview modal for the gallery view on agent/files.php
|
||||
*
|
||||
* Included ONCE, after the tile loop - it used to be required inside it, which
|
||||
* emitted a copy per file, all sharing these element ids.
|
||||
*
|
||||
* What renders is chosen per file by updateModalContent() in files.php, from
|
||||
* the "kind" the page worked out against getInlineViewableMimeTypes(). Anything
|
||||
* not viewable inline gets the fallback panel rather than a broken frame.
|
||||
*/
|
||||
?>
|
||||
<div class="modal" id="viewFileModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||
<div class="modal-content bg-dark text-white">
|
||||
<div class="modal-header bg-dark">
|
||||
<h6 class="modal-title" id="modalTitle"></h6>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
<h6 class="modal-title text-truncate" id="modalTitle"></h6>
|
||||
<span class="text-secondary ms-2 small" id="modalMeta"></span>
|
||||
<button type="button" class="btn-close btn-close-white ms-auto" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="position-relative text-center">
|
||||
<!-- Left arrow -->
|
||||
<button type="button" class="btn btn-dark position-absolute" style="left:10px; top:50%; transform:translateY(-50%);" onclick="prevFile()">
|
||||
|
||||
<button type="button" class="btn btn-dark position-absolute top-50 start-0 translate-middle-y ms-2"
|
||||
id="modalPrev" onclick="prevFile()">
|
||||
<i class="fas fa-chevron-left"></i>
|
||||
</button>
|
||||
|
||||
<img id="modalImage" class="img-fluid my-3" src="" alt="">
|
||||
<img id="modalImage" class="img-fluid my-3 d-none" src="" alt="">
|
||||
|
||||
<!-- Right arrow -->
|
||||
<button type="button" class="btn btn-dark position-absolute" style="right:10px; top:50%; transform:translateY(-50%);" onclick="nextFile()">
|
||||
<iframe id="modalFrame" class="w-100 my-3 d-none bg-white" style="height:75vh; border:0;"
|
||||
title="File preview"></iframe>
|
||||
|
||||
<pre id="modalText" class="text-start text-white bg-black p-3 my-3 mx-5 d-none overflow-auto"
|
||||
style="max-height:70vh; white-space:pre-wrap; word-break:break-word;"></pre>
|
||||
|
||||
<?php /* Documents render as HTML rather than in a frame. White panel and
|
||||
prettyContent so they read the same as document.php. */ ?>
|
||||
<div id="modalDocument" class="text-start bg-white text-dark p-4 my-3 mx-5 d-none overflow-auto prettyContent"
|
||||
style="max-height:70vh;"></div>
|
||||
|
||||
<div id="modalFallback" class="my-5 d-none">
|
||||
<i class="fas fa-file fa-4x text-secondary" id="modalFallbackIcon"></i>
|
||||
<p class="mt-3 mb-0">This file type cannot be previewed in the browser.</p>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-dark position-absolute top-50 end-0 translate-middle-y me-2"
|
||||
id="modalNext" onclick="nextFile()">
|
||||
<i class="fas fa-chevron-right"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<span class="text-secondary small me-auto" id="modalPosition"></span>
|
||||
<a class="btn btn-primary" id="modalDownload" href="#">
|
||||
<i class="fas fa-fw fa-cloud-download-alt me-2"></i>Download
|
||||
</a>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
<i class="fas fa-fw fa-times me-2"></i>Close
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user