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)

View File

@ -0,0 +1,62 @@
{% extends "global/layout.html" %}
{% block title %}{{ _('The I2P Browser') }}{% endblock %}
{% block content_nav %}
<ol>
<li style="list-style: none; display: inline">
<h4>{{ _('General') }}</h4>
</li>
<li>{% trans intro=get_url('browser_intro') %}<a href="{{ intro }}">Introduction</a>{% endtrans %}</li>
<li>{% trans download=get_url('browser_download') %}<a href="{{ download }}">The downloads</a>{% endtrans %}</li>
<li>{% trans faq=get_url('browser_faq') %}<a href="{{ faq }}">I2P Browser FAQ</a>{% endtrans %}</li>
</ol>
{% endblock %}
{% macro browser_download(name, icon, dlink) -%}
<div class="browser-front-download">
<div class="download-details">
<img class="browser-clip-circle" src="{{ url_for('static', filename=icon) }}" alt="{{ name }}" title="{{ name }}" />
<a class="get-i2p-browser" href="{{ dlink }}">{{ caller() }}</a>
{% trans download=get_url('browser_download') %}<a href="{{ download }}">Click here to download I2P Browser in another language or platform</a>{% endtrans %}
</div>
</div>
{%- endmacro %}
{% block content %}
<div class="browser-front-wrapper">
<h1>{% trans %}Protect and defend yourself.{% endtrans %}</h1>
{%- if detected_os == 'windows' -%}
{%- set name = 'Windows' -%}
{%- set icon = 'images/download/windows.png' -%}
{%- set link = 'https://download.i2p2.de/experimental/i2pbrowser-beta4/windows64/i2pbrowser-install-win64-2.0-beta4_en-US.exe' -%}
{% call browser_download(name, icon, link) %}
Download I2P Browser for Windows
{% endcall %}
{%- elif detected_os == 'macosx' -%}
{%- set name = 'Mac OS X' -%}
{%- set icon = 'images/download/mac-osx.png' -%}
{%- set link = 'https://download.i2p2.de/experimental/i2pbrowser-beta4/macosx64/I2PBrowser-2.0-beta4-osx64_en-US.dmg' -%}
{% call browser_download(name, icon, link) %}
Download I2P Browser for Mac OS X
{% endcall %}
{%- elif detected_os == 'linux' -%}
{%- set name = 'Linux' -%}
{%- set icon = 'images/download/freebsd-tux.png' -%}
{%- set link = 'https://download.i2p2.de/experimental/i2pbrowser-beta4/linux64/i2p-browser-linux64-2.0-beta4_en-US.tar.xz' -%}
{% call browser_download(name, icon, link) %}
Download I2P Browser for Linux x64
{% endcall %}
{%- endif -%}
</div>
{% endblock %}

View File

