Initial commit
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
commit
ef9aca1f3b
26 changed files with 1668 additions and 0 deletions
30
src/server/templates/create.html
Normal file
30
src/server/templates/create.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{define "create"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
{{block "head" .}}{{end}}
|
||||
|
||||
<body>
|
||||
{{block "header" .}}{{end}}
|
||||
|
||||
<div class="container mb-4 text-center">
|
||||
{{if eq .Err nil}}
|
||||
<div class="alert alert-success" role="alert">
|
||||
<p>Note created successfully</p>
|
||||
<p>
|
||||
<a href="{{.URL}}">{{.URL}}</a>
|
||||
</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<p>Could not create note</p>
|
||||
<p><strong>{{.Err}}</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{block "footer" .}}{{end}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{{end}}
|
5
src/server/templates/footer.html
Normal file
5
src/server/templates/footer.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{define "footer"}}
|
||||
<footer class="text-center">
|
||||
<small>Powered by <a href="https://git.riou.xyz/jriou/coller">coller</a> {{if ne .Version ``}}({{.Version}}){{end}}</small>
|
||||
</footer>
|
||||
{{end}}
|
7
src/server/templates/head.html
Normal file
7
src/server/templates/head.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{define "head"}}
|
||||
<head>
|
||||
<title>{{.Title}}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||
</head>
|
||||
{{end}}
|
16
src/server/templates/header.html
Normal file
16
src/server/templates/header.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{define "header"}}
|
||||
<div class="text-center justify-content-center align-items-center bg-light border-bottom mb-4">
|
||||
<div class="container">
|
||||
<header class="d-flex flex-wrap py-2">
|
||||
<a class="d-flex mb-3 mb-md-0 me-md-auto text-dark text-decoration-none" href="/">
|
||||
<span class="fs-3">{{.Title}}</span>
|
||||
</a>
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="/" aria-content="page">New note</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
67
src/server/templates/index.html
Normal file
67
src/server/templates/index.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{{define "index"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
{{block "head" .}}{{end}}
|
||||
|
||||
<body>
|
||||
{{block "header" .}}{{end}}
|
||||
|
||||
<form action="/create" method="post" enctype="multipart/form-data">
|
||||
<div class="container mb-4">
|
||||
<p class="fs-4">New note</p>
|
||||
</div>
|
||||
<div class="container text-center justify-content-center w-75 mb-4">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-1">
|
||||
<label class="col-form-label col-form-label-sm" for="password">Password</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="password" pattern="^[a-zA-Z0-9]{16,256}$"
|
||||
title="Letters and numbers with length from 16 to 256" class="form-control" id="password"
|
||||
name="password">
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<input type="checkbox" class="form-check-input" for="no-password" id="no-password"
|
||||
value="no-password" name="no-password">
|
||||
<label class="col-form-label col-form-label-sm" for="no-password">No password</label>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<input type="checkbox" class="form-check-input" for="delete-after-read" id="delete-after-read"
|
||||
value="delete-after-read" name="delete-after-read">
|
||||
<label class="col-form-label col-form-label-sm" for="delete-after-read">Delete after read</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="file" class="form-control" for="file" id="file" name="file" accept="text/plain" />
|
||||
</div>
|
||||
<div class="col">
|
||||
<select class="form-select" aria-label="Expiration" id="expiration" name="expiration">
|
||||
<option selected>Expiration</option>
|
||||
{{range .Expirations}}
|
||||
<option value="{{.}}">{{HumanDuration .}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mb-4">
|
||||
<div class="row">
|
||||
<textarea class="form-control" id="content" name="content" cols="40" rows="12"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container mb-4">
|
||||
<div class="row text-center justify-content-center">
|
||||
<div class="col-1">
|
||||
<button type="submit" class="btn btn-success">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
{{block "footer" .}}{{end}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue