Commit 8e00def6 authored by erreur401's avatar erreur401

contact form connect + styling template #8 closed

parent e6c4fa01
......@@ -8,6 +8,7 @@ from flask_security import Security, MongoEngineUserDatastore, UserMixin, RoleMi
from flask_login import user_logged_in
from flask_mail import Mail
from flask_mail import Message
from flask_security.forms import RegisterForm, StringField
from wtforms.validators import DataRequired
import urllib.request as ur
......@@ -24,7 +25,7 @@ from flask_admin import Admin
from flask_admin.form import rules
from flask_admin.contrib.mongoengine import ModelView, filters
from flask_admin.model.fields import InlineFormField, InlineFieldList
from wtforms import form, fields
# EVENTBRITE API
......@@ -265,10 +266,27 @@ def check_quiz(id):
return render_template('check_quiz.html', quiz=quiz, question_answer=zip(quiz['questions'], answers_list), correct=number_correct, total=len(answers_list))
@app.route("/contact")
def contact():
return render_template("contact.html")
return render_template('contact.html')
@app.route("/succes" , methods=["GET", "POST"])
def success():
if request.method == 'POST':
reply_to = request.form.get('email')
message = request.form.get('message')
subject = request.form.get('subject')
emailS = request.form.get('email')
message = subject + "\n" + message
print(message)
msg = Message(recipients=["julien@bemaker.eu"],
body = message,
subject = "contact from outer space (or website)",
sender = emailS )
mail.send(msg)
return render_template('succes.html')
@app.route("/event")
def event():
......
This diff is collapsed.
......@@ -17,6 +17,31 @@ h1, h2, h3, h4, h5 {
font-weight: bolder;
}
.material-icons.md-18 {
font-size: 18px;
vertical-align: middle;
}
.material-icons.md-24 {
font-size: 24px;
vertical-align: middle;
}
.material-icons.md-36 {
font-size: 36px;
vertical-align: middle;
}
.material-icons.md-48 {
font-size: 48px;
vertical-align: middle;
}
.material-icons.md-100 {
font-size: 100px;
vertical-align: middle;
}
input[type=radio] {
background: #FF0000;
border: none;
......
......@@ -20,6 +20,11 @@ h1, h2, h3, h4, h5 {
font-weight: bolder;
// text-align: center;
}
.material-icons.md-18 { font-size: 18px;vertical-align: middle; }
.material-icons.md-24 { font-size: 24px;vertical-align: middle; }
.material-icons.md-36 { font-size: 36px; vertical-align: middle;}
.material-icons.md-48 { font-size: 48px; vertical-align: middle;}
.material-icons.md-100 { font-size: 100px; vertical-align: middle;}
input[type="radio"] {
background: #FF0000;
......@@ -30,8 +35,6 @@ input[type="radio"]:checked{
border: RED;
}
#myBtn {
display: none; /* Hidden by default */
position: fixed; /* Fixed/sticky position */
......
......@@ -2,37 +2,33 @@
{% extends "base.html" %}
{% block content %}
<h1> contact us </h1>
<div class="container ">
<h1 style="text-align:center;">Contact</h1>
<dir class="row no-gutters justify-content-md-center">
<div class=" col col-12 col-sm-12 col-md-8 col-lg-8">
<div class="form-area">
<form role="form">
<div class="form-area">
<form role="form" method="POST" action="/succes">
<div class="form-group">
<input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
<input type="text" class="form-control" id="name" name="name" placeholder="Name"required>
</div>
<div class="form-group">
<input type="text" class="form-control" id="email" name="email" placeholder="Email" required>
<input type="text" class="form-control" id="email" pattern="[^ @]*@[^ @]*" name="email" placeholder="Email" data-toggle="tooltip" data-placement="top" title=" format : yourname@domain.com" required>
</div>
<div class="form-group">
<input type="text" class="form-control" id="subject" name="subject" placeholder="Subject" required>
</div>
<div class="form-group">
<textarea class="form-control" type="textarea" id="message" placeholder="Message" maxlength="140" rows="7"></textarea>
<span class="help-block"><p id="characterLeft" class="help-block ">You have reached the limit</p></span>
</div>
<button type="button" id="submit" name="submit" class="btn btn-primary pull-right">Submit Form</button>
<div class="form-group">
<textarea class="form-control" type="textarea" name="message" placeholder="Message" maxlength="450" rows="7" required></textarea>
</div>
<button type="submit" id="submit" name="submit" class="btn btn-primary pull-right">send</button>
</form>
</div>
</dir>
</div>
</div>
{% endblock %}
\ No newline at end of file
{% endblock %}
......@@ -26,7 +26,7 @@
<h2>TES BADGES</h2>
<div class="row">
{% for badge, value in current_user.badges.items() %}
{{ value.lvl }}
<div class="col-2">
<div class="badgeItem">
{% if value.lvl == "1" %}
......@@ -44,16 +44,6 @@
</div>
{% endfor %}
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
</div>
<span> maker </span>
</div>
</div>
</div>
</div>
</div>
......
......@@ -5,5 +5,6 @@
<link href="{{ url_for('static', filename='css/style.css')}}" rel="stylesheet" media="screen">
<!-- LOAD MD CONTENT SPECIFIC CSS -->
<link href="{{ url_for('static', filename='css/mdcss.css')}}" rel="stylesheet" media="screen">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
{{path}}
\ No newline at end of file
{{path}}
......@@ -41,7 +41,9 @@
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 ">
<div class='cta'>
<div class="ico">
<img src="img/people.png">
<i class="material-icons md-100">
public
</i>
</div>
<h3>Inscription</h3>
<p>
......@@ -55,7 +57,9 @@
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 ">
<div class='cta'>
<div class="ico">
<img src="img/hat.png">
<i class="material-icons md-100">
local_bar
</i>
</div>
<h3>Decouvrir</h3>
<p>
......@@ -69,7 +73,9 @@
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 ">
<div class='cta'>
<div class="ico">
<img src="img/tools2.png">
<i class="material-icons md-100">
whatshot
</i>
</div>
<h3> Atelier </h3>
<p>
......
{% extends "base.html" %}
{% block content %}
<div class="spacer"></div>
<div class="container">
<h1> <i class="material-icons md-48"> mail_outline</i> &nbsp; Merci pour l'email</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment