Major updates for browser pages. Added new macros and python module for the pages.
This commit is contained in:
28
i2p2www/browser.py
Normal file
28
i2p2www/browser.py
Normal 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)
|
||||
|
||||
|
Reference in New Issue
Block a user