Browse Source

Appended a version flag to all CSS/JS references to invalidate browser cache after an upgrade

Jeremy Stretch 8 years ago
parent
commit
3ed3e93b25

+ 2 - 2
netbox/templates/_base.html

@@ -7,7 +7,7 @@
 	<link rel="stylesheet" href="{% static 'bootstrap-3.3.6-dist/css/bootstrap.min.css' %}">
     <link rel="stylesheet" href="{% static 'font-awesome-4.6.3/css/font-awesome.min.css' %}">
     <link rel="stylesheet" href="{% static 'jquery-ui-1.11.4/jquery-ui.css' %}">
-	<link rel="stylesheet" href="{% static 'css/base.css' %}">
+	<link rel="stylesheet" href="{% static 'css/base.css' %}?v{{ settings.VERSION }}">
     <link rel="icon" type="image/png" href="{% static 'img/netbox.ico' %}" />
     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
 </head>
@@ -308,7 +308,7 @@
 <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
 <script src="{% static 'jquery-ui-1.11.4/jquery-ui.min.js' %}"></script>
 <script src="{% static 'bootstrap-3.3.6-dist/js/bootstrap.min.js' %}"></script>
-<script src="{% static 'js/forms.js' %}"></script>
+<script src="{% static 'js/forms.js' %}?v{{ settings.VERSION }}"></script>
 {% block javascript %}{% endblock %}
 </body>
 </html>

+ 1 - 1
netbox/templates/circuits/circuittermination_edit.html

@@ -90,5 +90,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/circuits/provider.html

@@ -199,5 +199,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/graphs.js' %}"></script>
+<script src="{% static 'js/graphs.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/consoleport_connect.html

@@ -58,5 +58,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/consoleserverport_connect.html

@@ -58,5 +58,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 2 - 2
netbox/templates/dcim/device.html

@@ -629,6 +629,6 @@ $(".interface-toggle").click(function() {
     return toggleConnection($(this), "dcim/interface-connections/");
 });
 </script>
-<script src="{% static 'js/graphs.js' %}"></script>
-<script src="{% static 'js/secrets.js' %}"></script>
+<script src="{% static 'js/graphs.js' %}?v{{ settings.VERSION }}"></script>
+<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/interfaceconnection_edit.html

@@ -93,5 +93,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/poweroutlet_connect.html

@@ -58,5 +58,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/powerport_connect.html

@@ -58,5 +58,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/dcim/site.html

@@ -260,5 +260,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/graphs.js' %}"></script>
+<script src="{% static 'js/graphs.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/ipam/ipaddress_assign.html

@@ -68,5 +68,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/ipam/ipaddress_edit.html

@@ -79,5 +79,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/livesearch.js' %}"></script>
+<script src="{% static 'js/livesearch.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/secrets/secret.html

@@ -97,5 +97,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/secrets.js' %}"></script>
+<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/secrets/secret_edit.html

@@ -70,5 +70,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/secrets.js' %}"></script>
+<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/secrets/secret_import.html

@@ -68,5 +68,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/secrets.js' %}"></script>
+<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}

+ 1 - 1
netbox/templates/users/userkey_edit.html

@@ -56,5 +56,5 @@
 {% endblock %}
 
 {% block javascript %}
-<script src="{% static 'js/secrets.js' %}"></script>
+<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
 {% endblock %}