mirror of
https://github.com/Wolvan/poll.horse.git
synced 2024-11-26 14:37:58 +01:00
9fa3eabad1
The frontend should work without having JS enabled. JS will enhance the experience but should under no circumstance be necessary. To achieve this, the entire entry system has been turned into a form that posts its values to a new backend path specifically made to take form responses. Instead of returning an API response, it also redirects the browser to either the voting page on successful creation or the frontpage with a bunch of get parameters that are used to prefill the form in a server-side rendering process. An error parameter is also given but there is no way to display said error for now.
54 lines
No EOL
2.4 KiB
HTML
54 lines
No EOL
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ TITLE }}</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="/static/css/main.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Poll.horse</h1>
|
|
<h3>Make voting on things simpler</h3>
|
|
</header>
|
|
<main>
|
|
<section class="notepad">
|
|
<div class="notepad-border"></div>
|
|
<form action="{{ BACKEND_BASE_PATH }}/_backend/poll-form" method="POST">
|
|
<section class="poll-title">
|
|
<input id="poll-title" name="poll-title" type="text" maxlength="300" placeholder="Enter your question here" value="{{ FORM_TITLE }}">
|
|
</section>
|
|
<section id="poll-options" class="poll-options">
|
|
{{ FORM_OPTION_DIVS }}
|
|
</section>
|
|
<section class="poll-footer">
|
|
<select id="dupe-check" name="dupe-check">
|
|
<option value="ip" {{ FORM_DUPECHECK_IP }}>IP-based duplication checking</option>
|
|
<option value="cookie" {{ FORM_DUPECHECK_COOKIE }}>Cookie-based duplication checking</option>
|
|
<option value="none" {{ FORM_DUPECHECK_NONE }}>No duplication checking</option>
|
|
</select>
|
|
<br>
|
|
<label>
|
|
<input type="checkbox" name="multi-select" {{ FORM_MULTI_SELECT }} id="multiple">
|
|
<span>Allow multiple answers to be selected</span>
|
|
</label>
|
|
<br>
|
|
<input type="submit" name="submit" value="Create poll" id="create-poll">
|
|
</form>
|
|
</section>
|
|
</section>
|
|
</main>
|
|
<footer>
|
|
<ul>
|
|
<li><a href="" target="_blank">Test</a></li>
|
|
<li><a href="" target="_blank">Test</a></li>
|
|
<li><a href="" target="_blank">Test</a></li>
|
|
<li><a href="" target="_blank">Test</a></li>
|
|
</ul>
|
|
<div class="copyright">© 2021 Wolvan</div>
|
|
</footer>
|
|
</body>
|
|
</html> |