added template files
This commit is contained in:
parent
bda7f2df49
commit
283f091aed
4 changed files with 146 additions and 9 deletions
|
|
@ -1,11 +1,5 @@
|
||||||
{ guestbook, config, ... }:
|
{ guestbook, ... }:
|
||||||
{
|
{
|
||||||
sops.secrets.guestbook-telegram-token = {
|
|
||||||
sopsFile = ../../secrets/guestbook.yaml;
|
|
||||||
key = "telegram_bot_token";
|
|
||||||
owner = "guestbook";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.guestbook = {
|
services.guestbook = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = guestbook.packages.aarch64-linux.default;
|
package = guestbook.packages.aarch64-linux.default;
|
||||||
|
|
@ -33,8 +27,7 @@
|
||||||
maxDuration = 20;
|
maxDuration = 20;
|
||||||
};
|
};
|
||||||
telegram = {
|
telegram = {
|
||||||
enable = true;
|
enable = false;
|
||||||
botTokenFile = config.sops.secrets.guestbook-telegram-token.path;
|
|
||||||
chatId = 8669496383;
|
chatId = 8669496383;
|
||||||
};
|
};
|
||||||
security = {
|
security = {
|
||||||
|
|
@ -51,6 +44,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
styles = {
|
styles = {
|
||||||
|
templateFile = "./templates/default.html";
|
||||||
|
successTemplateFile = "./templates/success.html";
|
||||||
separator = "-----------";
|
separator = "-----------";
|
||||||
labels = {
|
labels = {
|
||||||
submit = "Submit";
|
submit = "Submit";
|
||||||
|
|
|
||||||
90
hosts/lab/templates/default.css
Normal file
90
hosts/lab/templates/default.css
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
/* Page container */
|
||||||
|
.page-container {
|
||||||
|
max-width: 70ch;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 1rem;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Form */
|
||||||
|
.guestbook-prompt {}
|
||||||
|
.guestbook-form {}
|
||||||
|
.guestbook-label {}
|
||||||
|
.guestbook-input {}
|
||||||
|
.guestbook-textarea {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.guestbook-button {
|
||||||
|
display: block;
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Drawings */
|
||||||
|
.guestbook-canvas {
|
||||||
|
border: 1px solid #000;
|
||||||
|
cursor: crosshair;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.guestbook-canvas-tools {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.guestbook-canvas-tools a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.guestbook-drawing-inline a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.guestbook-drawing-content {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
.guestbook-swatch {
|
||||||
|
display: inline-block;
|
||||||
|
width: 0.85em;
|
||||||
|
height: 0.85em;
|
||||||
|
border: 1px solid #000;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0 1px;
|
||||||
|
}
|
||||||
|
.guestbook-swatch.active {
|
||||||
|
border: 1px solid #000;
|
||||||
|
outline: 1px solid #000;
|
||||||
|
}
|
||||||
|
.guestbook-size-slider {
|
||||||
|
width: 4em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.entry-drawing {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Voice notes */
|
||||||
|
.guestbook-voice-record.recording {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.guestbook-voice-timer {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
.guestbook-voice-playback:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.guestbook-voice-playback {
|
||||||
|
display: block;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
audio {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.6em;
|
||||||
|
height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Entries */
|
||||||
|
.entry-header {}
|
||||||
|
.entry-date {}
|
||||||
|
.entry-name {}
|
||||||
|
.entry-website {}
|
||||||
|
.entry-body {}
|
||||||
|
.entry-separator {}
|
||||||
24
hosts/lab/templates/default.html
Normal file
24
hosts/lab/templates/default.html
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{{title}}</title>
|
||||||
|
<link rel="stylesheet" href="/style.css">
|
||||||
|
{{style}}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="page-container">
|
||||||
|
<nav>
|
||||||
|
<a href="/">ily [dot] rs</a> |
|
||||||
|
<a href="/links/">links</a> |
|
||||||
|
<a href="/now/">now</a> |
|
||||||
|
sign the <a href="/g/">guestbook</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{{form}}
|
||||||
|
|
||||||
|
{{entries}}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
hosts/lab/templates/success.html
Normal file
28
hosts/lab/templates/success.html
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<!--
|
||||||
|
Default success page shown after a guestbook submission.
|
||||||
|
Copy this file and point BOOK_SUCCESS_TEMPLATE at your copy to customize.
|
||||||
|
|
||||||
|
Available placeholders:
|
||||||
|
|
||||||
|
title - Site title (BOOK_SITE_TITLE).
|
||||||
|
style - Custom CSS (same as the main template).
|
||||||
|
|
||||||
|
Everything else is static — write whatever you want. Use <script> for
|
||||||
|
dynamic behavior like showing the current time.
|
||||||
|
-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{{title}}</title>
|
||||||
|
{{style}}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="page-container">
|
||||||
|
Thanks! Your message is pending approval.
|
||||||
|
|
||||||
|
<a href="/">← back</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue