changeset b0f2a6c265fd in www.tryton.org:default
details: https://hg.tryton.org/www.tryton.org?cmd=changeset&node=b0f2a6c265fd
description:
        Use CDN timestamp for icons SVG
diffstat:

 app.py               |  5 +++++
 templates/utils.html |  2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 30748267c262 -r b0f2a6c265fd app.py
--- a/app.py    Sat Apr 30 11:06:45 2022 +0200
+++ b/app.py    Sat Apr 30 12:54:03 2022 +0200
@@ -762,6 +762,11 @@
     return urlparse(url).hostname
 
 
[email protected]_filter('url_local')
+def url_local(url):
+    return urlparse(url)._replace(scheme='', netloc='').geturl()
+
+
 @cache.memoize(timeout=60 * 60 * 24)
 def fetch_donators():
     headers = {'Content-Type': 'application/json'}
diff -r 30748267c262 -r b0f2a6c265fd templates/utils.html
--- a/templates/utils.html      Sat Apr 30 11:06:45 2022 +0200
+++ b/templates/utils.html      Sat Apr 30 12:54:03 2022 +0200
@@ -55,5 +55,5 @@
 {% endmacro %}
 
 {% macro icon(name, width=16, height=None) %}<svg class="icon" width="{{ width 
}}" height="{{ height or width }}">
-    <use href="/static/images/icons.svg#{{ name }}"></use>
+    <use href="{{ url_for('static', filename='images/icons.svg')|url_local 
}}#{{ name }}"></use>
 </svg>{% endmacro %}

Reply via email to