Files
minibin/templates/upload.html
T
whoswhip 2c342f63b3 every file sharing service needs qts
honestly this code might be kind of shit, and it needs to used on the other page(s) as well but im too lazy, fixed a styling issue with the upload result page though
2026-11-12 22:30:36 -05:00

99 lines
2.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{.ID}} | minibin</title>
<link rel="stylesheet" href="/css/main.css" />
</head>
<script src="/js/copy.js" defer></script>
<body>
{{template "site-header"}}
<main>
<div>
{{if hasPrefix .MIMEType "image/"}}
<img src="/{{.ID}}" />
{{else if hasPrefix .MIMEType "video/"}}
<video src="/{{.ID}}" controls></video>
{{else if hasPrefix .MIMEType "audio/"}}
<audio src="/{{.ID}}" controls></audio>
{{else}}
<h2>{{.Filename}}</h2>
<h2>{{.ID}}{{.FileExtension}}</h2>
{{end}}
</div>
<details>
<summary>upload metadata</summary>
<table class="upload-metadata">
<thead>
<tr>
<th scope="col">key</th>
<th scope="col">value</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">id</th>
<td>{{.ID}}</td>
</tr>
<tr>
<th scope="row">type</th>
<td>{{.Type}}</td>
</tr>
<tr>
<th scope="row">filename</th>
<td>{{.Filename}}</td>
</tr>
<tr>
<th scope="row">mimetype</th>
<td>{{.MIMEType}}</td>
</tr>
<tr>
<th scope="row">size</th>
<td>{{.Size}}</td>
</tr>
<tr>
<th scope="row">sha256</th>
<td>{{.SHA256}}</td>
</tr>
<tr>
<th scope="row">created at</th>
<td>{{.CreatedAt}}</td>
</tr>
<tr>
<th scope="row">expires at</th>
<td>{{if .ExpiresAt}}{{.ExpiresAt}}{{else}}indefinite{{end}}</td>
</tr>
<tr>
<th scope="row">last accessed at</th>
<td>{{.LastAccessedAt}}</td>
</tr>
<tr>
<th scope="row">file extension</th>
<td>{{.FileExtension}}</td>
</tr>
<tr>
<th scope="row">delete token</th>
<td>{{.DeleteToken}}</td>
</tr>
</tbody>
</table>
</details>
<div class="upload-links">
<a href="/{{.ID}}">view raw upload</a>
<!--
copying is only available with javascript
we will make this element visible with javascript
-->
<a id="copy-link" data-id="{{.ID}}" href="#" style="display: none">copy link</a>
<form action="/{{.ID}}/delete?redirect=true" method="post">
<input type="hidden" name="delete_token" value="{{.DeleteToken}}" />
<button type="submit" class="link-btn">delete upload</button>
</form>
</div>
</main>
</body>
</html>