Add footer with flatpages links

This commit is contained in:
Michael Hall 2018-03-20 19:17:06 -04:00
parent 96a087f8d6
commit 6228e0e003
4 changed files with 47 additions and 0 deletions

View file

@ -39,6 +39,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'django.contrib.sites',
'rest_framework',
@ -73,6 +74,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'social_django.middleware.SocialAuthExceptionMiddleware',
]

View file

@ -0,0 +1,8 @@
{% extends "get_together/base.html" %}
{% load markup %}
{% block title %}{{ flatpage.title }}{% endblock %}
{% block content %}
{{ flatpage.content|markdown }}
{% endblock %}

View file

@ -34,6 +34,26 @@
body {
padding-top: 5rem;
}
.footer {
padding-top: 1em;
padding-bottom: 1em;
border-top: #cfcfcf 1px solid;
background-color: #f5f5f5;
color: #aaaaaa;
}
.footer ul {
display: inline;
list-style-type: none;
margin-left: 0.5em;
}
.footer ul li {
display: inline;
margin-left: 0.5em;
}
.footer a {
text-decoration: none;
color: inherit;
}
.starter-template {
padding: 3rem 1.5rem;
text-align: center;
@ -102,6 +122,21 @@ form {
{% block content %}{% endblock %}
</main>
{% load flatpages %}
{% get_flatpages as flatpages %}
<footer class="footer">
<div class="container">
<div class="row">
<div class="col">
<ul class="list-group list-group-flush">
{% for page in flatpages %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

View file

@ -70,6 +70,8 @@ urlpatterns = [
path('places/<int:place_id>/', views.show_place, name='show-place'),
path('+create-place/', views.create_place, name='create-place'),
path('about/', include('django.contrib.flatpages.urls')),
path('oauth/', include('social_django.urls', namespace='social')),
]
if settings.DEBUG: