Changeset - 1ade31ac2528
[Not reviewed]
default
0 3 1
Dennis Fink - 11 years ago 2014-09-13 18:12:42
dennis.fink@c3l.lu
Added bridge program
4 files changed with 47 insertions and 3 deletions:
0 comments (0 inline, 0 general)
ennstatus/root/views.py
Show inline comments
 
@@ -6,48 +6,53 @@ from ennstatus.root.constants import BPM
 

	
 
root_page = Blueprint('root', __name__)
 

	
 

	
 
@root_page.route('/')
 
def index():
 
    return render_template('root/index.html')
 

	
 

	
 
@root_page.route('/about')
 
def about():
 
    return render_template('root/about.html')
 

	
 

	
 
@root_page.route('/services')
 
def services():
 
    return render_template('root/services.html')
 

	
 

	
 
@root_page.route('/partners')
 
def partners():
 
    return render_template('root/partners.html')
 

	
 

	
 
@root_page.route('/bridgeprogram')
 
def bridgeprogram():
 
    return render_template('root/bridgeprogram.html')
 

	
 

	
 
@root_page.route('/contact', methods=('GET', 'POST'))
 
def contact():
 

	
 
    current_app.logger.info('Handling contact')
 
    form = BPMForm()
 
    country_choices = [choice[0] for choice in form.country.choices]
 

	
 
    if request.method == 'POST':
 
        current_app.logger.debug('Validating form')
 
        if form.validate_on_submit():
 
            country = form.country.data
 
            return redirect(url_for('root.contact', country=country))
 
    else:
 
        if 'country' in request.args:
 
            country = request.args['country']
 
            if country in country_choices:
 
                current_app.logger.info('Showing country %s' % country)
 
            else:
 
                current_app.logger.warn('Country %s not found' % country)
 
                country = 'luxembourg'
 
        else:
 
            current_app.logger.info('Using default country')
 
            country = 'luxembourg'
 

	
ennstatus/templates/base.html
Show inline comments
 
@@ -35,50 +35,54 @@
 
          <a href="http://wiki.enn.lu/doku.php?id=news">News</a>
 
        </li>
 
        <li>
 
          <a href="{{ url_for('root.about') }}">About</a>
 
        </li>
 
        <li>
 
          <a href="{{ url_for('root.services') }}">Services</a>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Donate <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('donate.index') }}">Support us</a></li>
 
            <li><a href="{{ url_for('donate.wiretransfer') }}">Wiretransfer</a></li>
 
            <li><a href="{{ url_for('donate.snailmail') }}">Snailmail</a></li>
 
            <li><a href="{{ url_for('donate.paypal') }}">PayPal</a></li>
 
            <li><a href="{{ url_for('donate.bitcoin') }}">Bitcoin</a></li>
 
            <li><a href="{{ url_for('donate.litecoin') }}">Litecoin</a></li>
 
            <li><a href="{{ url_for('donate.namecoin') }}">Namecoin</a></li>
 
            <li><a href="{{ url_for('donate.flattr') }}">Flattr</a></li>
 
            <li><a href="{{ url_for('donate.bpm') }}">BPM</a></li>
 
            <li class="divider"></li>
 
            <li><a href="{{ url_for('donate.received') }}">Received Donations</a></li>
 
          </ul>
 
        </li>
 
        <li>
 
          <a href="{{ url_for('root.partners') }}">Partners</a>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Partners <b class="caret"></b/></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('root.partners') }}">Official Partners</a></li>
 
            <li><a href="{{ url_for('root.bridgeprogram') }}">Bridge Program</a></li>
 
          </ul>
 
        </li>
 
        <li>
 
          <a href="{{ url_for('root.contact') }}">Contact</a>
 
        </li>
 
        <li>
 
          <a href="{{ url_for('root.abuse') }}">Abuse</a>
 
        </li>
 
        <li>
 
          <a href="http://wiki.enn.lu">Wiki</a>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Servers <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('status.index') }}">All nodes</a></li>
 
            <li><a href="{{ url_for('status.exit') }}">Exit nodes</a></li>
 
            <li><a href="{{ url_for('status.relay') }}">Relay nodes</a></li>
 
            <li><a href="{{ url_for('status.bridge') }}">Bridge nodes</a></li>
 
            <li class="divider"></li>
 
            <li><a href="{{ url_for('status.about') }}">Ënnstatus About</a></li>
 
          </ul>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistics <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
ennstatus/templates/root/bridgeprogram.html
Show inline comments
 
new file 100644
 
{% extends "base.html" %}
 

	
 
{% set title = "Bridge Program" %}
 

	
 
