Merge branch 'bs4login'
This commit is contained in:
commit
5cfc400a8b
4 changed files with 44 additions and 186 deletions
|
@ -30,6 +30,8 @@ def login():
|
|||
status=login_attempt['status'],
|
||||
message=login_attempt['message'])
|
||||
elif request.method == 'GET':
|
||||
if 'username' in session.keys():
|
||||
return redirect(url_for('logout'))
|
||||
return render_template('login.html')
|
||||
|
||||
|
||||
|
@ -51,6 +53,8 @@ def register():
|
|||
status="danger",
|
||||
message="Passwords do not match!")
|
||||
elif request.method == 'GET':
|
||||
if 'username' in session.keys():
|
||||
return redirect(url_for('logout'))
|
||||
return render_template('register.html')
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
body {
|
||||
padding-top: 90px;
|
||||
}
|
||||
.panel-login {
|
||||
.card-login {
|
||||
border-color: #ccc;
|
||||
-webkit-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2);
|
||||
box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2);
|
||||
}
|
||||
.panel-login>.panel-heading {
|
||||
.card-login>.card-heading {
|
||||
color: #00415d;
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
text-align:center;
|
||||
}
|
||||
.panel-login>.panel-heading a{
|
||||
.card-login>.card-heading a{
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
|
@ -22,11 +22,11 @@ body {
|
|||
-moz-transition: all 0.1s linear;
|
||||
transition: all 0.1s linear;
|
||||
}
|
||||
.panel-login>.panel-heading a.active{
|
||||
.card-login>.card-heading a.active{
|
||||
color: #029f5b;
|
||||
font-size: 18px;
|
||||
}
|
||||
.panel-login>.panel-heading hr{
|
||||
.card-login>.card-heading hr{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 0px;
|
||||
clear: both;
|
||||
|
@ -37,7 +37,7 @@ body {
|
|||
background-image: -ms-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.15),rgba(0,0,0,0));
|
||||
background-image: -o-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.15),rgba(0,0,0,0));
|
||||
}
|
||||
.panel-login input[type="text"],.panel-login input[type="email"],.panel-login input[type="password"] {
|
||||
.card-login input[type="text"],.card-login input[type="email"],.card-login input[type="password"] {
|
||||
height: 45px;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 16px;
|
||||
|
@ -45,8 +45,8 @@ body {
|
|||
-moz-transition: all 0.1s linear;
|
||||
transition: all 0.1s linear;
|
||||
}
|
||||
.panel-login input:hover,
|
||||
.panel-login input:focus {
|
||||
.card-login input:hover,
|
||||
.card-login input:focus {
|
||||
outline:none;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
|
|
|
@ -1,94 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'bootstrap.min.css') }}" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'index.css') }}" />
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<title>Welcome to Tweeder!</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{% if status %}
|
||||
<div class="alert alert-{{ status }}" role="alert">{{ message }}</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-login">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<a href="#" class="active" id="login-form-link">Login</a>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<a href="#" id="register-form-link">Register</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="login-form" action="login" method="POST" role="form" style="display: block;">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username or email address" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="checkbox" tabindex="3" class="" name="remember" id="remember">
|
||||
<label for="remember"> Remember Me</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3">
|
||||
<input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="text-center">
|
||||
<a href="/recover" tabindex="5" class="forgot-password">Forgot Password?</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form id="register-form" action="/register" method="POST" role="form" style="display: none;">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Email Address" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="Confirm Password" oninput="check(this)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3">
|
||||
<input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" value="Register Now">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card col-xl-6 col-md-8 col-sm-10 col-xs-12 mx-auto">
|
||||
<div class="card-body">
|
||||
<h2 class="mx-auto" style="display:inline;">Login to Tweeder</h2>
|
||||
<a href="/register" class="btn btn-outline-success" style="float:right;">Need an account?</a>
|
||||
<form method="POST" action="/login" class="form-group">
|
||||
<input name="username" type="text" class="form-control" style="margin-bottom: 12px; margin-top: 12px; height:45px;" tabindex="1" placeholder="Username or email address" />
|
||||
<input name="password" type="password" class="form-control" style="margin-bottom: 12px; height:45px;" tabindex="2" placeholder="Password" />
|
||||
<input type="submit" class="form-control btn btn-primary" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{ url_for('static', filename = 'jquery-3.2.1.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename = 'bootstrap.min.js') }}" ></script>
|
||||
<script src="{{ url_for('static', filename = 'index.js') }}" ></script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
|
@ -1,94 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'bootstrap.min.css') }}" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'index.css') }}" />
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<title>Welcome to Tweeder!</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{% if status %}
|
||||
<div class="alert alert-{{ status }}" role="alert">{{ message }}</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-login">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<a href="#" id="login-form-link">Login</a>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<a href="#" class="active" id="register-form-link">Register</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="login-form" action="login" method="POST" role="form" style="display: none;">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username or email address" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="checkbox" tabindex="3" class="" name="remember" id="remember">
|
||||
<label for="remember"> Remember Me</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3">
|
||||
<input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="text-center">
|
||||
<a href="/recover" tabindex="5" class="forgot-password">Forgot Password?</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form id="register-form" action="/register" method="POST" role="form" style="display: block;">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Email Address" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="Confirm Password" oninput="check(this)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3">
|
||||
<input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" value="Register Now">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card col-xl-6 col-md-8 col-sm-10 col-xs-12 mx-auto">
|
||||
<div class="card-body">
|
||||
<h2 class="mx-auto" style="display:inline;">Register for Tweeder</h2>
|
||||
<a href="/login" class="btn btn-outline-primary" style="float:right;">Have an account?</a>
|
||||
<form method="POST" action="/register" class="form-group">
|
||||
<input name="username" type="text" class="form-control" style="margin-bottom: 12px; margin-top: 12px; height:45px;" tabindex="1" placeholder="Username" />
|
||||
<input name="email" type="text" class="form-control" style="margin-bottom: 12px; margin-top: 12px; height:45px;" tabindex="2" placeholder="Email address" />
|
||||
<input name="password" type="password" class="form-control" style="margin-bottom: 12px; height:45px;" tabindex="3" placeholder="Password" />
|
||||
<input name="confirm-password" type="password" class="form-control" style="margin-bottom: 12px; height:45px;" tabindex="4" placeholder="Confirm Password" />
|
||||
<input type="submit" class="form-control btn btn-success" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{ url_for('static', filename = 'jquery-3.2.1.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename = 'bootstrap.min.js') }}" ></script>
|
||||
<script src="{{ url_for('static', filename = 'index.js') }}" ></script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
Loading…
Add table
Reference in a new issue