83 lines
2.4 KiB
Plaintext
83 lines
2.4 KiB
Plaintext
<!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> |