diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -118,7 +118,8 @@ def asset(path, ver=None): :param ver: optional version query param to append as ?ver= """ request = get_current_request() - return request.static_url('rhodecode:public/{}'.format(path), ver=ver) + return request.static_url( + 'rhodecode:public/{}'.format(path), _query={'ver': ver}) def html_escape(text, html_escape_table=None): diff --git a/rhodecode/templates/base/root.html b/rhodecode/templates/base/root.html --- a/rhodecode/templates/base/root.html +++ b/rhodecode/templates/base/root.html @@ -85,8 +85,8 @@ c.template_context['visual']['default_re - ## avoide esaping the %N - + ## avoide escaping the %N + ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates diff --git a/rhodecode/templates/debug_style/code-block.html b/rhodecode/templates/debug_style/code-block.html --- a/rhodecode/templates/debug_style/code-block.html +++ b/rhodecode/templates/debug_style/code-block.html @@ -9,11 +9,11 @@ <%def name="js_extra()"> - + <%def name="css_extra()"> - + diff --git a/rhodecode/templates/errors/error_document.html b/rhodecode/templates/errors/error_document.html --- a/rhodecode/templates/errors/error_document.html +++ b/rhodecode/templates/errors/error_document.html @@ -13,13 +13,13 @@ %endif - + - + <%include file="/base/flash_msg.html"/> diff --git a/rhodecode/tests/functional/test_home.py b/rhodecode/tests/functional/test_home.py --- a/rhodecode/tests/functional/test_home.py +++ b/rhodecode/tests/functional/test_home.py @@ -22,6 +22,7 @@ import json from mock import patch import pytest +from pylons import tmpl_context as c import rhodecode from rhodecode.lib.utils import map_groups @@ -49,6 +50,14 @@ class TestHomeController(TestController) for repo in Repository.getAll(): response.mustcontain('"name_raw": "%s"' % repo.repo_name) + def test_index_contains_statics_with_ver(self): + self.log_user() + response = self.app.get(url(controller='home', action='index')) + + rhodecode_version_hash = c.rhodecode_version_hash + response.mustcontain('style.css?ver={0}'.format(rhodecode_version_hash)) + response.mustcontain('scripts.js?ver={0}'.format(rhodecode_version_hash)) + def test_index_contains_backend_specific_details(self, backend): self.log_user() response = self.app.get(url(controller='home', action='index'))