diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-07-19 11:28:07 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-07-19 11:28:07 +0200 |
commit | 5b3a7d60de1ee2737e91307b6f1af3196f81daef (patch) | |
tree | 1cda2030e9b4e2e4f505e8c20ec083049e710b5f | |
parent | f6a3eac249afb4e99b1d750bc20575fd86f74d8b (diff) | |
download | Ishtar-5b3a7d60de1ee2737e91307b6f1af3196f81daef.tar.bz2 Ishtar-5b3a7d60de1ee2737e91307b6f1af3196f81daef.zip |
Add versioning to CSS and JS files
20 files changed, 49 insertions, 44 deletions
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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% 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 @@ <link rel="shortcut icon" href="{{STATIC_URL}}/media/images/favicon.png"> <title>{% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} </title> - <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css" /> + <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css?ver={{VERSION}}" /> </head> <body> <div> 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 @@ <script language="javascript" type="text/javascript"> var url_path = "{{URL_PATH}}"; </script> - <script language="javascript" type="text/javascript" src="{{JQUERY_URL}}"></script> - <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}jquery-ui.js"></script> - <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/prettyPhoto/js/jquery.prettyPhoto.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/i18n/grid.locale-{{COUNTRY}}.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jquery.jqGrid.min.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/grid.tbltogrid.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/ishtar.js"></script> - <link type="text/css" href="{{JQUERY_UI_URL}}jquery-ui.css" rel="stylesheet" /> - <link rel="stylesheet" href="{{STATIC_URL}}/font-awesome/css/font-awesome.min.css" /> - <link rel="stylesheet" href="{{STATIC_URL}}/js/prettyPhoto/css/prettyPhoto.css" /> - <link rel="stylesheet" href="{{STATIC_URL}}media/ui.jqgrid.css" /> - <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css" /> - {% for url_css in JQGRID_CSS %}<link rel="stylesheet" href="{{url_css}}" />{% endfor %} + <script language="javascript" type="text/javascript" src="{{JQUERY_URL}}?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}jquery-ui.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/prettyPhoto/js/jquery.prettyPhoto.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/i18n/grid.locale-{{COUNTRY}}.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jquery.jqGrid.min.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/grid.tbltogrid.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/ishtar.js?ver={{VERSION}}"></script> + <link type="text/css" href="{{JQUERY_UI_URL}}jquery-ui.css?ver={{VERSION}}" rel="stylesheet" /> + <link rel="stylesheet" href="{{STATIC_URL}}/font-awesome/css/font-awesome.min.css?ver={{VERSION}}" /> + <link rel="stylesheet" href="{{STATIC_URL}}/js/prettyPhoto/css/prettyPhoto.css?ver={{VERSION}}" /> + <link rel="stylesheet" href="{{STATIC_URL}}media/ui.jqgrid.css?ver={{VERSION}}" /> + <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css?ver={{VERSION}}" /> + {% for url_css in JQGRID_CSS %}<link rel="stylesheet" href="{{url_css}}?ver={{VERSION}}" />{% 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}} -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.highlighter.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.pieRenderer.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.cursor.min.js"></script> -<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.cursor.min.js"></script> -<link rel="stylesheet" href="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.css" /> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasTextRenderer.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.highlighter.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.pieRenderer.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.dateAxisRenderer.min.js?ver={{VERSION}}"></script> +<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/plugins/jqplot.cursor.min.js?ver={{VERSION}}"></script> +<link rel="stylesheet" href="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.css?ver={{VERSION}}" /> {% endblock %} {% block content %} <script> diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html index 5cb75ea3a..5da837ab4 100644 --- a/ishtar_common/templates/ishtar/sheet.html +++ b/ishtar_common/templates/ishtar/sheet.html @@ -7,7 +7,7 @@ <title>{% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} </title> {% block header %} - <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css" /> + <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css?ver={{VERSION}}" /> {% endblock %} </head> <body> diff --git a/ishtar_common/templates/ishtar/sheet_organization_pdf.html b/ishtar_common/templates/ishtar/sheet_organization_pdf.html index 79e89ef0b..887c7ccb2 100644 --- a/ishtar_common/templates/ishtar/sheet_organization_pdf.html +++ b/ishtar_common/templates/ishtar/sheet_organization_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_organization.html" %} {% block header %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% endblock %} {% block main_head %} {{ block.super }} diff --git a/ishtar_common/templates/ishtar/sheet_person_pdf.html b/ishtar_common/templates/ishtar/sheet_person_pdf.html index 1abc70243..199892d2f 100644 --- a/ishtar_common/templates/ishtar/sheet_person_pdf.html +++ b/ishtar_common/templates/ishtar/sheet_person_pdf.html @@ -1,6 +1,6 @@ {% extends "ishtar/sheet_person.html" %} {% block header %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css" /> +<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% endblock %} {% block main_head %} {{ block.super }} diff --git a/ishtar_common/templates/window.html b/ishtar_common/templates/window.html index 7c9249ff0..8e8eac41e 100644 --- a/ishtar_common/templates/window.html +++ b/ishtar_common/templates/window.html @@ -10,13 +10,13 @@ <script language="javascript" type="text/javascript"> var url_path = "{{URL_PATH}}"; </script> - <script language="javascript" type="text/javascript" src="{{JQUERY_URL}}"></script> - <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}jquery-ui.js"></script> - <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js"></script> - <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/ishtar.js"></script> + <script language="javascript" type="text/javascript" src="{{JQUERY_URL}}?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}jquery-ui.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js?ver={{VERSION}}"></script> + <script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/ishtar.js?ver={{VERSION}}"></script> {{form.media}} - <link type="text/css" href="{{JQUERY_UI_URL}}jquery-ui.css" rel="stylesheet" /> - <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css" /> + <link type="text/css" href="{{JQUERY_UI_URL}}jquery-ui.css?ver={{VERSION}}" rel="stylesheet" /> + <link rel="stylesheet" href="{{STATIC_URL}}/media/style.css?ver={{VERSION}}" /> {% block extra_head %} {% endblock %} </head> 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 @@ - <link rel="stylesheet" href="{{STATIC_URL}}/pdl/styles.css" /> + <link rel="stylesheet" href="{{STATIC_URL}}pdl/styles.css?ver={{VERSION}}" /> |