From b4ad4c2541a9bb6d7ce2704d2f7fae6aeb642cbb Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 20 Oct 2017 12:23:58 +0200 Subject: Use django-compressor to compress CSS and JS - switch to html5 page declaration --- example_project/settings.py | 7 +++++ ishtar_common/templates/base.html | 40 +++++++++++++++-------------- ishtar_pdl/templates/blocks/extra_head.html | 1 - requirements.txt | 1 + 4 files changed, 29 insertions(+), 20 deletions(-) delete mode 100644 ishtar_pdl/templates/blocks/extra_head.html diff --git a/example_project/settings.py b/example_project/settings.py index 6ca8cb5fc..90991ebd5 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -36,6 +36,12 @@ STATICFILES_DIRS = ( ROOT_PATH + "../static/", ) +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder', +) + ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt" LOGIN_REDIRECT_URL = "/" + URL_PATH @@ -155,6 +161,7 @@ INSTALLED_APPS = [ 'archaeological_warehouse', 'archaeological_finds', 'ajax_select', + 'compressor', # 'debug_toolbar', ] diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 75e0e3740..c8248841f 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -1,11 +1,10 @@ -{% load i18n %} - - +{% load i18n compress %} + + - {% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} - + {% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} + {% compress js %} @@ -13,23 +12,11 @@ - + {# #} - - - - - - - {% for url_css in JQGRID_CSS %}{% endfor %} - {% include "blocks/extra_head.html" %} - {% block extra_head %} - {% endblock %} - {% if raw_css %}{% endif %} + {% endcompress %} + {% compress css %} + + + + + + + {% for url_css in JQGRID_CSS %}{% endfor %} + + {% endcompress %} + {% block extra_head %} + {% endblock %} + {% if raw_css %}{% endif %}