Improve login page 2 (#2103)

* Got basic login page format working

* Use different login css template

* Got login form partially working

* Remove old form fields

* Got login page working with image

* Load css and js assets locally
This commit is contained in:
Jonathan Zernik 2022-03-31 01:01:46 -07:00 committed by GitHub
parent a1981cc846
commit ff79efda35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 156 additions and 30 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
.back {
background: #e2e2e2;
width: 100%;
position: absolute;
top: 0;
bottom: 0;
}
.div-center {
width: 400px;
height: 400px;
background-color: #fff;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
overflow: auto;
padding: 1em 2em;
border-bottom: 2px solid #ccc;
display: table;
}
div.content {
display: table-cell;
vertical-align: middle;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
.back {
background: #e2e2e2;
width: 100%;
position: absolute;
top: 0;
bottom: 0;
}
.div-center {
width: 400px;
height: 400px;
background-color: #fff;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
overflow: auto;
padding: 1em 2em;
border-bottom: 2px solid #ccc;
display: table;
}
div.content {
display: table-cell;
vertical-align: middle;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5,18 +5,11 @@
{% else %}
<title>Welcome to Squeaknode</title>
{% endif %}
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/ionicons.min.css">
<link rel="stylesheet" href="assets/css/login.css">
</head>
<body>
<div>
Squeaknode:
<a href="{{ url_for('index') }}">Home</a>
{% if current_user.is_anonymous %}
<a href="{{ url_for('login') }}">Login</a>
{% else %}
<a href="{{ url_for('logout') }}">Logout</a>
{% endif %}
</div>
<hr>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
@ -27,5 +20,8 @@
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View file

@ -1,24 +1,36 @@
{% extends "base.html" %}
{% block content %}
<h1>Sign In</h1>
<form action="" method="post" novalidate>
{{ form.hidden_tag() }}
<p>
{{ form.username.label }}<br>
{{ form.username(size=32) }}<br>
{% for error in form.username.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</p>
<p>
{{ form.password.label }}<br>
{{ form.password(size=32) }}<br>
{% for error in form.password.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</p>
<p>{{ form.remember_me() }} {{ form.remember_me.label }}</p>
<p>{{ form.submit() }}</p>
</form>
<div class="back">
<div class="div-center">
<div class="content">
<div class="mx-auto p-3">
<img src="assets/images/icon.png" class="rounded-circle border" alt="Cinque Terre" width="200" height="200">
</div>
<h3>Squeaknode Login</h3>
<hr />
<form action="" method="post" novalidate>
{{ form.hidden_tag() }}
<div class="form-group">
{{ form.username.label }}<br>
{{ form.username(size=32, class_="form-control", placeholder_="Username") }}<br>
{% for error in form.username.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</div>
<div class="form-group">
{{ form.password.label }}<br>
{{ form.password(size=32, class_="form-control", placeholder_="Password") }}<br>
{% for error in form.password.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</div>
{{ form.submit(class_="btn btn-primary") }}
<hr />
</form>
</div>
</div>
</div>
{% endblock %}