@ -1,11 +1,28 @@
{% extends "global/layout.html" %}
{%- from "downloads/macros" import package_outer with context -%}
{% block title %}I2P Lab{% endblock %}
{% block title %}I2P Browser downloads{% endblock %}
{% block content_nav %}
<ol>
<li style="list-style: none; display: inline">
<h4>{{ _('Variants') }}</h4>
</li>
<li><a href="#windows">{% trans %}Windows{% endtrans %}</a></li>
<li><a href="#macosx">{% trans %}Mac OS X{% endtrans %}</a></li>
<li><a href="#linux">{% trans %}Linux{% endtrans %}</a></li>
</ol>
{% endblock %}
{% block content %}
<section id="download">
<h1>{{ _('I2P Browser download page') }}</h1>
<i>{% trans browser_main=get_url('browser_frontpage') %}<a href="{{ browser_main }}">Back to browser front page</a>{% endtrans %}</i>
<p>{% trans -%}
The Invisible Internet browser is a fork of TorBrowser/Mozilla Firefox ESR that comes preconfigured with proxy
settings, NoScript and i2pbutton which contains some security/privacy improvements like a drag and drop filter and
@ -34,6 +51,7 @@
{%- set hash = '65a2f84a7dca9d000e359dc1cd5168555f363a29a837fadbbf9fff58c8b7bad9' -%}
{% call package_outer('windows', name, icon) %}
<div class="file">
<h3 id="windows">Windows</h3>
<a class="default"
href="https://download.i2p2.de/experimental/i2pbrowser-beta4/windows64/i2pbrowser-install-win64-2.0-beta4_en-US.exe">
<span class="name">{{ filename }}</span>
@ -59,6 +77,7 @@
{%- set hash = '95dff56f2443920f027a9a649793f67a37db55850980035956d7dcaad95f0d93' -%}
{% call package_outer('mac-osx', name, icon) %}
<div class="file">
<h3 id="macosx">Mac OS X</h3>
<a class="default"
href="https://download.i2p2.de/experimental/i2pbrowser-beta4/macosx64/I2PBrowser-2.0-beta4-osx64_en-US.dmg">
<span class="name">{{ filename }}</span>
@ -84,6 +103,7 @@
{%- set hash = 'da772ebe03937b09915f9016d9c09b64666025b4ae4c9353861dcf40d916ca7d' -%}
{% call package_outer('freebsd-tux', name, icon) %}
<div class="file">
<h3 id="linux">Linux</h3>
<a class="default"
href="https://download.i2p2.de/experimental/i2pbrowser-beta4/linux64/i2p-browser-linux64-2.0-beta4_en-US.tar.xz">
<span class="name">{{ filename }}</span>

View File

