4d0b976c18
deploy / deploy (push) Successful in 4s
accepting_submissions: false in the submissions page frontmatter now swaps the manuscript form for a closed notice and an email signup that posts to the eec service's new /subscribe endpoint, so visitors can still join the mailing list while submissions are paused. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
121 lines
4.6 KiB
HTML
121 lines
4.6 KiB
HTML
{{ define "main" }}
|
|
<h1>{{ .Title }}</h1>
|
|
{{ .Content }}
|
|
|
|
{{ if ne .Params.accepting_submissions false }}
|
|
<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>
|
|
{{ else }}
|
|
<p style="margin-top:2rem;">We're not currently accepting submissions, but you can join our mailing list to hear when that changes.</p>
|
|
|
|
<form id="subscribe-form" style="margin-top:1.5rem;">
|
|
<label for="email">Email</label>
|
|
<input type="email" id="email" name="email" required autocomplete="email">
|
|
|
|
<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">Join the mailing list</button>
|
|
</form>
|
|
<p id="subscribe-status" role="status" style="margin-top:1rem;"></p>
|
|
|
|
<script>
|
|
(function () {
|
|
var form = document.getElementById("subscribe-form");
|
|
var status = document.getElementById("subscribe-status");
|
|
form.addEventListener("submit", function (e) {
|
|
e.preventDefault();
|
|
var payload = {
|
|
email: form.email.value,
|
|
website: form.website.value
|
|
};
|
|
var submitBtn = form.querySelector("button[type=submit]");
|
|
submitBtn.disabled = true;
|
|
status.textContent = "Signing you up…";
|
|
fetch("{{ .Site.Params.eec_base_url }}/subscribe", {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify(payload)
|
|
}).then(function (res) {
|
|
submitBtn.disabled = false;
|
|
if (res.ok) {
|
|
form.reset();
|
|
status.textContent = "Thanks — we'll let you know.";
|
|
return;
|
|
}
|
|
return res.text().then(function (msg) {
|
|
status.textContent = msg || "Something went wrong signing you up. Try again, or email hello@twosquirrelspress.com directly.";
|
|
});
|
|
}).catch(function () {
|
|
submitBtn.disabled = false;
|
|
status.textContent = "Something went wrong signing you up. Try again, or email hello@twosquirrelspress.com directly.";
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
{{ end }}
|
|
{{ end }}
|