register funktion

This commit is contained in:
2024-08-08 11:55:21 +02:00
parent 41a1bb3530
commit 0fd7679ac7
11 changed files with 409 additions and 268 deletions

View File

@ -0,0 +1,54 @@
<!-- wenn logged out -->
{% if not session['logged_in'] %}
<h5>{{ user_name }}</h5>
<p>Login oder <a href="/register">Registrieren</a></p>
<p class="light">Warum registrieren? Zum Schutz der Daten und dem Speichern deines Lernfortschrittes.</p>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{% if category == 'login' %}
<p class="errormsg">{{message}}</p>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
<form name="loginForm" action="/login" method="post" onsubmit="return validateForm()">
<div class="row mb-3">
<label for="inputEmail3" class="col-sm-3 col-form-label">Benutzer</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="username" name="username">
</div>
</div>
<div class="row mb-3">
<label for="inputPassword3" class="col-sm-3 col-form-label">Password</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="password" name="password">
</div>
</div>
<div class="row mb-3">
<div class="col-sm-8 offset-2">
<input type="checkbox" name="remember" id="remember">
<label for="remember">Eingeloggt bleiben</label>
</div>
</div>
<input type="hidden" name="form_id" value="login">
<button type="submit" class="btn btn-primary">Einloggen</button>
</form>
{% endif %}
<!-- wenn logged out -->
<!-- wenn logged in -->
{% if session['logged_in'] %}
<!--<img src="https://via.placeholder.com/100" alt="Profile Picture" />-->
<h5>{{ user_name }}</h5>
<p>Web Developer at Webestica</p>
<p class="light">I'd love to change the world, but they wont give me the source code.</p>
<div class="d-flex justify-content-around">
<span>256 Posts</span>
<span>2.5K Followers</span>
<span>365 Following</span>
</div>
{% endif %}
<!-- wenn logged in -->