forked from I2P_Developers/i2p.www
Moved ver() into templatevars so only need to change I2P version in one place
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{%- from "global/macros" import change_lang, ver with context -%}
|
{%- from "global/macros" import change_lang with context -%}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@@ -8,12 +8,6 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
||||||
{%- macro ver(string=None) -%}
|
|
||||||
{%- if string -%}{{ string % '0.9.4' }}
|
|
||||||
{%- else -%}{{ '0.9.4' }}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endmacro -%}
|
|
||||||
|
|
||||||
{%- macro render_pagination(pagination) %}
|
{%- macro render_pagination(pagination) %}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{%- if pagination.has_prev %}
|
{%- if pagination.has_prev %}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
from flask import g, request, url_for
|
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 = {
|
I2P_TO_CLEAR = {
|
||||||
'www.i2p2.i2p': 'www.i2p2.de',
|
'www.i2p2.i2p': 'www.i2p2.de',
|
||||||
@@ -79,10 +79,16 @@ def utility_processor():
|
|||||||
# Probably a 404 error page
|
# Probably a 404 error page
|
||||||
return url_for('main_index', **args)
|
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,
|
return dict(i2pconv=convert_url_to_clearnet,
|
||||||
url_for_other_page=url_for_other_page,
|
url_for_other_page=url_for_other_page,
|
||||||
change_theme=change_theme,
|
change_theme=change_theme,
|
||||||
site_url=get_site_url,
|
site_url=get_site_url,
|
||||||
get_url=get_url_with_lang,
|
get_url=get_url_with_lang,
|
||||||
get_flag=get_flag,
|
get_flag=get_flag,
|
||||||
|
ver=get_current_version,
|
||||||
canonical=get_canonical_link)
|
canonical=get_canonical_link)
|
||||||
|
Reference in New Issue
Block a user