Files
python-tdd/src/templates/core/base.html

84 lines
3.0 KiB
HTML

{% load compress %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Disco DeDisco">
<meta name="robots" content="noindex, nofollow">
<title>Earthman RPG | {% block title_text %}{% endblock title_text %}</title>
{% compress css %}
<link type="text/x-scss" rel="stylesheet" href="{% static 'scss/core.scss' %}">
{% endcompress %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
</head>
<body class="{{ user_palette }} {{ page_class|default:'' }}">
<div class="container">
{% include "core/_partials/_navbar.html" %}
{% if messages %}
<div class="row">
<div class="col-md-12">
{% for message in messages %}
{% if message.level_tag == 'success' %}
<div class="alert alert-success">{{ message }}</div>
{% else %}
<div class="alert alert-warning">{{ message }}</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-6">
<h2 >{% block header_text %}{% endblock header_text %}</h2>
{% block extra_header %}
{% endblock extra_header %}
</div>
</div>
{% block content %}
{% endblock content %}
</div>
{% include "core/_partials/_footer.html" %}
{% if user.is_authenticated %}
<button id="id_kit_btn" data-kit-url="{% url 'kit_bag' %}" aria-label="Open Kit Bag">
<i class="fa-solid fa-briefcase"></i>
</button>
{% endif %}
<dialog id="id_kit_bag_dialog"></dialog>
{% block scripts %}
{% endblock scripts %}
<script src="{% static "vendor/htmx.min.js" %}"></script>
<script src="{% static "apps/applets/applets.js" %}"></script>
<script src="{% static "apps/dashboard/game-kit.js" %}"></script>
<script>
document.body.addEventListener('htmx:configRequest', function(evt) {
evt.detail.headers['X-CSRFToken'] = getCookie('csrftoken');
});
function getCookie(name) {
let val = null;
if (document.cookie) {
for (let c of document.cookie.split(';')) {
c = c.trim();
if (c.startsWith(name + '=')) {
val = decodeURIComponent(c.substring(name.length + 1));
break;
}
}
}
return val;
}
</script>
</body>
</html>