74 lines
3.0 KiB
HTML
74 lines
3.0 KiB
HTML
{{ block "index" . }}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>First page</title>
|
|
<script src="https://unpkg.com/htmx.org@latest"></script>
|
|
|
|
<link rel="preconnect" href="https://rsms.me/">
|
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
|
<link rel="icon" type="image/x-icon" href="static/favicon.ico">
|
|
<link rel="stylesheet" type="text/css" href="static/css/site.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<div class="main-container">
|
|
<div class="content">
|
|
<h1> This is an input </h1>
|
|
<div class="row">
|
|
<div class="column" stye="align-items: center">
|
|
<div style="display: flex; justify-content: space-between;">
|
|
<span class="input_label">Subject:</span>
|
|
<input name="subject" type="text" id="subject" hx-post="/subject_preview"
|
|
hx-trigger="keyup changed delay:1000ms" hx-target="#subject-preview">
|
|
</div><br>
|
|
<textarea name="email_input" id="email_input" rows="32" cols="64" style="resize: none;"
|
|
hx-trigger="keyup changed delay:1000ms" hx-post="/mail-content" hx-target="#email-preview"
|
|
placeholder="Type out your email here..."></textarea>
|
|
<br>
|
|
<div class="row" style="justify-content: space-around;">
|
|
<button hx-post="/send_email" hx-include="[id='email_input'], [id='subject']"
|
|
hx-vals='{"destination": "test"}' hx-swap="none">
|
|
Send Test Email
|
|
</button>
|
|
<button hx-post="/send_email" hx-include="[id='email_input'], [id='subject']"
|
|
hx-vals='{"destination": "mailing_list"}'
|
|
hx-confirm="You are about to send an email to your entire mailing list. Are you sure?"
|
|
hx-swap="none">
|
|
Send Email
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="column">
|
|
<div id="subject-preview"> </div><br>
|
|
<div id="email-preview"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" style="align-items: center; justify-content: space-between;">
|
|
<div class="column">
|
|
<h1>Current Mailing List Subscribers</h1>
|
|
</div>
|
|
<div class="column">
|
|
<button hx-get="/mailing_list" hx-target="#mailing_list">Refresh Mailing List</button>
|
|
</div>
|
|
</div>
|
|
<div class="card" hx-trigger="load" hx-get="/mailing_list" id="mailing_list"></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|
|
{{ end }}
|
|
|
|
{{ block "mailing_list" . }}
|
|
<ul style="columns: 2;">
|
|
{{ range . }}
|
|
<li><a href="mailto:{{ . }}"> {{ . }} </a></li>
|
|
{{end}}
|
|
</ul>
|
|
{{end}} |