{{ range $entry := .Breadcrumbs }} {{ $entry.Name }} {{ end }}
{{$path := .Path }} {{ range $entry_index, $entry := .Entries }} {{ end }}
{{if $entry.IsDirectory}} {{ $entry.Name }} {{else}} {{ $entry.Name }} {{end}} {{if $entry.IsDirectory}} {{else}} {{ $entry.Mime }}  {{end}} {{if $entry.IsDirectory}} {{else}} {{ $entry.Size | humanizeBytes }}  {{end}} {{ $entry.Timestamp.Format "2006-01-02 15:04" }} {{if $entry.IsDirectory}} {{else}} {{end}}
{{if .ShouldDisplayLoadMore}}
// ************************ Drag and drop ***************** // let dropArea = document.getElementById("drop-area"); // Prevent default drag behaviors ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { dropArea.addEventListener(eventName, preventDefaults, false); document.body.addEventListener(eventName, preventDefaults, false); }); // Highlight drop area when item is dragged over it ;['dragenter', 'dragover'].forEach(eventName => { dropArea.addEventListener(eventName, highlight, false); }); ;['dragleave', 'drop'].forEach(eventName => { dropArea.addEventListener(eventName, unhighlight, false); }); // Handle dropped files dropArea.addEventListener('drop', handleDrop, false); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } function highlight(e) { dropArea.classList.add('highlight'); } function unhighlight(e) { dropArea.classList.remove('highlight'); } function handleDrop(e) { var dt = e.dataTransfer; var files = dt.files; handleFiles(files); } function handleFiles(files) { files = [...files]; files.forEach(uploadFile); window.location.reload(); } function uploadFile(file, i) { var url = window.location.href; var xhr = new XMLHttpRequest(); var formData = new FormData(); xhr.open('POST', url, false); formData.append('file', file); xhr.send(formData); } function handleCreateDir() { var dirName = prompt('Directory Name:', ''); dirName = dirName.trim(); if (dirName == null && dirName == '') { return; } var baseUrl = window.location.href; if (!baseUrl.endsWith('/')) { baseUrl += '/'; } var url = baseUrl + dirName; if (!url.endsWith('/')) { url += '/'; } var xhr = new XMLHttpRequest(); xhr.open('POST', url, false); xhr.setRequestHeader('Content-Type', ''); xhr.send(); window.location.reload(); } function handleDelete(path) { if (!confirm('Are you sure to delete ' + path + '?')) { return; } var url = path; if (url.endsWith('/')) { url += '?recursive=true'; } var xhr = new XMLHttpRequest(); xhr.open('DELETE', url, false); xhr.send(); window.location.reload(); }