Changeset - 601aed05195d
[Not reviewed]
version_5
0 2 1
kahpa - 10 years ago 2015-10-07 21:48:38

added mirrors page
3 files changed with 29 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ennstatus/root/views.py
Show inline comments
 
@@ -7,88 +7,92 @@ from ennstatus.root.functions import sen
 

	
 
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('/member')
 
def member():
 
    return render_template('root/member.html')
 

	
 

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

	
 
    current_app.logger.info('Handling membership')
 
    form = MembershipForm()
 

	
 
    if request.method == 'POST':
 
        current_app.logger.debug('Validating form')
 
        if form.validate_on_submit():
 
            send_membership_mail(form)
 
            return redirect(url_for('root.member'))
 

	
 
    return render_template('root/membership.html', form=form)
 

	
 
@root_page.route('/mirrors')
 
def mirrors():
 
    return render_template('root/mirrors.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'
 

	
 
    form.country.data = country
 

	
 
    address = BPM_ADDRESSES[country]
 

	
 
    return render_template('root/contact.html', form=form, address=address)
 

	
 

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

	
 

	
 
@root_page.route('/disclaimer')
 
def disclaimer():
 
    return render_template('root/disclaimer.html')
ennstatus/templates/base.html
Show inline comments
 
@@ -8,97 +8,97 @@
 

	
 
{% block metas %}
 
  {{ super() }}
 
  <meta charset="utf-8">
 
  <meta name="application-name" content="Ënnstatus">
 
  <meta name="author" content="Frënn vun der Ënn">
 
{% endblock %}
 

	
 
{% block styles %}
 
  {{ super() }}
 
  <link rel="stylesheet" href="{{ url_for('static', filename='css/ennstatus.css') }}" />
 
  <link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.png') }}">
 
{% endblock %}
 

	
 
{% block body %}
 
<a href="#content" class="sr-only">Skip to main content</a>
 
<div class="container">
 
  {% block navbar %}
 
  <div class="navbar navbar-default">
 
    <div class="navbar-header">
 
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
 
        <span class="icon-bar"></span>
 
        <span class="icon-bar"></span>
 
        <span class="icon-bar"></span>
 
      </button>
 
      <img class="navbar-brand" src="{{ url_for('static', filename='images/logo/FVDE_logo_thumbnail.png') }}"></img>
 
      <a class="navbar-brand" href="{{ url_for('root.index') }}">Enn.lu</a>
 
    </div>
 
    <div class="navbar-collapse collapse">
 
      <ul class="nav navbar-nav">
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">About <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('root.about') }}">Organization</a></li>
 
            <li><a>Activities</a></li>
 
            <li><a href="{{ url_for('root.partners') }}">Partners</a></li>
 
          </ul>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Services <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li class="dropdown-submenu">
 
              <a>Tor Servers</a>
 
              <ul class="dropdown-menu">
 
                <li><a href="{{ url_for('status.index') }}">Ennstatus Panel</a></li>
 
                <li><a>Statistics</a></li>
 
              </ul>
 
            </li>
 
            <li><a>Mirrors</a></li>
 
            <li><a href="{{ url_for('root.mirrors') }}">Mirrors</a></li>
 
            <li><a href="https://wiki.enn.lu">Wiki</a></li>
 
            <li><a>About Ennstatus</a></li>
 
          </ul>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Support <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('donate.index') }}">Donate</a></li>
 
            <li><a href="{{ url_for('root.member') }}">Join us</a></li>
 
            <li class="dropdown-submenu">
 
              <a>Special programs</a>
 
              <ul class="dropdown-menu">
 
                <li><a href="{{ url_for('root.bridgeprogram')}}">Bridge program</a></li>
 
              </ul>
 
            </li>
 
          </ul>
 
        </li>
 
        <li class="dropdown">
 
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contact <b class="caret"></b></a>
 
          <ul class="dropdown-menu">
 
            <li><a href="{{ url_for('root.contact') }}">General</a></li>
 
            <li><a href="{{ url_for('root.abuse') }}">Abuse</a></li>
 
          </ul>
 
        </li>
 
      </ul>
 
    </div>
 
  </div>
 
  {% endblock %}
 
  <div class="row" id="content">
 
  {% with messages = get_flashed_messages(with_categories=True) %}
 
    {% if messages %}
 
      <div class="col-md-12">
 
        {% for category, message in messages %}
 
          {{ base_macros.display_error(category, message) }}
 
        {% endfor %}
 
      </div>
 
    {% endif %}
 
  {% endwith %}
 
  {% block content %}
 
  {% endblock %}
 
  </div>
 
  <footer>
 
    <hr style="margin-bottom: 0.5%;">
 
    <div class="col-md-12 text-center">
 
      <a class="pull-left" href="https://twitter.com/FrennVunDerEnn">@FrennVunDerEnn</a>
 
      <address><strong>Frënn vun der Enn a.s.b.l.</strong>  <em>(R.C.S. Luxembourg F 9.478)</em>
 
      <a class="pull-right" rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US">CC-BY-NC-SA</a></address>
 
    </div>
ennstatus/templates/root/mirrors.html
Show inline comments
 
new file 100644
 
{% extends "base.html" %}
 

	
 
{% set title = "Partners" %}
 

	
 
{% block content %}
 
  <div class="col-md-4 text-center">
 
    <img src="{{ url_for('static', filename='images/Services.png') }}" class="img-rounded" alt="Partners" width="160"></img>
 
    <h3>Mirrors</h3>
 
  </div>
 
  <div class="col-md-8">
 
    <h2>Mirrors</h2>
 
    <p class="lead">In addition to our Tor relays we are providing mirrors for some popular services.</p>
 
    <dl>
 
      <dt><a href="http://torproject.lu" target="_blank">torproject.lu</a></dt>
 
      <dd>This is a mirror of the the Tor Project's main website torproject.org</dd>
 
      <br>
 
      <dt><a href="http://tails.c3l.lu/" target="_blank">tails.enn.lu</a></dt>
 
      <dd>A Tails Download mirror. Tails is a live operating system, that you can start on almost any computer from a DVD, USB stick, or SD card. It aims at preserving your privacy and anonymity. <a href="https://tails.boum.org/" target="blank">Learn more about Tails</a></dd>
 
      <br>
 
      <dt><a href="https://globe.enn.lu/" target="_blank">globe.enn.lu</a></dt>
 
      <dd>Globe is a Tor relay and bridge explorer.</dd>
 
    </dl>
 
  </div>
 
{% endblock %}
0 comments (0 inline, 0 general)