UnderCover/undercover/templates/base.jinja2

67 lines
2.2 KiB
Plaintext
Raw Normal View History

2022-09-23 18:55:45 -04:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% block title %}UnderCover{% endblock title %}</title>
2022-09-27 22:00:34 -04:00
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}">
2022-09-23 18:55:45 -04:00
<link rel="icon" href="{{ url_for('static', filename='favicon.png') }}" />
<meta name="viewport" content="user-scalable=no; width=device-width">
<script type="text/javascript">
function closeModal() {
document.getElementById('modal').classList.add('transparent')
}
function showModal(login) {
document.getElementById('modal').classList.remove('transparent')
const createAccountElements = [
'confirm-password',
'confirm-password-label',
'create-account-form-button'
]
const loginElements = [
'log-in-form-button'
]
const visibleElements = login ? loginElements : createAccountElements
visibleElements.forEach(element => document.getElementById(element).classList.remove('hidden'))
const hiddenElements = login ? createAccountElements : loginElements
hiddenElements.forEach(element => document.getElementById(element).classList.add('hidden'))
}
</script>
2022-09-23 18:55:45 -04:00
{% block head %}{{ head }}{% endblock head %}
</head>
<body>
{{ modal() }}
2022-09-30 00:50:19 -04:00
{% if username %}
<div class="user logged-in">
<p style="margin: 0 1em 0 0;">{{ username }}</p>
<form action="/logout">
<input class="black-white-button" style="margin: 0; padding: 0.4em;" type="submit" value="Logout">
</form>
</div>
{% else %}
<div class="user logged-out">
<form action="/create_account">
<div class="black-white-button" style="margin-right: 1em; padding: 0.4em;" onclick="showModal(false)">Create account</div>
<div class="white-black-button" style="margin: 0; padding: 0.4em;" onclick="showModal(true)">Log in</div>
</form>
</div>
2022-09-30 00:50:19 -04:00
{% endif %}
2022-09-23 18:55:45 -04:00
<a href="/" style="text-decoration: none;">
<h1><span class="logo left">Under</span><span class="logo right">Cover</span></h1>
</a>
<h2>The secret cover letter generator</h2>
{% if error %}
<div class="errors">
{{ error }}
</div>
{% endif %}
<div>
2022-09-23 18:55:45 -04:00
{% block content %}
{{ content }}
{% endblock content %}
</div>
2022-09-23 18:55:45 -04:00
</body>
</html>