Ejemplo n.º 1
0
def contato_doacao(ong, slug):
    user = g.user
    form = LoginForm()
    form_contato = ContatoForm()
    ong = Ong.query.filter_by(nickname=ong).first_or_404()
    doacao = Doacao.query.filter_by(ong=ong, slug=slug).first_or_404()
    if form.validate_on_submit():
        ong = Ong.query.filter_by(nickname=form.login.data,
                                  senha=md5(form.senha_login.data).hexdigest()
                                  ).first_or_404()
        login_user(ong)
        return redirect(request.args.get('next') or
                        url_for('ong_dashboard', ong=ong.nickname))
    if form_contato.validate_on_submit():
        contact_email('[Pra Quem Doar] ' + doacao.nome,
                      form_contato.nome.data,
                      form_contato.email.data,
                      form_contato.mensagem.data,
                      ong.email
                      )
        return redirect(url_for('doacao', ong=ong.nickname, slug=slug))
    return render_template('contato_doacao.html', 
                           user=user,
                           form=form,
                           form_contato=form_contato,
                           doacao=doacao)
Ejemplo n.º 2
0
def contact():
        form = ContactForm()
        if form.validate_on_submit():
                contact_email(form.email.data, form.name.data, form.text.data)
                flash("Thanks for your feedback!")
                return redirect(url_for('index'))
        return render_template('contact.html', form = form)
Ejemplo n.º 3
0
def contact():
	form = ContactForm()
	if form.validate_on_submit():
		flash('Thank you for your email! We\'ll get back to you as soon as we can.')
		contact_email(form.name.data, form.email.data, form.message.data)
		return redirect('/contact')
	return render_template('contact.html',
		title = 'contact',
		page = 'contact',
		form = form)
Ejemplo n.º 4
0
def contato():
    user = g.user
    form = LoginForm()
    form_contato = ContatoForm()
    if form_contato.validate_on_submit():
        contact_email('[Pra Quem Doar Contato] ' + form_contato.assunto.data,
                      form_contato.nome.data,
                      form_contato.email.data,
                      form_contato.mensagem.data,
                      '*****@*****.**'
                      )
        return redirect(url_for('contato'))
    return render_template('contato.html', form=form, form_contato=form_contato, user=user)
Ejemplo n.º 5
0
def contact():
	title = 'Contact Us'
	form = ContactForm()
	if request.method == 'POST' and form.validate():
		firstname = form.first_name.data
		lastname = form.last_name.data
		email = form.email.data
		org = form.organization.data
		if not org:
			org = 'NONE'
		msg = form.message.data
		contact_thanks(email, firstname)
		contact_email(email, firstname, lastname, org, msg)
		flash('Thanks for reaching out!')
		return redirect(url_for('index'))
	return render_template('contact.html', form=form, title=title)