From 5b3a7d60de1ee2737e91307b6f1af3196f81daef Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 19 Jul 2016 11:28:07 +0200 Subject: Add versioning to CSS and JS files --- .../templates/ishtar/sheet_contextrecord_pdf.html | 2 +- .../ishtar/sheet_contextrecordsource_pdf.html | 2 +- .../templates/ishtar/sheet_file_pdf.html | 2 +- .../templates/ishtar/sheet_find_pdf.html | 2 +- .../templates/ishtar/sheet_findbasket_pdf.html | 2 +- .../templates/ishtar/sheet_findsource_pdf.html | 2 +- .../ishtar/sheet_administrativeact_pdf.html | 2 +- .../templates/ishtar/sheet_operation_pdf.html | 2 +- .../ishtar/sheet_operationsource_pdf.html | 2 +- example_project/settings.py | 1 + ishtar_common/context_processors.py | 4 ++++ ishtar_common/templates/404.html | 2 +- ishtar_common/templates/base.html | 28 +++++++++++----------- .../ishtar/dashboards/dashboard_main.html | 19 +++++++-------- ishtar_common/templates/ishtar/sheet.html | 2 +- .../templates/ishtar/sheet_organization_pdf.html | 2 +- .../templates/ishtar/sheet_person_pdf.html | 2 +- ishtar_common/templates/window.html | 12 +++++----- ishtar_common/version.py | 1 + ishtar_pdl/templates/blocks/extra_head.html | 2 +- 20 files changed, 49 insertions(+), 44 deletions(-) create mode 120000 ishtar_common/version.py diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html index f92dbea2e..a0d0affcf 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_contextrecord.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html index 8e6b9bb85..38c5d318e 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_contextrecordsource.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_files/templates/ishtar/sheet_file_pdf.html b/archaeological_files/templates/ishtar/sheet_file_pdf.html index a63234ccd..eaf2a9436 100644 --- a/archaeological_files/templates/ishtar/sheet_file_pdf.html +++ b/archaeological_files/templates/ishtar/sheet_file_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_file.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_finds/templates/ishtar/sheet_find_pdf.html b/archaeological_finds/templates/ishtar/sheet_find_pdf.html index 13671ce70..262bcdad7 100644 --- a/archaeological_finds/templates/ishtar/sheet_find_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_find_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_find.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html b/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html index 37eecf81b..2b55f0f76 100644 --- a/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_findbasket_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_findbasket.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html index b7f8ec473..26ef9f2d7 100644 --- a/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html +++ b/archaeological_finds/templates/ishtar/sheet_findsource_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_findsource.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html index e3c78d733..b6d257cb0 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_administrativeact.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_operations/templates/ishtar/sheet_operation_pdf.html b/archaeological_operations/templates/ishtar/sheet_operation_pdf.html index f23b0d489..dc3c8b46f 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_operation_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_operation.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html b/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html index 32362d4c2..1b2cd9ff3 100644 --- a/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html +++ b/archaeological_operations/templates/ishtar/sheet_operationsource_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_operationsource.html" %} {% block header %} - + {% endblock %} {% block main_head %} {{ block.super }} diff --git a/example_project/settings.py b/example_project/settings.py index 8136fb81f..18a715577 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -28,6 +28,7 @@ STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" URL_PATH = "" +EXTRA_VERSION = '' # prefix for archaeological files code FILE_PREFIX = "SRA" diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index 76f58bf8e..f8a4a0f95 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -21,6 +21,7 @@ from django.conf import settings from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ +from ishtar_common.version import VERSION from ishtar_common.utils import shortify from menus import Menu @@ -70,6 +71,9 @@ def get_base_context(request): dct['JQUERY_URL'] = settings.JQUERY_URL dct['JQUERY_UI_URL'] = settings.JQUERY_UI_URL dct['COUNTRY'] = settings.COUNTRY + dct['VERSION'] = u".".join([unicode(n) for n in VERSION]) + if settings.EXTRA_VERSION: + dct['VERSION'] += unicode(settings.EXTRA_VERSION) dct['current_menu'] = [] for lbl, model in CURRENT_ITEMS: model_name = model.__name__.lower() diff --git a/ishtar_common/templates/404.html b/ishtar_common/templates/404.html index aec82ca88..82cdd0fb4 100644 --- a/ishtar_common/templates/404.html +++ b/ishtar_common/templates/404.html @@ -7,7 +7,7 @@ {% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} - +
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 8fd563baa..02ddb85df 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -11,20 +11,20 @@ - - - - - - - - - - - - - - {% for url_css in JQGRID_CSS %}{% endfor %} + + + + + + + + + + + + + + {% for url_css in JQGRID_CSS %}{% endfor %} {% include "blocks/extra_head.html" %} {% block extra_head %} {% endblock %} diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html index 868f8a5c3..93e11d604 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html @@ -3,16 +3,15 @@ {% load url from future %} {% block extra_head %} {{form.media}} - - - - - - - - - - + + + + + + + + + {% endblock %} {% block content %} - - - - + + + + {{form.media}} - - + + {% block extra_head %} {% endblock %} diff --git a/ishtar_common/version.py b/ishtar_common/version.py new file mode 120000 index 000000000..a508b60d3 --- /dev/null +++ b/ishtar_common/version.py @@ -0,0 +1 @@ +../version.py \ No newline at end of file diff --git a/ishtar_pdl/templates/blocks/extra_head.html b/ishtar_pdl/templates/blocks/extra_head.html index 5a75d0728..aa429bed4 100644 --- a/ishtar_pdl/templates/blocks/extra_head.html +++ b/ishtar_pdl/templates/blocks/extra_head.html @@ -1 +1 @@ - + -- cgit v1.2.3