Add flatpages to apps and dynamic navbar listing
This commit is contained in:
parent
00cc417f21
commit
38e8800cf2
@ -42,6 +42,7 @@ INSTALLED_APPS = [
|
|||||||
'registration',
|
'registration',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.flatpages',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
@ -71,6 +72,7 @@ MIDDLEWARE = [
|
|||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'ojusomap.urls'
|
ROOT_URLCONF = 'ojusomap.urls'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
|
{% load flatpages %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load leaflet_tags %}
|
{% load leaflet_tags %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
@ -30,18 +31,13 @@
|
|||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Map <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Map <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
{% get_flatpages as flatpages %}
|
||||||
<a class="nav-link" href="#">Policy</a>
|
{% for page in flatpages %}
|
||||||
</li>
|
<li class="nav-item"><a class="nav-link" href="{{page.url}}">{{page.title}}</a></li>
|
||||||
<li class="nav-item">
|
{% endfor %}
|
||||||
<a class="nav-link" href="#">Contact</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">FAQ</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
@ -53,7 +49,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{% block body %}{% endblock %}
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
{# CDN Javascript #}
|
{# CDN Javascript #}
|
||||||
|
5
ojusomap/templates/flatpages/default.html
Normal file
5
ojusomap/templates/flatpages/default.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{% extends "base_page.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{{flatpage.content}}
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user