Add initial implementation of ePage application with Docker support

- Create main application logic with HTTP handlers for form submissions
- Implement Pushover API integration for sending messages
- Add unit tests for handlers and Pushover payload structure
- Include Dockerfile and docker-compose configuration for easy deployment
- Add example environment file and update README with setup instructions
- Create HTML templates for user interface
This commit is contained in:
2026-04-18 20:02:32 +01:00
parent 61651c30fa
commit 8bd45193b0
15 changed files with 910 additions and 2 deletions

71
templates/index.html Normal file
View File

@@ -0,0 +1,71 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<title>ePage</title>
<link rel="shortcut icon" type="image/png" href="/static/msg.png"/>
<style>
.sizetopage {
margin-left: 15%;
margin-right: 15%;
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
<!-- Header -->
<div class="container">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<img alt="ePage logo" src="/static/msg.png" class="bi me-2" height="32"/>
<span class="fs-4">ePage</span>
</a>
</header>
</div>
<!-- Status alert -->
{{if eq .status "success"}}
<div class="sizetopage alert alert-success" role="alert">Message sent!</div>
{{else if eq .status "fail"}}
<div class="sizetopage alert alert-danger" role="alert">We could not send your message. Please try again.</div>
{{end}}
<!-- Form -->
<form class="sizetopage" action="/" method="post">
<div class="col-6 mw-50">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name" placeholder="John Doe" required="">
<div class="invalid-feedback">
Please enter your name.
</div>
</div>
<br>
<div class="col-6 mw-50">
<label for="email" class="form-label">Email address</label>
<input type="email" class="form-control" id="email" name="email" placeholder="john@doe.com" required="">
<div class="invalid-feedback">
Please enter your email address.
</div>
</div>
<br>
<div class="col-12 mw-100">
<label for="message" class="form-label">Message</label>
<textarea type="text" rows="5" class="form-control" id="message" name="message" required=""></textarea>
<div class="invalid-feedback">
Please enter your message.
</div>
</div>
<br>
<button class="btn btn-primary" type="submit">Submit</button>
</form>
</body>
</html>