feat: move upload page to home page
This commit is contained in:
parent
8bf4d7e5c4
commit
bdab72dcac
@ -139,11 +139,6 @@ func (app *Application) uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
app.parserHandler(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
tmpl := template.Must(template.ParseFiles("templates/upload.html"))
|
||||
if err := tmpl.Execute(w, app.uploadHandler); err != nil {
|
||||
slog.Warn(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func (app *Application) parserHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -11,19 +11,20 @@
|
||||
|
||||
<body>
|
||||
<h1>abyss paste</h1>
|
||||
<div class="top-down">
|
||||
<div>
|
||||
<a href="/tree">
|
||||
<button>files uploaded</button>
|
||||
<button>all uploaded files</button>
|
||||
</a>
|
||||
<a href="/upload">
|
||||
<button>go to upload</button>
|
||||
</a>
|
||||
</div>
|
||||
<a href="/last">
|
||||
<button>last uploaded file</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form action="/upload" method="POST">
|
||||
<textarea name="content" placeholder="Enter your content here..."></textarea><br />
|
||||
<button type="submit">upload</button>
|
||||
</form>
|
||||
|
||||
<footer>
|
||||
abyss paste - powered by
|
||||
<a href="https://github.com/jabuxas/abyss" target="_blank">abyss</a>
|
||||
|
@ -46,9 +46,27 @@ footer a {
|
||||
div {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.top-down {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 30px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
border: 1px solid #555;
|
||||
padding: 10px;
|
||||
width: 400px;
|
||||
height: 150px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
textarea::placeholder {
|
||||
color: #bbb;
|
||||
}
|
||||
|
@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>dir listing</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.file-listing {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.file-listing th,
|
||||
.file-listing td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.file-listing th {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.file-listing tr:nth-child(even) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.file-listing tr:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.file-listing td a {
|
||||
color: #0288d1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.file-listing td a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="/upload" method="POST">
|
||||
<textarea name="content" rows="10" cols="50" placeholder="Enter your content here..."></textarea><br /><br />
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user