UnderCover/flaskr/templates/writing.jinja2

78 lines
2.1 KiB
Plaintext
Raw Normal View History

<!doctype html>
<html lang="en">
<head>
<title>UnderCover</title>
2021-07-24 01:08:18 -04:00
<link rel="stylesheet" type="text/css" href="
{{ url_for('static', filename='styles_min.css') }}">
2022-09-22 16:23:01 -04:00
<meta name="viewport" content="user-scalable=no; width=device-width">
<script type="text/javascript">
2022-09-22 16:23:01 -04:00
window.onload = () => {
{% if errors %}
window.scrollTo(0, document.body.scrollHeight);
{% endif %}
2022-09-22 16:23:01 -04:00
if (window.location.search.includes("reset=true")) {
2022-09-22 16:23:01 -04:00
window.history.pushState({}, document.title, window.location.pathname);
return;
}
2022-09-22 16:23:01 -04:00
decodeURIComponent(document.cookie).split(';').forEach(cookie => {
[id, value] = cookie.trim().split('=')
document.getElementById(id).value = value
})
}
2022-09-22 16:23:01 -04:00
const clearErrors = () => {
const e = document.getElementById('errors')
e.parentNode.removeChild(e)
}
</script>
</head>
<body>
<a href="/" style="text-decoration: none;">
<h1><span class="logo left">Under</span><span class="logo right">Cover</span></h1>
2022-09-22 16:23:01 -04:00
</a>
<h2>The secret cover letter generator</h2>
2022-09-22 16:23:01 -04:00
{% from "_formhelpers.jinja2" import render_field %}
<form method=post>
<dl>
{{ render_field(form.username) }}
{{ render_field(form.company) }}
{{ render_field(form.jobandpronoun) }}
{{ render_field(form.skilltypes) }}
{{ render_field(form.myskills) }}
{{ render_field(form.body, 'class=bigtext') }}
{{ render_field(form.closingtext) }}
</dl>
2022-09-22 16:23:01 -04:00
{% if errors %}
2022-09-22 16:23:01 -04:00
<div id=errors>
<h3>Your letter has errors.</h3>
<p>
There is likely a typo in one of your variables (the {\blabla} bits).<br>
Make sure each is spelled correctly, and has the correct brackets on either side
</p>
<p class=errors>
{% for error in errors %}
{{ error }}<br>
{% endfor %}
</p>
</div>
{% endif %}
2022-09-22 16:23:01 -04:00
<input
class=submit
type=submit
value="Generate PDF"
{% if errors %}
onclick="clearErrors()"
{% endif %}
>
</form>
2022-09-22 16:23:01 -04:00
</body>
</html>