feat: Download links for web server (#1039)
## Summary * **What is the goal of this PR?** Add a link to files to download on web server ## Additional Context * There was already an api to download files, i just added a link to it for files. --- ### AI Usage Did you use AI tools to help write this code? **NO** Addresses #621 --------- Co-authored-by: Eliz Kilic <elizk@google.com>
This commit is contained in:
@@ -212,12 +212,14 @@
|
||||
.file-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.folder-link {
|
||||
.folder-link,
|
||||
.file-link {
|
||||
color: var(--accent-color);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.folder-link:hover {
|
||||
.folder-link:hover,
|
||||
.file-link:hover {
|
||||
color: var(--accent-hover-color);
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -872,7 +874,8 @@
|
||||
// Checkbox cell + file row
|
||||
fileTableContent += `<tr class="${file.isEpub ? 'epub-file' : ''}">`;
|
||||
fileTableContent += `<td><input type="checkbox" class="select-item" data-path="${encodeURIComponent(filePath)}" data-name="${escapeHtml(file.name)}" data-type="file"></td>`;
|
||||
fileTableContent += `<td><span class="file-icon">${file.isEpub ? '📗' : '📄'}</span>${escapeHtml(file.name)}`;
|
||||
fileTableContent += `<td><span class="file-icon">${file.isEpub ? '📗' : '📄'}</span>`;
|
||||
fileTableContent += `<a rel="noopener noreferrer" target="_blank" href="/download?path=${encodeURIComponent(filePath)}" class="file-link">${escapeHtml(file.name)}</a>`;
|
||||
if (file.isEpub) fileTableContent += '<span class="epub-badge">EPUB</span>';
|
||||
fileTableContent += '</td>';
|
||||
fileTableContent += `<td>${file.name.split('.').pop().toUpperCase()}</td>`;
|
||||
|
||||
Reference in New Issue
Block a user