Add footer with flatpages links
This commit is contained in:
parent
96a087f8d6
commit
6228e0e003
4 changed files with 47 additions and 0 deletions
|
@ -39,6 +39,7 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'django.contrib.flatpages',
|
||||||
|
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
|
@ -73,6 +74,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',
|
||||||
|
|
||||||
'social_django.middleware.SocialAuthExceptionMiddleware',
|
'social_django.middleware.SocialAuthExceptionMiddleware',
|
||||||
]
|
]
|
||||||
|
|
8
get_together/templates/flatpages/default.html
Normal file
8
get_together/templates/flatpages/default.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{% extends "get_together/base.html" %}
|
||||||
|
{% load markup %}
|
||||||
|
|
||||||
|
{% block title %}{{ flatpage.title }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{{ flatpage.content|markdown }}
|
||||||
|
{% endblock %}
|
|
@ -34,6 +34,26 @@
|
||||||
body {
|
body {
|
||||||
padding-top: 5rem;
|
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 {
|
.starter-template {
|
||||||
padding: 3rem 1.5rem;
|
padding: 3rem 1.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -102,6 +122,21 @@ form {
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</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
|
<!-- Bootstrap core JavaScript
|
||||||
================================================== -->
|
================================================== -->
|
||||||
<!-- Placed at the end of the document so the pages load faster -->
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
|
|
@ -70,6 +70,8 @@ urlpatterns = [
|
||||||
path('places/<int:place_id>/', views.show_place, name='show-place'),
|
path('places/<int:place_id>/', views.show_place, name='show-place'),
|
||||||
path('+create-place/', views.create_place, name='create-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')),
|
path('oauth/', include('social_django.urls', namespace='social')),
|
||||||
]
|
]
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|
Loading…
Reference in a new issue