nojs folder in templates, plan to use javascript on main version

This commit is contained in:
2026-11-11 12:55:15 -05:00
parent 8904f64133
commit af7310f8de
5 changed files with 40 additions and 2 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
!README.md !README.md
!LICENSE !LICENSE
!/templates/*.html !/templates/**
# !Makefile # !Makefile
+1 -1
View File
@@ -27,7 +27,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
pages, err := template.ParseFiles("templates/home.html") pages, err := template.ParseFiles("templates/home.html", "templates/nojs/home.html")
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
+1
View File
@@ -21,6 +21,7 @@ goals:
- use a memory cache and batch commit to database to keep performance - use a memory cache and batch commit to database to keep performance
- [x] delete content endpoints - [x] delete content endpoints
- [ ] paste page - [ ] paste page
- [ ] return a page for nojs clients, such as on delete or upload
- [ ] max total storage usage - [ ] max total storage usage
- [ ] normalize mime types (like html) - [ ] normalize mime types (like html)
- [ ] filter mime types config - [ ] filter mime types config
+3
View File
@@ -8,6 +8,9 @@
<body> <body>
<h1>minibin</h1> <h1>minibin</h1>
<p>simple file and paste hosting service</p> <p>simple file and paste hosting service</p>
<noscript>
Javascript is required for drag and drop upload, upload progress, and a few other features. <a href="/nojs/">No Javascript version</a>
</noscript>
<form action="/upload?redirect=true" method="post"> <form action="/upload?redirect=true" method="post">
<label for="content">paste content</label> <label for="content">paste content</label>
<textarea id="content" name="content" rows="10" required></textarea> <textarea id="content" name="content" rows="10" required></textarea>
+34
View File
@@ -0,0 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>minibin</title>
</head>
<body>
<h1>minibin</h1>
<p>simple file and paste hosting service</p>
<form action="/upload?redirect=true" method="post">
<label for="content">paste content</label>
<textarea id="content" name="content" rows="10" required></textarea>
<label for="paste-expiry">Expiry</label>
<select id="paste-expiry" name="expiry">
{{range .Expiries}}
<option value="{{.Label}}">{{.Label}}</option>
{{end}}
</select>
<button type="submit">upload paste</button>
</form>
<form action="/upload?redirect=true" method="post" enctype="multipart/form-data">
<input type="file" required name="file"/>
<label for="file-expiry">Expiry</label>
<select id="paste-expiry" name="expiry">
{{range .Expiries}}
<option value="{{.Label}}">{{.Label}}</option>
{{end}}
</select>
<button type="submit">upload File</button>
</form>
</body>
</html>