2022-09-29 12:35:26 -04:00
|
|
|
|
{% macro render_label(field) %}
|
2022-09-22 16:30:14 -04:00
|
|
|
|
<dt>{{ field.label }}</dt>
|
2022-09-29 12:35:26 -04:00
|
|
|
|
{% endmacro %}
|
2022-09-22 16:30:14 -04:00
|
|
|
|
|
2022-09-29 12:35:26 -04:00
|
|
|
|
{% macro render_input(field, extra="") %}
|
2022-09-22 16:30:14 -04:00
|
|
|
|
<dd {{extra}}>
|
|
|
|
|
{{ field(**kwargs)|safe }}
|
|
|
|
|
|
|
|
|
|
{% if field.errors %}
|
|
|
|
|
<ul class=errors>
|
|
|
|
|
{% for error in field.errors %}
|
|
|
|
|
<li>{{ error }}</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</dd>
|
2021-07-23 17:30:15 -04:00
|
|
|
|
{% endmacro %}
|
2022-09-29 12:35:26 -04:00
|
|
|
|
|
|
|
|
|
{% macro render_field(field, extra="") %}
|
|
|
|
|
<div class="field">
|
|
|
|
|
{{ render_label(field) }}
|
|
|
|
|
{{ render_input(field, extra, **kwargs) }}
|
|
|
|
|
</div>
|
|
|
|
|
{% endmacro %}
|
2022-10-02 02:27:23 -04:00
|
|
|
|
|
2022-10-02 10:48:13 -04:00
|
|
|
|
{% macro form_submit_button(text, id, action, errors) %}
|
2023-12-17 00:48:40 -05:00
|
|
|
|
<button type="button"
|
2022-10-02 10:48:13 -04:00
|
|
|
|
id="{{ id }}"
|
|
|
|
|
class="wipe up-wipe"
|
2023-12-17 00:48:40 -05:00
|
|
|
|
style="font-size: 1em;"
|
2022-10-02 10:48:13 -04:00
|
|
|
|
{% if errors %}
|
|
|
|
|
onclick="/*clearErrors();*/const e = document.getElementById('create-account-form'); e.action = '{{ action }}'; e.submit()"
|
|
|
|
|
{% else %}
|
|
|
|
|
onclick="const e = document.getElementById('create-account-form'); e.action = '{{ action }}'; e.submit()"
|
|
|
|
|
{% endif %}
|
|
|
|
|
>{{ text }}</a>
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
2022-10-02 02:27:23 -04:00
|
|
|
|
{% macro modal() %}
|
|
|
|
|
<div id='modal' class='modal modal-background transparent' onclick="event.target.id === 'modal' && closeModal()">
|
|
|
|
|
<div class='modal modal-content'>
|
2023-05-03 16:32:06 -04:00
|
|
|
|
<button class='top-right text-button' onclick="closeModal()">×</button>
|
2022-10-02 02:54:59 -04:00
|
|
|
|
<h2 id='modal-title'>Login Now</h2>
|
2022-10-02 02:27:23 -04:00
|
|
|
|
<form action="/login" method="post" id="create-account-form">
|
|
|
|
|
<div>
|
|
|
|
|
<label for="login">Email: </label>
|
|
|
|
|
<input id="login" maxlength="32" minlength="4" name="login" type="text" placeholder="sage@sagev.space">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label for="password">Password: </label>
|
|
|
|
|
<input id="password" maxlength="32" minlength="4" name="password" type="password">
|
|
|
|
|
</div>
|
|
|
|
|
<div id="confirm-password-div">
|
2023-10-29 21:16:11 -04:00
|
|
|
|
<div style="margin-bottom: 1.5em;">Password must be between 8 and 64 characters</div>
|
2022-10-02 02:27:23 -04:00
|
|
|
|
<label id='confirm-password-label' for="confirm-password">Confirm Password: </label>
|
|
|
|
|
<input id="confirm-password" maxlength="32" minlength="4" name="confirm-password" type="password">
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-10-02 09:45:40 -04:00
|
|
|
|
<div style="margin-top: 1em;">
|
2022-10-02 10:48:13 -04:00
|
|
|
|
{{ form_submit_button('Create account', 'create-account-form-button', '/create_account', errors) }}
|
|
|
|
|
{{ form_submit_button('Log in', 'log-in-form-button', '/login', errors) }}
|
2022-10-02 09:45:40 -04:00
|
|
|
|
</div>
|
2022-10-02 02:27:23 -04:00
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% endmacro %}
|