summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/templates/chimere/base.html20
-rw-r--r--chimere/templates/chimere/blocks/head_chimere.html16
-rw-r--r--chimere/templates/chimere/blocks/head_form.html2
-rw-r--r--chimere/templates/chimere/blocks/head_jme.html4
-rw-r--r--chimere/templates/chimere/blocks/head_jquery.html4
-rw-r--r--chimere/templatetags/chimere_tags.py9
l---------chimere/version.py1
-rw-r--r--chimere/views.py4
-rw-r--r--version.py7
9 files changed, 41 insertions, 26 deletions
diff --git a/chimere/templates/chimere/base.html b/chimere/templates/chimere/base.html
index dd70ef4..0b7eae3 100644
--- a/chimere/templates/chimere/base.html
+++ b/chimere/templates/chimere/base.html
@@ -1,22 +1,22 @@
{% extends "base.html" %}
{% load chimere_tags i18n %}
{% block extra_head %}
-<link rel="stylesheet" href="{{ STATIC_URL }}font-awesome/css/font-awesome.min.css" />
-<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap/bootstrap.min.css" />
-<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css" />
-<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css" media='print'/>
+<link rel="stylesheet" href="{{ STATIC_URL }}font-awesome/css/font-awesome.min.css?ver=4.3.0" />
+<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap/bootstrap.min.css?ver=3.0.0" />
+<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css?ver={{VERSION}}" />
+<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css?ver={{VERSION}}" media='print'/>
{% if css_area %}
-<link rel="stylesheet" href="{{ css_area }}" />{% endif %}
+<link rel="stylesheet" href="{{ css_area }}?ver={{VERSION}}" />{% endif %}
{% if MOBILE %}
-<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/mobile.css" />
-<script src="{{ STATIC_URL }}chimere/js/mobile.chimere.js" type="text/javascript"></script>{%endif%}
-<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/form-compat.css" />
-<script src="{{ STATIC_URL }}bootstrap/bootstrap.min.js" type="text/javascript"></script>
+<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/mobile.css?ver={{VERSION}}" />
+<script src="{{ STATIC_URL }}chimere/js/mobile.chimere.js?ver={{VERSION}}" type="text/javascript"></script>{%endif%}
+<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/form-compat.css?ver={{VERSION}}" />
+<script src="{{ STATIC_URL }}bootstrap/bootstrap.min.js?ver=3.0.0" type="text/javascript"></script>
<script type='text/javascript'>
var has_search = {% if has_search %}true{% else %}false{% endif %};
var default_map_lbl = "{% trans 'Default map' %}";
</script>
-<script src="{{ STATIC_URL }}chimere/js/interface.js" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}chimere/js/interface.js?ver={{VERSION}}" type="text/javascript"></script>
{% endblock %}
{% block header %}
<noscript>
diff --git a/chimere/templates/chimere/blocks/head_chimere.html b/chimere/templates/chimere/blocks/head_chimere.html
index 2621d54..c45d32c 100644
--- a/chimere/templates/chimere/blocks/head_chimere.html
+++ b/chimere/templates/chimere/blocks/head_chimere.html
@@ -1,9 +1,9 @@
{% if not is_edit %}
-<link rel="stylesheet" href="{{ STATIC_URL }}ol3/ol.css" />
-<link rel="stylesheet" href="{{ STATIC_URL }}ol3-contextmenu/ol3-contextmenu.min.css" />
-<script src="{{ STATIC_URL }}ol3/ol.js" type="text/javascript"></script>
+<link rel="stylesheet" href="{{ STATIC_URL }}ol3/ol.css?ver=3.17.1" />
+<link rel="stylesheet" href="{{ STATIC_URL }}ol3-contextmenu/ol3-contextmenu.min.css?ver=2.2.4" />
+<script src="{{ STATIC_URL }}ol3/ol.js?ver=3.17.1" type="text/javascript"></script>
{% endif %}
-<script src="{{ STATIC_URL }}ol3-contextmenu/ol3-contextmenu.min.js" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}ol3-contextmenu/ol3-contextmenu.min.js?ver=2.2.4" type="text/javascript"></script>
<script type="text/javascript">
/* Global variables */
var STATIC_URL = static_url = "{{ STATIC_URL }}";
@@ -20,7 +20,7 @@
var get_share_url = '{% url 'chimere:get-share-url' %}';
var language = "{{LANGUAGE}}";
</script>
-{% if routing %}<script src="{{ STATIC_URL }}chimere/js/routing-widget.js" type="text/javascript"></script>{% endif %}
-<script src="{{ STATIC_URL }}chimere/js/jquery.chimere.js" type="text/javascript"></script>
-<script src="{{ STATIC_URL }}chimere/js/utils.js" type="text/javascript"></script>
-<script src="{{ STATIC_URL }}chimere/js/base.js" type="text/javascript"></script>
+{% if routing %}<script src="{{ STATIC_URL }}chimere/js/routing-widget.js?ver={{VERSION}}" type="text/javascript"></script>{% endif %}
+<script src="{{ STATIC_URL }}chimere/js/jquery.chimere.js?ver={{VERSION}}" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}chimere/js/utils.js?ver={{VERSION}}" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}chimere/js/base.js?ver={{VERSION}}" type="text/javascript"></script>
diff --git a/chimere/templates/chimere/blocks/head_form.html b/chimere/templates/chimere/blocks/head_form.html
index fdcfeb3..f732219 100644
--- a/chimere/templates/chimere/blocks/head_form.html
+++ b/chimere/templates/chimere/blocks/head_form.html
@@ -1 +1 @@
-{% if ENABLE_TINYMCE %}<script src="{{ STATIC_URL }}tinymce/tinymce.min.js" type="text/javascript"></script>{% endif %}
+{% if ENABLE_TINYMCE %}<script src="{{ STATIC_URL }}tinymce/tinymce.min.js?ver=4.4.3" type="text/javascript"></script>{% endif %}
diff --git a/chimere/templates/chimere/blocks/head_jme.html b/chimere/templates/chimere/blocks/head_jme.html
index 47bda85..9e6da14 100644
--- a/chimere/templates/chimere/blocks/head_jme.html
+++ b/chimere/templates/chimere/blocks/head_jme.html
@@ -16,5 +16,5 @@
{% endcomment %}
<!-- prettyPhoto not jme but media -->
-<link rel="stylesheet" href="{{STATIC_URL}}prettyPhoto/css/prettyPhoto.css" />
-<script type="text/javascript" src="{{STATIC_URL}}prettyPhoto/js/jquery.prettyPhoto.js"></script>
+<link rel="stylesheet" href="{{STATIC_URL}}prettyPhoto/css/prettyPhoto.css?ver=3.1.4" />
+<script type="text/javascript" src="{{STATIC_URL}}prettyPhoto/js/jquery.prettyPhoto.js?ver=3.1.4"></script>
diff --git a/chimere/templates/chimere/blocks/head_jquery.html b/chimere/templates/chimere/blocks/head_jquery.html
index 5a5a6dd..76c0910 100644
--- a/chimere/templates/chimere/blocks/head_jquery.html
+++ b/chimere/templates/chimere/blocks/head_jquery.html
@@ -1,5 +1,5 @@
{% for css_url in JQUERY_CSS_URLS %}
-<link rel="stylesheet" href="{{ css_url }}" />{% endfor %}
+<link rel="stylesheet" href="{{ css_url }}?ver={{VERSION}}" />{% endfor %}
{% for js_url in JQUERY_JS_URLS %}
-<script type="text/javascript" src="{{ js_url }}"></script>{% endfor %}
+<script type="text/javascript" src="{{ js_url }}?ver={{VERSION}}"></script>{% endfor %}
diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py
index f4d0fed..c1e71b2 100644
--- a/chimere/templatetags/chimere_tags.py
+++ b/chimere/templatetags/chimere_tags.py
@@ -15,6 +15,7 @@ from django.utils.translation import ugettext as _
from django.template.loader import render_to_string
from chimere.models import Marker, Area, News, SubCategory, MultimediaType
+from chimere.version import get_version
from chimere.widgets import get_map_layers
log = getLogger(__name__)
@@ -126,6 +127,7 @@ def head_jquery(context):
context_data = {
"JQUERY_JS_URLS": settings.JQUERY_JS_URLS,
"JQUERY_CSS_URLS": settings.JQUERY_CSS_URLS,
+ "VERSION": get_version()
}
return context_data
@@ -135,7 +137,8 @@ def head_jme(context):
"""
Create context and display head elements (js, css, etc.) for jme.
"""
- context_data = {"STATIC_URL": settings.STATIC_URL}
+ context_data = {"STATIC_URL": settings.STATIC_URL,
+ "VERSION": get_version()}
return context_data
@@ -159,6 +162,7 @@ def head_chimere(context):
if settings.LANGUAGE_CODE else 'en',
"STATIC_URL": settings.STATIC_URL,
"MEDIA_URL": settings.MEDIA_URL,
+ "VERSION": get_version(),
"DYNAMIC_CATEGORIES": 'true' if area and area.dynamic_categories
else 'false',
"EXTRA_URL": reverse("chimere:index"),
@@ -182,7 +186,8 @@ def head_form():
Manualy add forms header (necessary in case of ajax load)
"""
context_data = {"ENABLE_TINYMCE": settings.ENABLE_TINYMCE,
- "STATIC_URL": settings.STATIC_URL}
+ "STATIC_URL": settings.STATIC_URL,
+ "VERSION": get_version()}
return context_data
diff --git a/chimere/version.py b/chimere/version.py
new file mode 120000
index 0000000..a508b60
--- /dev/null
+++ b/chimere/version.py
@@ -0,0 +1 @@
+../version.py \ No newline at end of file
diff --git a/chimere/views.py b/chimere/views.py
index 7f7cf2d..a1f4485 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -53,6 +53,7 @@ from chimere.forms import MarkerForm, RouteForm, ContactForm, FileForm, \
notifyStaff, AreaForm, RoutingForm, PolygonForm
from chimere.route import router
+from chimere.version import get_version
def get_base_uri(request):
@@ -74,7 +75,8 @@ def get_base_response(request, area_name=""):
"""
Get the base url
"""
- base_response_dct = {'media_path': settings.MEDIA_URL}
+ base_response_dct = {'media_path': settings.MEDIA_URL,
+ 'version': get_version()}
base_response_dct['MOBILE'] = \
settings.MOBILE_TEST or \
get_current_site(request).domain in settings.MOBILE_DOMAINS
diff --git a/version.py b/version.py
new file mode 100644
index 0000000..5518791
--- /dev/null
+++ b/version.py
@@ -0,0 +1,7 @@
+VERSION = (2, 99, 1)
+
+
+def get_version():
+ return '.'.join((str(num) for num in VERSION))
+
+__version__ = get_version()