fix: some minor improvements

This commit is contained in:
2024-11-23 20:26:10 -03:00
parent 76fb0aa94f
commit 1e4c565a52
2 changed files with 21 additions and 4 deletions

View File

@@ -31,11 +31,11 @@
</div>
{% if not session["id"] %}
<div class="col-md-2 d-none d-lg-flex align-items-center justify-content-center">
<a type="button" class="btn btn-primary w-75" href="{{ROUTES['users']['login']}}" >Log In</a>
<a class="btn btn-primary w-75" href="{{ROUTES['users']['login']}}" >Log In</a>
</div>
{% else %}
<div class="col-md-2 d-none d-lg-flex align-items-center justify-content-center">
<a type="button" class="btn btn-danger w-75" href="{{ROUTES['users']['logout']}}" >Log Out</a>
<a class="btn btn-danger w-75" href="{{ROUTES['users']['logout']}}" >Log Out</a>
</div>
{% endif %}
</div>
@@ -52,6 +52,23 @@
{% block footer %}
&copy; Copyright 2010 by <a href="http://domain.invalid/">you</a>.
{% endblock %}
<form action="https://validator.w3.org/check" class="text-center" enctype="multipart/form-data" method="post" target="_blank">
<input name="doctype" type="hidden" value="HTML5">
<input name="fragment" type="hidden">
<input alt="Validate" src="/static/I_heart_validator.png" type="image"> <!-- https://validator.w3.org/ -->
</form>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Adapted from https://stackoverflow.com/a/10162353
const html = '<!DOCTYPE ' +
document.doctype.name +
(document.doctype.publicId ? ' PUBLIC "' + document.doctype.publicId + '"' : '') +
(!document.doctype.publicId && document.doctype.systemId ? ' SYSTEM' : '') +
(document.doctype.systemId ? ' "' + document.doctype.systemId + '"' : '') +
'>\n' + document.documentElement.outerHTML;
document.querySelector('form[action="https://validator.w3.org/check"] > input[name="fragment"]').value = html;
});
</script>
</footer>
</body>