@ -3,7 +3,7 @@
{% block content_nav %}
<ol>
<li style="list-style: none; display: inline">
<h4>{{ _('General') }}</h4>
<h4>{{ _('Browser FAQs') }}</h4>
</li>
<li><a href="#what">{% trans %}What is it and how does it work?{% endtrans %}</a></li>
<li><a href="#why">{% trans %}Why did we make it?{% endtrans %}</a></li>
@ -17,7 +17,11 @@
{% block content %}
<h2>General</h2>
<h2>Browser FAQs</h2>
<i>{% trans browser_main=get_url('browser_frontpage') %}<a href="{{ browser_main }}">Back to browser front page</a>{% endtrans %}</i>
<h3 id="what">
<span class="permalink">
<a href="#what">{% trans %}What is it and how does it work?{% endtrans %}</a>
@ -27,19 +31,23 @@
<p>{% trans %}Its a web browser, like all others it enables you to browse and search the web. I2P Browser is however
very focused on the privacy rights of the user and does not favour a companys income in trade of the users privacy.
As of the writing moment I2P browser is made to work with I2P, but with some adjustments it should just as well work
with Tor or on the internet.{% endtrans %}</p>
with Tor or on the internet.{% endtrans %}
</p>
<p>{% trans %}When you connect to a website, it is not only the operators of that website who can record information
about your visit.{% endtrans %}</p>
about your visit.{% endtrans %}
</p>
<p>{% trans %}Most websites now use numerous third-party services, including social networking “Like” buttons,
analytics trackers, and advertising beacons, all of which can link your activity across different sites. And because
of that, the I2P Browser is designed to prevent websites from “fingerprinting” or identifying you based on your
browser configuration. By default, I2P Browser does not keep any browsing history. Cookies are only valid for a single
session (until I2P Browser is exited or a New Identity is requested).{% endtrans %}</p>
analytics trackers, and advertising beacons, all of which can link your activity across different sites. And because
of that, the I2P Browser is designed to prevent websites from “fingerprinting” or identifying you based on your
browser configuration. By default, I2P Browser does not keep any browsing history. Cookies are only valid for a single
session (until I2P Browser is exited or a New Identity is requested).{% endtrans %}
</p>
<p>{% trans %}A key feature is that I2P Browser will block browser plugins such as Flash, RealPlayer, Quicktime,
and others: they can be manipulated into revealing your IP address. We do not recommend installing additional
add-ons or plugins into I2P Browser even the user is free to do so. Plugins or addons may bypass I2P or compromise
your privacy. I2P Browser already comes with NoScript, and other patches to protect your privacy and security.{% endtrans %}</p>
your privacy. I2P Browser already comes with NoScript, and other patches to protect your privacy and security.{% endtrans %}
</p>
<h3 id="why">
@ -52,6 +60,8 @@ session (until I2P Browser is exited or a New Identity is requested).{% endtrans
the street to get himself into this and figure out how to benefit from it. The I2P Browser was therefore made to
extend the user base of I2P to non-super technical people and make it a worthy alternative to Tor.{%- endtrans %}</p>
<p>{% trans %}We wish to enable all people to defend themself against tracking and surveillance.
And for people in some countries, circumvent censorship.{% endtrans %}</p>
<h3 id="the-problem">
@ -94,8 +104,15 @@ session (until I2P Browser is exited or a New Identity is requested).{% endtrans
</span>
</h3>
<p>{% trans -%}For the moment its only on trac.i2p2.de - but we plan to start using mailing lists found at
https://lists.i2p.email/postorius/lists/ - Also found at http://lists.i2p inside i2p.{%- endtrans %}</p>
<p>{% trans -%}For the moment its only on trac - but we plan to start using mailing lists found at our mailing lists website:{%- endtrans %}&nbsp;
{%- if is_i2p_internal == True -%}
<a href="https://lists.i2p.email/">https://lists.i2p.email/</a>.
{% trans -%}Trac is located at:{%- endtrans %}&nbsp;<a href="https://trac.i2p2.de">https://trac.i2p2.de</a>.
{%- else -%}
<a href="http://lists.i2p/">http://lists.i2p/</a>.
{% trans -%}Trac is located at:{%- endtrans %}&nbsp;<a href="http://trac.i2p2.i2p">http://trac.i2p2.i2p</a>.
{%- endif -%}
</p>
<h3 id="funding">
@ -108,5 +125,7 @@ session (until I2P Browser is exited or a New Identity is requested).{% endtrans
donators to specify which parts of the I2P project they wish to fund, if its the router core, the console, the
browser or any other component that can be seen as a sub project of I2P.{%- endtrans %}</p>
<p>{% trans %}You can find our donation page <a href="/en/get-involved/donate">here</a>.{% endtrans %}</p>
{% endblock %}

View File

@ -11,6 +11,11 @@
{% block content %}
<h1>The I2P Browser Introduction</h1>
<i>{% trans browser_main=get_url('browser_frontpage') %}<a href="{{ browser_main }}">Back to browser front page</a>{% endtrans %}</i>
TBA.
{% endblock %}

View File

@ -654,3 +654,45 @@ pre.literal-block {
#vrp ol ol ol {
list-style-type: lower-roman;
}
/**
*
* The Browser pages
*
**/
.get-i2p-browser {
display: block;
top: 50%;
padding: .5em;
line-height: 1em;
font-size: 2em;
color: white;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-transform: uppercase;
text-decoration: none;
text-align: center;
background: green;
border-radius: .3em;
text-shadow: 1px 1px 1px rgba(0,0,0,.2);
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 1em 3em 2em 0.5em rgba(255, 255, 255, 0.3) inset, inset -.2em -.5em 1em -0em rgba(0,0,0,.3);
}
.browser-front-wrapper {
text-align: center;
}
.browser-front-download {
display: inline-block;
}
.browser-clip-circle {
height: auto;
width: 30%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
}

View File

@ -76,6 +76,11 @@ url('/<lang:lang>/meetings/<int:id>.log', 'meetings.views.meetings_show_log')
url('/<lang:lang>/meetings/<int:id>.rst', 'meetings.views.meetings_show_rst')
url('/<lang:lang>/feed/meetings/atom', 'meetings.views.meetings_atom')
url('/<lang:lang>/browser', 'browser.browser_frontpage')
url('/<lang:lang>/browser/intro', 'browser.browser_intro')
url('/<lang:lang>/browser/faq', 'browser.browser_faq')
url('/<lang:lang>/browser/download', 'browser.browser_download')
url('/<lang:lang>/download', 'downloads.downloads_list')
url('/<lang:lang>/download/debian', 'downloads.downloads_debian')
url('/<lang:lang>/download/firefox', 'downloads.downloads_firefox')