Views
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
content="width=100%, user-scalable=yes, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://unpkg.com/htmx.org@1.9.11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
|
||||
<title>Django-html demo</title>
|
||||
<title>{{ title or "Django-html demo" }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{% block body_content %}{% endblock %}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
{% extends "main/base/base.html" %}
|
||||
|
||||
{% block body_content %}
|
||||
<div class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
20
project/main/templates/main/base/layout.html
Normal file
20
project/main/templates/main/base/layout.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "main/base/base.html" %}
|
||||
{% from "main/components/nav.html" import nav %}
|
||||
|
||||
{% block body_content %}
|
||||
<div class="container">
|
||||
<h1 class="mt-5 mb-5 pb-3 border-bottom border-dark">
|
||||
{{ title }}
|
||||
</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{{ nav(active_section=active_section) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
8
project/main/templates/main/complex_form.html
Normal file
8
project/main/templates/main/complex_form.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "main/base/layout.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
This is some complex form content bellow.
|
||||
</p>
|
||||
{% endblock %}
|
||||
18
project/main/templates/main/components/nav.html
Normal file
18
project/main/templates/main/components/nav.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% macro nav(active_section) %}
|
||||
{% macro render_item(title, link) %}
|
||||
<a
|
||||
href="{{ url(link) }}"
|
||||
class="list-group-item list-group-item-action {% if active_section == link %}active{% endif %}"
|
||||
>
|
||||
{{ title }}
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
<div class="list-group list-group-flush">
|
||||
{{ render_item("Swap Content", "swap-content") }}
|
||||
{{ render_item("Form Validation", "form-validation") }}
|
||||
{{ render_item("Complex Form", "complex-form") }}
|
||||
{{ render_item("Filter List", "filter-list") }}
|
||||
{{ render_item("Table Inline Edit", "table-inline-edit") }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
8
project/main/templates/main/filter_list.html
Normal file
8
project/main/templates/main/filter_list.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "main/base/layout.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
This is some filter list content bellow.
|
||||
</p>
|
||||
{% endblock %}
|
||||
8
project/main/templates/main/form_validation.html
Normal file
8
project/main/templates/main/form_validation.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "main/base/layout.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
This is some form validation content bellow.
|
||||
</p>
|
||||
{% endblock %}
|
||||
@ -25,7 +25,7 @@
|
||||
</ul>
|
||||
|
||||
<h4 class="mt-5">
|
||||
<a href="#">
|
||||
<a href="{{ url("swap-content") }}">
|
||||
Start demo
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
8
project/main/templates/main/swap_content.html
Normal file
8
project/main/templates/main/swap_content.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "main/base/layout.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
This is some swappable content bellow.
|
||||
</p>
|
||||
{% endblock %}
|
||||
8
project/main/templates/main/table_inline_edit.html
Normal file
8
project/main/templates/main/table_inline_edit.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "main/base/layout.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
This is some table inline edit content bellow.
|
||||
</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user