diff --git a/ennstatus/donate/views.py b/ennstatus/donate/views.py --- a/ennstatus/donate/views.py +++ b/ennstatus/donate/views.py @@ -22,40 +22,12 @@ from babel.numbers import parse_decimal, from ennstatus.donate.forms import DateForm from ennstatus.donate.functions import load_csv, get_choices -from ennstatus.root.forms import BPMForm -from ennstatus.root.constants import BPM_ADDRESSES - donate_page = Blueprint('donate', __name__) -@donate_page.route('/', methods=('GET', 'POST')) +@donate_page.route('/') def index(): - - current_app.logger.info('Handling index') - 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('donate.index', 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('donate/index.html', form=form, address=address) + return render_template('donate/index.html') @donate_page.route('/received', diff --git a/ennstatus/root/constants.py b/ennstatus/root/constants.py deleted file mode 100644 --- a/ennstatus/root/constants.py +++ /dev/null @@ -1,43 +0,0 @@ -# Ënnstatus -# Copyright (C) 2015 Dennis Fink -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -BPM_ADDRESSES = { - 'germany': { - 'address': 'Zum Bürgerwehr 28', - 'postal_code': 'D-54516', - 'city': 'Wittlich', - 'country': 'Germany', - }, - 'belgium': { - 'address': '3, Rue des Deux Luxembourg', - 'postal_code': 'B-6791', - 'city': 'Athus', - 'country': 'Belgium', - }, - 'france': { - 'address': 'Les Maragolles', - 'postal_code': 'F-54720', - 'city': 'Lexy', - 'country': 'France', - }, - 'luxembourg': { - 'address': '34, Rue Gabriel Lippmann', - 'postal_code': 'L-5365', - 'city': 'Munsbach', - 'country': 'Luxembourg', - }, -} diff --git a/ennstatus/root/forms.py b/ennstatus/root/forms.py --- a/ennstatus/root/forms.py +++ b/ennstatus/root/forms.py @@ -15,28 +15,12 @@ # along with this program. If not, see . from flask_wtf import Form -from wtforms import (SelectField, - StringField, +from wtforms import (StringField, RadioField, BooleanField, SubmitField ) -from wtforms.validators import InputRequired, Email, Length, DataRequired - - -COUNTRIES = [ - ('luxembourg', 'Luxembourg'), - ('belgium', 'Belgium'), - ('france', 'France'), - ('germany', 'Germany'), -] - - -class BPMForm(Form): - country = SelectField('Country', - validators=[DataRequired()], - choices=COUNTRIES) - submit = SubmitField('Submit') +from wtforms.validators import InputRequired, Email, Length class MembershipForm(Form): diff --git a/ennstatus/root/views.py b/ennstatus/root/views.py --- a/ennstatus/root/views.py +++ b/ennstatus/root/views.py @@ -17,8 +17,7 @@ from flask import (Blueprint, render_template, current_app, request, redirect, url_for, flash) -from ennstatus.root.forms import BPMForm, MembershipForm, BridgeprogramForm -from ennstatus.root.constants import BPM_ADDRESSES +from ennstatus.root.forms import MembershipForm, BridgeprogramForm from ennstatus.root.functions import (send_membership_mail, send_bridgeprogram_mail) @@ -80,35 +79,9 @@ def mirrors(): return render_template('root/mirrors.html') -@root_page.route('/contact', methods=('GET', 'POST')) +@root_page.route('/contact') 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) + return render_template('root/contact.html') @root_page.route('/abuse') diff --git a/ennstatus/templates/donate/index.html b/ennstatus/templates/donate/index.html --- a/ennstatus/templates/donate/index.html +++ b/ennstatus/templates/donate/index.html @@ -83,21 +83,11 @@

SnailMail

-
-
- {{ form.hidden_tag() }} -
- {{ form.country(class_='form-control input-sm', onchange='this.form.submit()') }} - -
-
-
-
+
Frënn vun der Ënn, ASBL
- BPM 381892
- {{ address['address'] }}
- {{ address['postal_code'] }}, {{ address['city'] }}
- {{ address['country'] }} + {{ config['ENNSTATUS_ADDRESS'] }}
+ {{ config['ENNSTATUS_POSTAL_CODE'] }}, {{ config['ENNSTATUS_CITY'] }}
+ {{ config['ENNSTATUS_COUNTRY'] }}
@@ -204,13 +194,12 @@
-

BPM Points

+

Patreon

-

For our parcel station and international mail boxes.

-

- Send your BPM voucher code to:
- : info@enn.lu GPG: 0x02225522 -

+

Support us!

+ + Patreon +
diff --git a/ennstatus/templates/root/contact.html b/ennstatus/templates/root/contact.html --- a/ennstatus/templates/root/contact.html +++ b/ennstatus/templates/root/contact.html @@ -26,26 +26,14 @@

Contact

-
-

General

-
-
- {{ form.hidden_tag()}} -
- {{ form.country(class_='form-control input-sm', onchange='this.form.submit()') }} - -
-
-
-
+

General

Please mail all general inquiries to:

Frënn vun der Ënn, ASBL
- BPM 381892
- {{ address['address'] }}
- {{ address['postal_code'] }}, {{ address['city'] }}
- {{ address['country'] }}
+ {{ config['ENNSTATUS_ADDRESS'] }}
+ {{ config['ENNSTATUS_POSTAL_CODE'] }}, {{ config['ENNSTATUS_CITY'] }}
+ {{ config['ENNSTATUS_COUNTRY'] }}

: info@enn.lu GPG: 0x02225522
: enn.lu/ or {{ config['ENNSTATUS_ONION_ADDRESS'] }}
diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def _get_requirements(): setup(name='Ennstatus', - version='5.4.7-dev', + version='5.5.0', description=('Ennstatus provides the user with vital information about ' 'the status of the organizations Tor servers.'), author='Frënn vun der Ënn',