{% block content %}
 
  <div class="col-md-4 text-center">
 
    <img src="{{ url_for('static', filename='images/Partners.png') }}" class="img-rounded" alt="Partners" width="160"></img>
 
    <h3>Bridge Program</h3>
 
  </div>
 
  <div class="col-md-8">
 
    <blockquote>
 
      <p><em>United we stand, devided we fall.</em></p>
 
      <small>Aesop, <cite title="Source Title">The Four Oxen and the Lion</cite></small>
 
    </blockquote>
 

	
 
    <h3>About</h3>
 
    <p>We are happy to announce our new partner program which allows you to support the TOR network by funding a TOR bridge. Rather than making a single donation which we would use to cover our expenses for our different projects and administrative charges, you can now fund a TOR bridge on your own.
 
    Bridges are an important element in the TOR network because they allow people to use the network even if the direct acces to its entry-nodes is blocked in their country. This is mainly the case for people living under oppressive regimes.</p>
 
    <p>With a recurring contribution of 3 EUR/month (duration min. 12 months) you can help us keep such a bridge up and running. The servers for this project are located in Luxembourg.</p>
 

	
 
    <h3>How to participate?</h3>
 
    <p>Interested? Our <a href="http://wiki.enn.lu/doku.php?id=user:kahpa">bridge operator</a> will give you further information about the project.</p>
 
    <p>Get in touch: Write to <a href="mailto:bridges@enn.lu">bridges@enn.lu</a> GPG: 0x...... (DE, EN, LB, FR)</p>
 

	
 
    <h3>Interaction</h3>
 
    <p>As a partner in our project you can choose the nickname of your bridge and follow it on <a href="{{ url_for('status.index') }}">Ënnstatus</a>, our self-made information-panel.</p>
 
    <p>You want to know more about our work? Our staff is always happy to answer your questions, don't hestitate to <a href="{{ url_for('root.contact') }}">contact us.</a></p>
 
  </div>
 
{% endblock %}
ennstatus/templates/status/macros.html
Show inline comments
 
@@ -32,49 +32,55 @@
 
  <a href="http://globe.enn.lu/#/{{ url_type }}/{{ fingerprint }}">{{ fingerprint|upper}}</a>
 
{% endmacro %}
 

	
 
{% macro create_name(name) %}
 
  <a href="http://{{ name|lower }}.enn.lu">{{ name }}</a>
 
{% endmacro %}
 

	
 
{% macro create_server_table(server_type, servers) %}
 
  {% if server_type in ('Exit', 'Relay') %}
 
    {% set headers = ('#', 'Name', 'IP', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'Last Updated (UTC)') %}
 
  {% else %}
 
    {% set headers = ('#', 'Name', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'OBFS', 'FTEProxy', 'Flashproxy', 'meek', 'Last Updated (UTC)') %}
 
  {% endif %}
 
  <h2>{{ server_type }}</h2>
 
  <table class="table table-bordered table-striped">
 
    <thead>
 
      <tr>
 
        {% for name in headers %}
 
          <th>{{ name }}</th>
 
        {% endfor %}
 
      </tr>
 
    </thead>
 
    <tbody>
 
      {% for server in servers %}
 
        <tr>
 
      <tr {% if server['server_name'] in config['ENNSTATUS_BRIDGE_PROGRAM'] %}class="info"{% endif %}>
 
          <td>{{ loop.index }}</td>
 
          {% if server_type in ('Exit', 'Relay') %}
 
            <td>{{ create_name(server['server_name']) }}</td>
 
            <td>{{ server['ip'] }}</td>
 
          {% else %}
 
            <td>{{ server['server_name'] }}</td>
 
          {% endif %}
 
          {% for status in (server['server_status'], server['tor_status']) %}
 
            <td>{{ colorize_status(status) }}</td>
 
          {% endfor %}
 
          <td>{{ create_country(server['country']) }}</td>
 
          <td>{{ create_fingerprint(server['fingerprint'], server['server_type']) }}</td>
 
          {% if server_type == 'Bridge' %}
 
            <td>{{ colorize_obfs(server['obfs']) }}</td>
 
            <td>{{ colorize_obfs(server['fteproxy']) }}</td>
 
            <td>{{ colorize_obfs(server['flashproxy']) }}</td>
 
            <td>{{ colorize_obfs(server['meek']) }}</td>
 
          {% endif %}
 
          <td>{{ server['last_updated'] }}</td>
 
        </tr>
 
      {% endfor %}
 
    </tbody>
 
  </table>
 
  {% if server_type == 'Bridge' %}
 
    <div class="alert alert-info alert-dismissible" role="alert">
 
      <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
 
      <p>See our <a class="alert-link" href="{{ url_for('root.bridgeprogram') }}">bridge program</a>, if you want to fund some bridges!</p>
 
    </div>
 
  {% endif %}
 
{% endmacro %}
0 comments (0 inline, 0 general)