cmsmanage/templates/base.dj.html

68 lines
2.6 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous">
<title>
{% block title %}Claremont MakerSpace{% endblock %}
</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="{% url 'root' %}">Claremont MakerSpace</a>
<button class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#user-nav"
aria-controls="user-nav"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="user-nav" class="collapse navbar-collapse justify-content-end">
<div class="navbar-nav">
{% block nav_extra %}{% endblock %}
{% if user.is_staff %}
<a class="nav-item nav-link"
href="{% block admin_link %}{% url 'admin:index' %}{% endblock %}">Admin</a>
{% endif %}
{% if user.is_authenticated %}
<a class="nav-item nav-link" href="{% url 'logout' %}">Logout: {{ user }}</a>
{% else %}
<a class="nav-item nav-link"
href="{% url 'login' %}?next={{ request.get_full_path }}">Login</a>
{% endif %}
</div>
</div>
</div>
</nav>
{% if messages %}
<div class="messages m-3">
{% for message in messages %}
{# TODO: should use tags correctly for bootstrap alerts #}
<div role="alert"
class="alert alert-info alert-dismissible fade show {% if message.tags %} {{ message.tags }}{% endif %}">
{{ message }}
<button type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% endfor %}
</div>
{% endif %}
<div id="content" class="m-3">
{% block content %}{% endblock %}
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>