Major updates for browser pages. Added new macros and python module for the pages.

This commit is contained in:
meeh
2019-07-20 02:02:08 +00:00
parent c65c88a0e7
commit 5331f45936
7 changed files with 193 additions and 12 deletions

28
i2p2www/browser.py Normal file
View File

@ -0,0 +1,28 @@
from flask import redirect, render_template, request
from i2p2www import CURRENT_I2P_VERSION, MIRRORS_FILE
def browser_frontpage():
useragent = request.headers.get('User-Agent')
osname = "unknown"
if 'Mac' in useragent:
osname = "macosx"
elif 'Win' in useragent:
osname = "windows"
elif 'Linux' in useragent:
osname = "linux"
return render_template('site/browser/_front.html', user_agent=useragent, detected_os=osname)
def browser_intro():
return render_template('site/browser/intro.html')
def browser_download():
return render_template('site/browser/download.html')
def browser_faq():
if request.headers.get('X-I2P-Desthash') and not request.headers.get('X-Forwarded-Server'):
show_i2p_links = True
else:
show_i2p_links = False
return render_template('site/browser/faq.html', is_i2p_internal=show_i2p_links)