version, added sort of users with matching languages for learnd and interests

This commit is contained in:
ProgramSnail 2021-05-09 13:25:01 +03:00
parent 68a3b3ca1e
commit aa829a984e
5 changed files with 191 additions and 95 deletions

20
templates/base.html Normal file
View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Language Learner</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/w3.css">
<link rel="stylesheet" href="/static/fontawesome/css/all.css">
</head>
<body>
<header class="w3-container w3-dark-gray">
<h1><i class="fas fa-dice-d20"></i> Language Learner</h1>
</header>
<div class="w3-container w3-margin">
{% block content %}{% endblock %}
</div>
<footer class="w3-container w3-light-gray w3-center">
<label>my app (2021)</label>
</footer>
</body>
</html>

View file

@ -1,33 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Language Learner</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/w3.css">
<link rel="stylesheet" href="/static/fontawesome/css/all.css">
</head>
<body>
<header class="w3-container w3-dark-gray">
<h1><i class="fas fa-dice-d20"></i> Language Learner</h1>
</header>
<div class="w3-container w3-margin">
<div class="w3-container w3-third"></div>
<div class="w3-panel w3-card w3-third">
<form method="POST" action="" class="w3-container w3-margin w3-center">
<h2>Log in / Sign up</h2>
<label>Name</label>
<input class="w3-input w3-section" type="text"
name="name" placeholder="Enter Name" required="">
<label>Password</label>
<input class="w3-input w3-section" type="password"
name="password" placeholder="Enter Password" required="">
<input class="w3-button w3-green w3-section" type="submit" value="Submit">
</form>
</div>
<div class="w3-container w3-third"></div>
</div>
<footer class="w3-container w3-light-gray">
<label class="w3-center">My app.</label>
</footer>
</body>
</html>
{% extends "base.html" %}
{% block content %}
<div class="w3-container w3-third"></div>
<div class="w3-panel w3-card w3-third w3-center">
<label class="w3-text-red w3-container">{{ form_msg }}</label>
<form method="POST" action="" class="w3-container w3-margin">
<h2>Log in / Sign up</h2>
<label>Name</label>
<input class="w3-input w3-section" type="text"
name="name" placeholder="Enter Name" required="">
<label>Password</label>
<input class="w3-input w3-section" type="password"
name="password" placeholder="Enter Password" required="">
<input class="w3-button w3-green w3-section" type="submit" value="Submit">
</form>
</div>
<div class="w3-container w3-third"></div>
{% endblock %}

View file

@ -1,60 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>Language Learner</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/w3.css">
<link rel="stylesheet" href="/static/fontawesome/css/all.css">
</head>
<body>
<header class="w3-container w3-dark-gray">
<h1><i class="fas fa-dice-d20"></i> Language Learner</h1>
</header>
<div class="w3-container w3-margin">
<div class="w3-panel w3-card w3-third w3-margin">
<img src="/static/images/default_avatar.png" class="w3-circle w3-margin" style="width: 60%" alt="avatar">
<h1>User Name</h1>
<b>Interests:</b>
<ul class="w3-ul">
<li>Football</li>
<li>Programming</li>
<li>Something</li>
</ul>
</div>
<div class="w3-card w3-panel w3-margin w3-third w3-padding-large">
<form method="POST" action="" style="width: 100%"
class="w3-card w3-section w3-padding-small w3-center">
<input type="text" name="interest" plaseholder="Your interest">
<input class="w3-button w3-ripple w3-green" type="submit" value="Submit">
</form>
<ul class="w3-ul w3-border" style="width: 100%">
<li>
<label>Interest 1</label>
</li>
<li>
<label>Interest 2</label>
</li>
<li>
<label>Interest 3</label>
</li>
</ul>
</div>
<div class="w3-panel w3-margin w3-third">
<ul class="w3-ul w3-card" style="width: 100%">
<li>
<label>User 1</label>
</li>
<li>
<label>User 2</label>
</li>
<li>
<label>User 3</label>
</li>
</ul>
</div>
</div>
<footer class="w3-container w3-light-gray">
<label class="w3-center">My app.</label>
</footer>
</body>
</html>
{% extends "base.html" %}
{% block content %}
<div class="w3-panel w3-card w3-third w3-margin">
<img src="/static/images/default_avatar.png" class="w3-circle w3-margin" style="width: 60%" alt="avatar">
<h1>{{ user_name }}</h1>
<b>Languages:</b>
<p> {{ user_language }} -> {{ foreign_language }}</p>
<b>Interests:</b>
<ul class="w3-ul">
<li>{{ interest1 }}</li>
<li>{{ interest2 }}</li>
<li>{{ interest3 }}</li>
</ul>
<form method="POST" action="" style="width: 100%"
class="w3-card w3-section w3-padding-small w3-center">
<input type="text" name="param-str" placeholder="Type here" required>
<input class="w3-button w3-ripple w3-green" type="submit" value="Submit">
<p>
<input class="w3-radio" type="radio" name="param-id" value="i1" checked>
<label>Change First Interest</label>
</p>
<p>
<input class="w3-radio" type="radio" name="param-id" value="i2">
<label>Change Second Interest</label>
</p>
<p>
<input class="w3-radio" type="radio" name="param-id" value="i3">
<label>Change Third Interest</label>
</p>
<p>
<input class="w3-radio" type="radio" name="param-id" value="usr-lang">
<label>Change Your Language</label>
</p>
<p>
<input class="w3-radio" type="radio" name="param-id" value="foreign-lang">
<label>Change Foreign Language</label>
</p>
</form>
<label class="w3-text-red w3-container w3-center">{{ form_msg }}</label>
</div>
<div class="w3-panel w3-margin w3-third">
<ul class="w3-ul w3-card" style="width: 100%">
{% for usr in matching_users %}
<li>
<h2><b><i class="fas fa-user"></i> {{ usr[0] }}</b></h2>
<p>
Same interest - {{ usr[1] }}
</p>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}