test
This commit is contained in:
28
djpro/templates/base.html
Normal file
28
djpro/templates/base.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% load menu_tags %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}My Site{% endblock %}</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
|
||||
<!-- Custom CSS -->
|
||||
<style>
|
||||
/* */
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<div class="container">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS (optional) -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
18
djpro/templates/menu.html
Normal file
18
djpro/templates/menu.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% load menu_tags %}
|
||||
|
||||
<ul>
|
||||
{% for item in menu_items %}
|
||||
{% if not item.parent or item.id in item.parent.children.all %}
|
||||
<li{% if current_url == item.url %} class="active"{% endif %}>
|
||||
<a href="{% if item.url %}{{ item.url }}{% else %}#{% endif %}">{{ item.title }}</a>
|
||||
{% if item.children %}
|
||||
<ul>
|
||||
{% for child in item.children.all %}
|
||||
<li><a href="{{ child.url }}">{{ child.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
18
djpro/templates/navbar.html
Normal file
18
djpro/templates/navbar.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% load menu_tags %}
|
||||
|
||||
<ul>
|
||||
{% for item in menu_items %}
|
||||
{% if not item.parent or item.id in item.parent.children.all %}
|
||||
<li{% if current_url == item.url %} class="active"{% endif %}>
|
||||
<a href="{% if item.url %}{{ item.url }}{% else %}#{% endif %}">{{ item.title }}</a>
|
||||
{% if item.children %}
|
||||
<ul>
|
||||
{% for child in item.children.all %}
|
||||
<li><a href="{{ child.url }}">{{ child.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
Reference in New Issue
Block a user