Inital commit

This commit is contained in:
Terncode committed 2026-11-24 22:05:11 +01:00
commit a6af7dbfcb
114 files changed
+27520

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../../partials/head'); -%>
<%- include('../../partials/admin-editor-css'); -%>
<title>Admin - Add File</title>
</head>
<body>
<%- include('../../winter'); -%>
<div class="editor-container">
<a class="btn btn-back" href="<%= endpoint %>/dashboard">Back to dashboard</a>
<section>
<h1>Add New file</h1>
<form action="<%= endpoint %>/storage/add" method="post" enctype="multipart/form-data" class="editor-form editor-form--stacked">
<label>
Name
<input type="text" name="name" required>
</label>
<label>
Description
<textarea name="description" rows="3"></textarea>
</label>
<label>
Tags (comma-separated)
<input type="text" name="tags" class="multi-input">
</label>
<label>
Access Codes (comma-separated)
<input type="text" name="accessCodes" class="multi-input">
</label>
<label>
Created File
<input type="date" name="created">
</label>
<label>
File
<input type="file" name="file" required>
</label>
<label>
Thumbnail
<input type="file" name="thumbnail" accept="image/*">
</label>
<button type="submit">Upload file</button>
</form>
</section>
</div>
<%- include('../../footer'); -%>
</body>
</html>
+83
View File
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../../partials/head'); -%>
<%- include('../../partials/admin-editor-css'); -%>
<title>Admin - Edit File</title>
</head>
<body>
<%- include('../../winter'); -%>
<div class="editor-container">
<a class="btn btn-back" href="<%= endpoint %>/dashboard">Back to dashboard</a>
<% if (file) { %>
<section>
<h1>Edit file</h1>
<form action="<%= endpoint %>/storage/edit" method="post" enctype="multipart/form-data" class="editor-form editor-form--stacked">
<img class="editor-preview-img" src="/file/thumbnail/<%= file.thumbnailName %>" alt="<%= file.name %>">
<input type="text" name="id" required value="<%= file.id %>" hidden>
<label>
Name
<input type="text" name="name" required value="<%= file.name %>">
</label>
<label>
Description
<textarea name="description" rows="3"><%= file.description %></textarea>
</label>
<label>
Tags (comma-separated)
<input type="text" name="tags" class="multi-input" value="<%= file.tags.join(', ') %>">
</label>
<label>
Access Codes (comma-separated)
<input type="text" name="accessCodes" class="multi-input" value="<%= file.accessCodes.join(', ') %>">
</label>
<label>
Created file
<input type="date" name="created" value="<%= file.createdAt.toISOString().split("T")[0] %>">
</label>
<label>
File
<input type="file" name="file">
</label>
<label>
Thumbnail
<input type="file" name="thumbnail" accept="image/*">
</label>
<label>
Remove thumbnail
<input type="checkbox" name="removeThumbnail">
</label>
<button type="submit">Edit</button>
</form>
<form action="<%= endpoint %>/storage/delete" method="post" class="editor-form editor-form--stacked">
<input type="text" name="id" required value="<%= file.id %>" hidden>
<button type="submit" class="delete">Delete</button>
</form>
<div>
<span><%= file.fileName %></span>
<a class="btn" href="/file/<%= file.file %>">Download</a>
</div>
</section>
<% } else { %>
<section><div>No file found</div></section>
<% } %>
</div>
<%- include('../../footer'); -%>
</body>
</html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../../partials/head'); -%>
<%- include('../../partials/admin-editor-css'); -%>
<title>Admin - Storage</title>
</head>
<body>
<%- include('../../winter'); -%>
<div class="editor-container browse-panel">
<a class="btn btn-back" href="<%= endpoint %>/dashboard">Back to dashboard</a>
<%- include('../../partials/browse-editor', {
searchAction: '/storage',
addHref: endpoint + '/storage-add/',
addLabel: 'Add file',
items: files,
editHrefPrefix: endpoint + '/storage-edit/',
thumbnailPrefix: '/file/thumbnail/',
search,
mode,
currentPage,
totalPages
}); -%>
</div>
<%- include('../../footer'); -%>
</body>
</html>