Add flatpages to apps and dynamic navbar listing
This commit is contained in:
parent
00cc417f21
commit
38e8800cf2
@ -42,6 +42,7 @@ INSTALLED_APPS = [
|
||||
'registration',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.flatpages',
|
||||
'django.contrib.humanize',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.sites',
|
||||
@ -71,6 +72,7 @@ MIDDLEWARE = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'ojusomap.urls'
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% spaceless %}
|
||||
{% load flatpages %}
|
||||
{% load i18n %}
|
||||
{% load leaflet_tags %}
|
||||
{% load static %}
|
||||
@ -30,18 +31,13 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<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>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Policy</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">FAQ</a>
|
||||
</li>
|
||||
{% get_flatpages as flatpages %}
|
||||
{% for page in flatpages %}
|
||||
<li class="nav-item"><a class="nav-link" href="{{page.url}}">{{page.title}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if user.is_authenticated %}
|
||||
@ -53,7 +49,8 @@
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
{# 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