40266cf811
deploy / deploy (push) Successful in 3s
Authors can now send a manuscript, headshot, bio, and pitch through a real form instead of "Coming soon." Posts multipart to eec's new /submissions endpoint (self-hosted, keeps the privacy policy's existing no-third-party-SaaS promise true). Also documents the new data collection in the privacy policy. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
69 lines
2.6 KiB
HTML
69 lines
2.6 KiB
HTML
{{ define "main" }}
|
|
<h1>{{ .Title }}</h1>
|
|
{{ .Content }}
|
|
|
|
<form id="submissions-form" style="margin-top:2rem;">
|
|
<label for="name">Name</label>
|
|
<input type="text" id="name" name="name" required autocomplete="name">
|
|
|
|
<label for="email">Email</label>
|
|
<input type="email" id="email" name="email" required autocomplete="email">
|
|
|
|
<label for="project">Which title or call is this for?</label>
|
|
<input type="text" id="project" name="project" required>
|
|
|
|
<label for="description">Brief description of the submission</label>
|
|
<textarea id="description" name="description" rows="4" required></textarea>
|
|
|
|
<label for="bio">Author bio</label>
|
|
<textarea id="bio" name="bio" rows="4" required></textarea>
|
|
|
|
<label for="manuscript">Manuscript</label>
|
|
<input type="file" id="manuscript" name="manuscript" accept=".md,.markdown,.txt,.docx,.doc,.odt,.rtf,.pdf" required>
|
|
<p style="opacity:0.7; font-size:0.85rem; margin-top:-1rem;">Markdown preferred. Under ~15MB.</p>
|
|
|
|
<label for="headshot">Headshot (optional)</label>
|
|
<input type="file" id="headshot" name="headshot" accept="image/*">
|
|
<p style="opacity:0.7; font-size:0.85rem; margin-top:-1rem;">Under ~5MB.</p>
|
|
|
|
<div class="field-honeypot" aria-hidden="true">
|
|
<label for="website">Leave this field empty</label>
|
|
<input type="text" id="website" name="website" tabindex="-1" autocomplete="off">
|
|
</div>
|
|
|
|
<button type="submit" class="btn">Send submission</button>
|
|
</form>
|
|
<p id="submissions-status" role="status" style="margin-top:1rem;"></p>
|
|
|
|
<script>
|
|
(function () {
|
|
var form = document.getElementById("submissions-form");
|
|
var status = document.getElementById("submissions-status");
|
|
form.addEventListener("submit", function (e) {
|
|
e.preventDefault();
|
|
var formData = new FormData(form);
|
|
var submitBtn = form.querySelector("button[type=submit]");
|
|
submitBtn.disabled = true;
|
|
status.textContent = "Sending…";
|
|
fetch("{{ .Site.Params.eec_base_url }}/submissions", {
|
|
method: "POST",
|
|
body: formData
|
|
}).then(function (res) {
|
|
submitBtn.disabled = false;
|
|
if (res.ok) {
|
|
form.reset();
|
|
status.textContent = "Thanks — we'll be in touch.";
|
|
return;
|
|
}
|
|
return res.text().then(function (msg) {
|
|
status.textContent = msg || "Something went wrong sending that. Try again, or email submissions@twosquirrelspress.com directly.";
|
|
});
|
|
}).catch(function () {
|
|
submitBtn.disabled = false;
|
|
status.textContent = "Something went wrong sending that. Try again, or email submissions@twosquirrelspress.com directly.";
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
{{ end }}
|