diff --git a/breccia_mapper/settings.py b/breccia_mapper/settings.py index 211d98a..7f5ba6d 100644 --- a/breccia_mapper/settings.py +++ b/breccia_mapper/settings.py @@ -8,6 +8,9 @@ https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ + +Before production deployment, see +https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ """ import collections @@ -16,13 +19,25 @@ import pathlib from decouple import config, Csv import dj_database_url + +# Settings exported to templates +# https://github.com/jakubroztocil/django-settings-export + +SETTINGS_EXPORT = [ + 'DEBUG', + 'PROJECT_LONG_NAME', + 'PROJECT_SHORT_NAME', +] + + +PROJECT_LONG_NAME = config('PROJECT_LONG_NAME', default='Project Long Name') +PROJECT_SHORT_NAME = config('PROJECT_SHORT_NAME', default='shortname') + + # Build paths inside the project like this: BASE_DIR.joinpath(...) BASE_DIR = pathlib.Path(__file__).parent.parent -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ - # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') @@ -48,6 +63,9 @@ DJANGO_APPS = [ ] THIRD_PARTY_APPS = [ + 'bootstrap4', + 'constance', + 'constance.backends.database', ] FIRST_PARTY_APPS = [ @@ -75,6 +93,8 @@ TEMPLATES = [ 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ + 'django_settings_export.settings_export', + 'constance.context_processors.config', 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', diff --git a/breccia_mapper/static/css/global.css b/breccia_mapper/static/css/global.css new file mode 100644 index 0000000..4990a4d --- /dev/null +++ b/breccia_mapper/static/css/global.css @@ -0,0 +1,21 @@ +/* Sticky footer from https://css-tricks.com/couple-takes-sticky-footer/#article-header-id-3 */ +html, body { + height: 100%; +} + +body { + display: flex; + flex-direction: column; +} + +.content { + flex: 1 0 auto; +} + + +.footer { + height: 60px; + line-height: 60px; + flex-shrink: 0; +} +/* end of sticky footer styles */ diff --git a/breccia_mapper/static/css/masthead.css b/breccia_mapper/static/css/masthead.css new file mode 100644 index 0000000..56fb41e --- /dev/null +++ b/breccia_mapper/static/css/masthead.css @@ -0,0 +1,39 @@ +header.masthead { + position: relative; + background: #343a40 no-repeat center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + padding-top: 8rem; + padding-bottom: 8rem; + min-height: 200px; + height: 60vh; + z-index: -2; +} + +header.masthead .overlay { + position: absolute; + background-color: #212529; + height: 100%; + width: 100%; + top: 0; + left: 0; + opacity: 0.4; + z-index: -1; +} + +header.masthead .textbox-container { + background-color: rgba(30, 30, 30, 0.2); +} + +@media (min-width: 768px) { + header.masthead { + padding-top: 1rem; + padding-bottom: 12rem; + } + + header.masthead h1 { + font-size: 3rem; + } +} diff --git a/breccia_mapper/templates/base.html b/breccia_mapper/templates/base.html new file mode 100644 index 0000000..60f1389 --- /dev/null +++ b/breccia_mapper/templates/base.html @@ -0,0 +1,149 @@ + +{% load bootstrap4 %} +{% if 'use_i18n'|bootstrap_setting %} + {% load i18n %} + {% get_current_language as LANGUAGE_CODE %} +{% endif %} + + +
+ + + + + + + {% bootstrap_css %} + + + + + + {% load staticfiles %} + + + {% if 'javascript_in_head'|bootstrap_setting %} + {% if 'include_jquery'|bootstrap_setting %} + {# jQuery JavaScript if it is in head #} + {% bootstrap_jquery jquery='include_jquery'|bootstrap_setting %} + {% endif %} + + {# Bootstrap JavaScript if it is in head #} + {% bootstrap_javascript %} + {% endif %} + + {% block extra_head %}{% endblock %} + + + + +Snappy leader here...
++ {{ settings.PROJECT_LONG_NAME }} is... +
+