Changeset - a1ae76f94c6f
[Not reviewed]
version_5
0 4 0
Dennis Fink - 10 years ago 2015-07-20 23:37:09
dennis.fink@c3l.lu
4 files changed with 5 insertions and 11 deletions:
0 comments (0 inline, 0 general)
ennstatus/root/forms.py
Show inline comments
 
@@ -25,29 +25,26 @@ class MembershipForm(Form):
 
    username = StringField('Username*',
 
                           validators=[
 
                               InputRequired('This field is required!'),
 
                               Length(max=255)
 
                           ]
 
                           )
 
    email = StringField('E-Mail*',
 
                        validators=[
 
                            InputRequired('This field is required!'),
 
                            Email()
 
                        ]
 
                        )
 
    firstname = StringField('First Name',
 
                            validators=[Length(max=255)],
 
                            )
 
    surname = StringField('Surname',
 
                          validators=[Length(max=255)],
 
    fullname = StringField('Full name',
 
                           validators=[Length(max=65536)],
 
                          )
 
    street = StringField('Nr., Street',
 
                         validators=[Length(max=4000)],
 
                         )
 
    zip = StringField('ZIP-Code',
 
                      validators=[Length(max=30)],
 
                      )
 
    city = StringField('City/Town',
 
                       validators=[Length(max=500)],
 
                       )
 
    country = StringField('Country',
 
                          validators=[Length(max=500)],
ennstatus/root/functions.py
Show inline comments
 
@@ -3,26 +3,25 @@ from flask import render_template, curre
 
from flask_mail import Mail, Message
 

	
 
from ennstatus.status.functions import mail
 

	
 

	
 
def send_membership_mail(form):
 
    try:
 
        body = render_template('root/membership_mail.txt',
 
                               username=form.username.data,
 
                               email=form.email.data,
 
                               membership=form.membership.data,
 
                               c3l=form.c3l.data,
 
                               firstname=form.firstname.data,
 
                               surname=form.surname.data,
 
                               fullname=form.fullname.data,
 
                               street=form.street.data,
 
                               zip=form.zip.data,
 
                               city=form.city.data,
 
                               country=form.country.data,
 
                               gpg=form.gpg.data
 
                               )
 

	
 
        recipients = current_app.config['ENNSTATUS_MEMBERSHIP_MAIL']
 
        with mail.connect() as conn:
 
            for recipient in recipients:
 
                msg = Message('New membership application', sender='ennstatus@enn.lu')
 
                msg.add_recipient(recipient)
ennstatus/templates/root/membership.html
Show inline comments
 
@@ -2,26 +2,25 @@
 

	
 
{% import 'bootstrap/wtf.html' as wtf %}
 

	
 
{% set title = 'Membership' %}
 

	
 
{% block content %}
 
  <div class="col-md-12">
 
    <h2>Register as member</h2>
 
    <form method="post" class="form form-horizontal" role="form">
 
      {{ form.hidden_tag() }}
 
      {{ wtf.form_field(form.username, form_type='horizontal') }}
 
      {{ wtf.form_field(form.email, form_type='horizontal') }}
 
      {{ wtf.form_field(form.firstname, form_type='horizontal') }}
 
      {{ wtf.form_field(form.surname, form_type='horizontal') }}
 
      {{ wtf.form_field(form.fullname, form_type='horizontal') }}
 
      {{ wtf.form_field(form.street, form_type='horizontal') }}
 
      {{ wtf.form_field(form.city, form_type='horizontal') }}
 
      {{ wtf.form_field(form.zip, form_type='horizontal') }}
 
      {{ wtf.form_field(form.country, form_type='horizontal') }}
 
      {{ wtf.form_field(form.gpg, form_type='horizontal') }}
 
      <div class="form-group {% if form.membership.errors %} has-error {% endif %} required">
 
        {{ form.membership.label(class_='control-label col-lg-2') }}
 
        <div class="col-lg-10">
 
        {% for field in form.membership %}
 
          <div class="radio">
 
            {{ field() }}
 
            <div class="btn-group">
ennstatus/templates/root/membership_mail.txt
Show inline comments
 
Hi,
 

	
 
We got a new membership application!
 

	
 
Username: {{ username }}
 
E-Mail: {{ email }}
 
Membership Plan: {{ membership }}
 
Double Membership: {{ c3l }}
 

	
 
Additional information:
 

	
 
First Name: {{ firstname }}
 
Surname: {{ surname }}
 
Full name: {{ fullname }}
 
Nr., Street: {{ street }}
 
ZIP-Code: {{ zip }}
 
City: {{ city }}
 
Country: {{ country }}
 
GPG-ID: {{ gpg }}
 

	
 
Sincerely,
 
Ennstatus
0 comments (0 inline, 0 general)