diff --git a/i2p2www/pages/global/layout.html b/i2p2www/pages/global/layout.html index b6d01ae6257d21ac21936cf349c01860da40c4f2..3d375aa3142f00e4d4fb8687d25c9f065c29b834 100644 --- a/i2p2www/pages/global/layout.html +++ b/i2p2www/pages/global/layout.html @@ -1,4 +1,4 @@ -{%- from "global/macros" import change_lang, ver with context -%} +{%- from "global/macros" import change_lang with context -%} <!DOCTYPE html> <html lang="en"> <head> diff --git a/i2p2www/pages/global/macros b/i2p2www/pages/global/macros index 074b2b7b01bcb0324f23ed06e0e65f35c2a11f2f..1d709ff0933f2f1f64ecd9496a41aebdb8614998 100644 --- a/i2p2www/pages/global/macros +++ b/i2p2www/pages/global/macros @@ -8,12 +8,6 @@ {%- endif -%} {%- endmacro -%} -{%- macro ver(string=None) -%} -{%- if string -%}{{ string % '0.9.4' }} -{%- else -%}{{ '0.9.4' }} -{%- endif -%} -{%- endmacro -%} - {%- macro render_pagination(pagination) %} <div class="pagination"> {%- if pagination.has_prev %} diff --git a/i2p2www/templatevars.py b/i2p2www/templatevars.py index 3790f50551f0dc2459e789f1bb2cefd52a2d4e65..cef67d246ada75e362530b459c8c3f435042ced8 100644 --- a/i2p2www/templatevars.py +++ b/i2p2www/templatevars.py @@ -1,6 +1,6 @@ from flask import g, request, url_for -from i2p2www import CANONICAL_DOMAIN, app +from i2p2www import CANONICAL_DOMAIN, CURRENT_I2P_VERSION, app I2P_TO_CLEAR = { 'www.i2p2.i2p': 'www.i2p2.de', @@ -79,10 +79,16 @@ def utility_processor(): # Probably a 404 error page return url_for('main_index', **args) + def get_current_version(string=None): + if string: + return string % CURRENT_I2P_VERSION + return CURRENT_I2P_VERSION + return dict(i2pconv=convert_url_to_clearnet, url_for_other_page=url_for_other_page, change_theme=change_theme, site_url=get_site_url, get_url=get_url_with_lang, get_flag=get_flag, + ver=get_current_version, canonical=get_canonical_link)