WU-6
This commit is contained in:
parent
3ad11efda6
commit
81e382f4a1
354
Python/app.py
Normal file
354
Python/app.py
Normal file
@ -0,0 +1,354 @@
|
||||
from flask import Flask, render_template, request, json, session, redirect
|
||||
#from flask.ext.mysql import MySQL
|
||||
from flaskext.mysql import MySQL
|
||||
from pony.orm import *
|
||||
import face_recognition
|
||||
import cv2
|
||||
import logging as log
|
||||
import datetime as dt
|
||||
from time import sleep
|
||||
import types
|
||||
#from werkzeug import generate_password_hash, check_password_hash
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = '523tvb6h3nio6r21cc4r1qx'
|
||||
mysql = MySQL()
|
||||
|
||||
# MySQL configurations
|
||||
app.config['MYSQL_DATABASE_USER'] = 'root'
|
||||
#app.config['MYSQL_DATABASE_USER'] = 'Micik'
|
||||
app.config['MYSQL_DATABASE_PASSWORD'] = 'localhost'
|
||||
app.config['MYSQL_DATABASE_DB'] = 'wu'
|
||||
app.config['MYSQL_DATABASE_HOST'] = 'localhost'
|
||||
mysql.init_app(app)
|
||||
|
||||
faces_list = []
|
||||
testing_face = 0
|
||||
|
||||
|
||||
#wu = Database()
|
||||
|
||||
|
||||
#class Users(wu.Entity):
|
||||
# login = PrimaryKey(str)
|
||||
# haslo = Optional(str)
|
||||
# face = Optional(str)
|
||||
|
||||
|
||||
|
||||
|
||||
#wu.bind("mysql", host = "localhost", user = "root", passwd = "localhost", db = "wu")
|
||||
#wu.generate_mapping(create_tables = True)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def main():
|
||||
return render_template('index.html', info="Witaj!")
|
||||
|
||||
@app.route('/showSignUp')
|
||||
def showSignUp():
|
||||
return render_template('signup.html')
|
||||
|
||||
@app.route('/showSignIn')
|
||||
def showSignIn():
|
||||
return render_template('signin.html')
|
||||
|
||||
@app.route('/signUp',methods=['POST','GET'])
|
||||
def signUp():
|
||||
try:
|
||||
_login = request.form['inputLogin']
|
||||
_password = request.form['inputPassword']
|
||||
|
||||
# validate the received values
|
||||
if _login and _password:
|
||||
|
||||
# All Good, let's call MySQL
|
||||
|
||||
conn = mysql.connect()
|
||||
cursor = conn.cursor()
|
||||
#_hashed_password = generate_password_hash(_password)
|
||||
#cursor.callproc('rejestracja4',(_name,_email,_hashed_password))
|
||||
#cursor.callproc('rejestracja4',(_name,_email,_password))
|
||||
|
||||
#cursor.callproc('dodajUzytkownika', (_email, _password, _type, _organization, _name, _surname))
|
||||
args = (_login, _password)
|
||||
cursor.execute("INSERT into Users(login, password) values(%s, %s)", args)
|
||||
data = cursor.fetchall()
|
||||
|
||||
if len(data) is 0:
|
||||
conn.commit()
|
||||
#return redirect("index.html")
|
||||
#return redirect("/")
|
||||
return render_template("index.html", info="Pomyślnie zarejestrowano!")
|
||||
#return json.dumps({'message':'User created successfully !'})
|
||||
else:
|
||||
return render_template("error.html", error="Użytkownik już istnieje!")
|
||||
#return json.dumps({'error':str(data[0])})
|
||||
else:
|
||||
return json.dumps({'html':'<span>Enter the required fields</span>'})
|
||||
|
||||
#except Exception as e:
|
||||
# return json.dumps({'error':str(e)})
|
||||
finally:
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
@app.route('/validateLogin',methods=['POST'])
|
||||
def validateLogin():
|
||||
try:
|
||||
_username = request.form['inputLogin']
|
||||
_password = request.form['inputPassword']
|
||||
|
||||
con = mysql.connect()
|
||||
cursor = con.cursor()
|
||||
#cursor.callproc('logowanie',(_username,))
|
||||
args = (_username, _password)
|
||||
query = "SELECT * from Users where login = %s and password = %s"
|
||||
cursor.execute(query, args)
|
||||
data = cursor.fetchall()
|
||||
|
||||
if len(data) > 0:
|
||||
#if check_password_hash(str(data[0][3]),_password):
|
||||
#if str(data[0][3]) == _password:
|
||||
if str(data[0][1]) == _password:
|
||||
session['user'] = data[0][0]
|
||||
return redirect('/userHome')
|
||||
else:
|
||||
return render_template('error.html',error = 'Zly email lub haslo!')
|
||||
else:
|
||||
return render_template('error.html',error = 'Zly email lub haslo!')
|
||||
|
||||
except Exception as e:
|
||||
return render_template('error.html',error = str(e))
|
||||
finally:
|
||||
cursor.close()
|
||||
con.close()
|
||||
|
||||
@app.route('/userHome')
|
||||
def userHome():
|
||||
if session.get('user'):
|
||||
return render_template('userHome.html')
|
||||
else:
|
||||
return render_template('error.html',error = 'Nieautoryzowany dostep!')
|
||||
|
||||
@app.route('/logout')
|
||||
def logout():
|
||||
session.pop('user',None)
|
||||
return redirect('/')
|
||||
|
||||
@app.route('/newSheet', methods=['POST','GET'])
|
||||
def newSheet():
|
||||
try:
|
||||
_sheet_name = request.form['inputSheetName']
|
||||
_number_items = request.form['inputItems']
|
||||
_number_operators = request.form['inputOperators']
|
||||
_number_chars = request.form['inputChars']
|
||||
_number_trials = request.form['inputTrials']
|
||||
|
||||
if _sheet_name and _number_items and _number_operators and _number_chars and _number_trials:
|
||||
conn = mysql.connect()
|
||||
cursor = conn.cursor()
|
||||
cursor.callproc('nowyArkusz',(_sheet_name, _number_items,_number_operators,_number_chars, _number_trials))
|
||||
data = cursor.fetchall()
|
||||
|
||||
if len(data) is 0:
|
||||
conn.commit()
|
||||
return redirect('/sheet')
|
||||
#return json.dumps({'message':'Arkusz stworzono poprawnie!'})
|
||||
else:
|
||||
return json.dumps({'error':str(data[0])})
|
||||
else:
|
||||
return json.dumps({'html':'<span>Enter the required fields</span>'})
|
||||
except Exception as e:
|
||||
return json.dumps({'error':str(e)})
|
||||
finally:
|
||||
cursor.close()
|
||||
conn.close()
|
||||
#return render_template('newSheet.html')
|
||||
|
||||
@app.route('/sheet', methods=['POST'])
|
||||
def sheet():
|
||||
return render_template('sheet.html')
|
||||
|
||||
@app.route('/signUpWithFace')
|
||||
def signUpWithFace():
|
||||
cascPath = "haarcascade_frontalface_default.xml"
|
||||
faceCascade = cv2.CascadeClassifier(cascPath)
|
||||
log.basicConfig(filename='webcam.log',level=log.INFO)
|
||||
|
||||
video_capture = cv2.VideoCapture(0)
|
||||
anterior = 0
|
||||
faces = None
|
||||
#testing_face = 0
|
||||
#faces_list = []
|
||||
i = 0
|
||||
|
||||
while True:
|
||||
if not video_capture.isOpened():
|
||||
print('Unable to load camera.')
|
||||
sleep(5)
|
||||
pass
|
||||
|
||||
# Capture frame-by-frame
|
||||
ret, frame = video_capture.read()
|
||||
|
||||
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
faces = faceCascade.detectMultiScale(
|
||||
gray,
|
||||
scaleFactor=1.1,
|
||||
minNeighbors=5,
|
||||
minSize=(30, 30)
|
||||
)
|
||||
|
||||
# Draw a rectangle around the faces
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
||||
|
||||
if anterior != len(faces):
|
||||
anterior = len(faces)
|
||||
log.info("faces: "+str(len(faces))+" at "+str(dt.datetime.now()))
|
||||
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
|
||||
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
#break
|
||||
#face_list.append()
|
||||
#print (type(faces))
|
||||
#print (len(faces))
|
||||
|
||||
#print (type(faces[0]))
|
||||
#print (type(faces[0][0]))
|
||||
|
||||
#if testing_face == faces:
|
||||
# break
|
||||
|
||||
#if type(faces) == "numpy.ndarray" or type(faces) == "ndarray":
|
||||
#if not isinstance(faces, types.TupleType):
|
||||
if type(faces) is not tuple:
|
||||
i += 1
|
||||
face = 0
|
||||
for f in faces[0]:
|
||||
face += f
|
||||
faces_list.append(face)
|
||||
if i == 5:
|
||||
break
|
||||
# faces_list.append(faces)
|
||||
# i += 1
|
||||
# if i == 5:
|
||||
# break
|
||||
|
||||
'''
|
||||
face = 0
|
||||
i += 1
|
||||
for id in faces[0]:
|
||||
face += id
|
||||
if i == 5:
|
||||
break
|
||||
if 825 == face:
|
||||
video_capture.release()
|
||||
cv2.destroyAllWindows()
|
||||
return render_template('index.html')
|
||||
print (face)
|
||||
'''
|
||||
#return render_template("index.html")
|
||||
|
||||
#print (faces)
|
||||
|
||||
# When everything is done, release the capture
|
||||
video_capture.release()
|
||||
cv2.destroyAllWindows()
|
||||
print (faces_list)
|
||||
return render_template('index.html', info="Zapisano twarz")
|
||||
'''
|
||||
face = 0
|
||||
for id in faces[0]:
|
||||
face += id
|
||||
print (id)
|
||||
#if face
|
||||
print (face)
|
||||
'''
|
||||
#return render_template('error.html', error="Nie wykryto twarzy!")
|
||||
|
||||
@app.route('/signInWithFace')
|
||||
def signInWithFace():
|
||||
cascPath = "haarcascade_frontalface_default.xml"
|
||||
faceCascade = cv2.CascadeClassifier(cascPath)
|
||||
log.basicConfig(filename='webcam.log',level=log.INFO)
|
||||
|
||||
video_capture = cv2.VideoCapture(0)
|
||||
anterior = 0
|
||||
faces = None
|
||||
testing_face = 825
|
||||
#faces_list = []
|
||||
i = 0
|
||||
|
||||
while True:
|
||||
if not video_capture.isOpened():
|
||||
print('Unable to load camera.')
|
||||
sleep(5)
|
||||
pass
|
||||
|
||||
# Capture frame-by-frame
|
||||
ret, frame = video_capture.read()
|
||||
|
||||
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
faces = faceCascade.detectMultiScale(
|
||||
gray,
|
||||
scaleFactor=1.1,
|
||||
minNeighbors=5,
|
||||
minSize=(30, 30)
|
||||
)
|
||||
|
||||
# Draw a rectangle around the faces
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
||||
|
||||
if anterior != len(faces):
|
||||
anterior = len(faces)
|
||||
log.info("faces: "+str(len(faces))+" at "+str(dt.datetime.now()))
|
||||
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
|
||||
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
|
||||
#print (faces_list)
|
||||
if type(faces) is not tuple:
|
||||
face = 0
|
||||
i += 1
|
||||
for f in faces[0]:
|
||||
face += f
|
||||
if face in faces_list:
|
||||
break
|
||||
|
||||
# print (faces)
|
||||
# if faces in faces_list:
|
||||
# break
|
||||
elif i == 20:
|
||||
return render_template("error.html", error="Brak dostępu!")
|
||||
|
||||
|
||||
# When everything is done, release the capture
|
||||
video_capture.release()
|
||||
cv2.destroyAllWindows()
|
||||
#print (faces_list)
|
||||
return render_template('userHome.html', info="Zapisano twarz")
|
||||
|
||||
if __name__ == "__main__":
|
||||
#app.run(port=5002)
|
||||
app.run(host='0.0.0.0')
|
53
Python/face_detection_test.py
Normal file
53
Python/face_detection_test.py
Normal file
@ -0,0 +1,53 @@
|
||||
import cv2
|
||||
import sys
|
||||
import logging as log
|
||||
import datetime as dt
|
||||
from time import sleep
|
||||
|
||||
cascPath = "haarcascade_frontalface_default.xml"
|
||||
faceCascade = cv2.CascadeClassifier(cascPath)
|
||||
log.basicConfig(filename='webcam.log',level=log.INFO)
|
||||
|
||||
video_capture = cv2.VideoCapture(0)
|
||||
anterior = 0
|
||||
|
||||
while True:
|
||||
if not video_capture.isOpened():
|
||||
print('Unable to load camera.')
|
||||
sleep(5)
|
||||
pass
|
||||
|
||||
# Capture frame-by-frame
|
||||
ret, frame = video_capture.read()
|
||||
|
||||
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
faces = faceCascade.detectMultiScale(
|
||||
gray,
|
||||
scaleFactor=1.1,
|
||||
minNeighbors=5,
|
||||
minSize=(30, 30)
|
||||
)
|
||||
|
||||
# Draw a rectangle around the faces
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
||||
|
||||
if anterior != len(faces):
|
||||
anterior = len(faces)
|
||||
log.info("faces: "+str(len(faces))+" at "+str(dt.datetime.now()))
|
||||
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
|
||||
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
# Display the resulting frame
|
||||
cv2.imshow('Video', frame)
|
||||
|
||||
# When everything is done, release the capture
|
||||
video_capture.release()
|
||||
cv2.destroyAllWindows()
|
33314
Python/haarcascade_frontalface_default.xml
Normal file
33314
Python/haarcascade_frontalface_default.xml
Normal file
File diff suppressed because it is too large
Load Diff
5
Python/static/js/jquery-1.12.3.min.js
vendored
Normal file
5
Python/static/js/jquery-1.12.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
73
Python/static/signup.css
Normal file
73
Python/static/signup.css
Normal file
@ -0,0 +1,73 @@
|
||||
body {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
.form-signin .form-signin-heading,
|
||||
.form-signin .checkbox {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form-signin .checkbox {
|
||||
font-weight: normal;
|
||||
}
|
||||
.form-signin .form-control {
|
||||
position: relative;
|
||||
height: auto;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
.form-signin2 {
|
||||
max-width: 800px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.form-control2 {
|
||||
position: relative;
|
||||
height: auto;
|
||||
width: 120px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form-control3 {
|
||||
position: relative;
|
||||
height: auto;
|
||||
width: 320px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/************************************/
|
||||
|
||||
.form-signin .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-signin input[type="email"] {
|
||||
/*margin-bottom: -1px;*/
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.form-signin input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
51
Python/templates/error.html
Normal file
51
Python/templates/error.html
Normal file
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl-PL">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Nieautoryzowany Dostęp:: Python Flask App</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="signup.css">
|
||||
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
|
||||
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-left">
|
||||
<li role="presentation" class="active"><a href="javascript:history.back()">Wstecz</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation" class="active"><a href="/">Strona główna</a>
|
||||
</li>
|
||||
<li role="presentation"><a href="/showSignIn">Zaloguj się</a>
|
||||
</li>
|
||||
<li role="presentation"><a href="/showSignUp">Zarejestruj się</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3 class="text-muted"><center>Python Flask</center></h3>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>{{error}}</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<p>© UAM 2018</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
52
Python/templates/index.html
Normal file
52
Python/templates/index.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<!--<html lang="en">-->
|
||||
<html lang="pl-PL">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Python Flask App</title>
|
||||
|
||||
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="signup.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
|
||||
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation" class="active"><a href="#">Strona główna</a>
|
||||
</li>
|
||||
<li role="presentation"><a href="showSignIn">Zaloguj się</a>
|
||||
</li>
|
||||
<li role="presentation"><a href="showSignUp">Zarejestruj się</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3 class="text-muted">Python Flask</h3>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Aplikacja Testowa</h1>
|
||||
<p class="lead"></p>
|
||||
<p><a class="btn btn-lg btn-success" href="showSignUp" role="button">Rejestracja</a>
|
||||
</p>
|
||||
<h2>{{ info }}</h2>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p>© UAM 2018</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
59
Python/templates/signin.html
Normal file
59
Python/templates/signin.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl-PL">
|
||||
<!--html lang="en">-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Python Flask App</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="signup.css">
|
||||
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
|
||||
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
|
||||
<link href="../static/css/signup.css" rel="stylesheet">
|
||||
<script src="../static/js/jquery-1.12.3.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-left">
|
||||
<li role="presentation" class="active"><a href="javascript:history.back()">Wstecz</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation" ><a href="/">Strona główna</a></li>
|
||||
<li role="presentation" class="active"><a href="#">Zaloguj się</a></li>
|
||||
<li role="presentation" ><a href="/showSignUp">Zarejestruj się</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3 class="text-muted"><center>Python Flask</center></h3>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Aplikacja Testowa</h1>
|
||||
<form class="form-signin" action="/validateLogin" method="post">
|
||||
<label for="inputLogin" class="sr-only">Login</label>
|
||||
<input type="text" name="inputLogin" id="inputLogin" class="form-control" placeholder="Wpisz login" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Password</label>
|
||||
<input type="password" name="inputPassword" id="inputPassword" class="form-control" placeholder="Wpisz hasło" required>
|
||||
<input type="submit" value="Zaloguj się normalnie"></input>
|
||||
<!-- <button id="btnSignIn" class="btn btn-lg btn-primary btn-block" type="submit">Potwierdź logowanie</button> -->
|
||||
</form>
|
||||
<form class="form-signin" action="/signInWithFace" method="get">
|
||||
<input type="submit" value="Zaloguj się za pomocą twarzy"></input>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<p>© UAM 2018</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
39
Python/templates/signup.css
Normal file
39
Python/templates/signup.css
Normal file
@ -0,0 +1,39 @@
|
||||
body {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.form-signin .form-signin-heading,
|
||||
.form-signin .checkbox {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form-signin .checkbox {
|
||||
font-weight: normal;
|
||||
}
|
||||
.form-signin .form-control {
|
||||
position: relative;
|
||||
height: auto;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.form-signin .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-signin input[type="email"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.form-signin input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
81
Python/templates/signup.html
Normal file
81
Python/templates/signup.html
Normal file
@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl-PL">
|
||||
<!--html lang="en">-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Python Flask App</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="signup.css">
|
||||
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
|
||||
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
|
||||
<link href="../static/signup.css" rel="stylesheet">
|
||||
<script src="../static/js/jquery-1.12.3.min.js"></script>
|
||||
|
||||
<!-- <script type="text/javascript"> -->
|
||||
<!-- $(function() { -->
|
||||
<!-- $('#btnSignUp').click(function() { -->
|
||||
|
||||
<!-- $.ajax({ -->
|
||||
<!-- url: '/signUp', -->
|
||||
<!-- data: $('form').serialize(), -->
|
||||
<!-- type: 'POST', -->
|
||||
<!-- success: function(response) { -->
|
||||
<!-- console.log(response); -->
|
||||
<!-- }, -->
|
||||
<!-- error: function(error) { -->
|
||||
<!-- console.log(error); -->
|
||||
<!-- } -->
|
||||
<!-- }); -->
|
||||
<!-- }); -->
|
||||
<!-- }); -->
|
||||
<!-- </script> -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-left">
|
||||
<li role="presentation" class="active"><a href="javascript:history.back()">Wstecz</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<!--<li role="presentation" ><a href="main">Strona główna</a></li>-->
|
||||
<li role="presentation" ><a href="/">Strona główna</a></li>
|
||||
<li role="presentation"><a href="/showSignIn">Zaloguj się</a></li>
|
||||
<li role="presentation" class="active"><a href="#">Zarejestruj się</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3 class="text-muted"><center>Python Flask</center></h3>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Aplikacja Testowa</h1>
|
||||
<form class="form-signin" action="/signUp" method="post">
|
||||
<label for="inputLogin" class="sr-only">Login</label>
|
||||
<input type="name" name="inputLogin" id="inputLogin" class="form-control" placeholder="Login" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Password</label>
|
||||
<input type="password" name="inputPassword" id="inputPassword" class="form-control" placeholder="Hasło" required>
|
||||
<input type="submit" value="Zatwierdź"></input>
|
||||
<!-- <button id="btnSignUp" class="btn btn-lg btn-primary btn-block" type="button">Potwierdź rejestrację</button> -->
|
||||
</form>
|
||||
<form class="form-signin" action="/signUpWithFace" method="get">
|
||||
|
||||
<input type="submit" value="Zatwierdź dane twarzy"></input>
|
||||
<!-- <button id="btnSignUp" class="btn btn-lg btn-primary btn-block" type="button">Potwierdź rejestrację</button> -->
|
||||
</form>
|
||||
<!--<button id="btnSignUp" class="btn btn-lg btn-primary btn-block" type="button">Potwierdź rejestrację</button>-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<p>© UAM 2018</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
59
Python/templates/userHome.html
Normal file
59
Python/templates/userHome.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<!--<html lang="en">-->
|
||||
<html lang="pl-PL">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Python Flask App</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="signup.css">
|
||||
<!-- <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
|
||||
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
|
||||
<link href="../static/css/signup.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-left">
|
||||
<!--<form><input type="button" value="Back" onClick="history.go(-1);return true;"></form>-->
|
||||
<!--<li role="presentation" class="active"><input type="button" value="Back" onClick="history.go(-1);return true;">
|
||||
</li>-->
|
||||
<!--<li role="presentation" class="active"><form action="http://google.com"><input type="button" value="Wstecz" onClick="history.go(-1);return true;"></form></li>-->
|
||||
<li role="presentation" class="active"><a href="javascript:history.back()">Wstecz</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation" class="active"><a href="/logout">Wyloguj</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3 class="text-muted"><center>Python Flask</center></h3>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Witaj w domu!</h1>
|
||||
<p class="lead"></p>
|
||||
<!-- <p> -->
|
||||
<!-- <a class="btn btn-lg btn-success" href="newSheet" role="button">Stwórz arkusz</a> -->
|
||||
<!-- <a class="btn btn-lg btn-success" href="#" role="button">Wczytaj szablon</a> -->
|
||||
<!-- <a class="btn btn-lg btn-success" href="#" role="button">Zleć badanie</a> -->
|
||||
<!-- </p> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<p>© UAM 2018</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user