Compare commits

..

No commits in common. "42b8a774eacac84ea8c42dc5d0b59e34e6231c14" and "727617e2be1a39231631914322e16ba3097ced3a" have entirely different histories.

14 changed files with 187 additions and 204 deletions

1
.gitignore vendored
View file

@ -11,4 +11,3 @@ flask_session/
/test/flask_session/ /test/flask_session/
/Website/__pycache__/ /Website/__pycache__/
/Website/.pytest_cache/ /Website/.pytest_cache/
/.idea

View file

@ -1,25 +1,26 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block customscript %} <html lang="en">
<script type="text/javascript" charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
var socket = io(); <script type="text/javascript" charset="utf-8">
var user = {{ user }} var socket = io();
socket.on('connect', function() { var user = {{ user }}
socket.emit('addtag', {data: user}); socket.on('connect', function() {
}); socket.emit('addtag', {data: user});
socket.on("busy", function(){ });
document.write('<p>the nfc reader is busy at the moment. Pleas Wait ...</p>') socket.on("busy", function(){
socket.emit('addtag', {data: user}) document.write('<p>the nfc reader is busy at the moment. Pleas Wait ...</p>')
}); socket.emit('addtag', {data: user})
socket.on("wait", function(){ });
document.write('<p>Pleas hold your tag on to the nfc reader</p>') socket.on("wait", function(){
}); document.write('<p>Pleas hold your tag on to the nfc reader</p>')
socket.on("error", function(data) { });
alert(data) socket.on("error", function(data) {
window.location="http://matekasse.server.c3h/" alert(data)
}); window.location="http://matekasse.server.c3h/"
socket.on("finished", function(data){ });
alert(data) socket.on("finished", function(data){
window.location="http://matekasse.server.c3h/" alert(data)
}); window.location="http://matekasse.server.c3h/"
</script> });
{% endblock %} </script>
</html>

View file

@ -1,10 +1,8 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block title %} <html lang="en">
add user <title>add user</title>
{% endblock %} <p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
{% block content %} <p>
<form action="/adduser/user" method="post"><input name="username" type="search" placeholder="Username"> <form action="/adduser/user" method="post"><input name="username" type="search" placeholder="Username"><button>Add user</button></form>
<button>Add user</button> </p>
</form> </html>
</p>
{% endblock %}

View file

@ -1,24 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>{% block title %}{% endblock %}</title> <title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" {% block title %} {% endblock %} - FlaskApp
integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" </title>
crossorigin="anonymous" </head>
></script> <body>
<link rel="shortcut icon" type="Logo/png" href="ccc_logo.png"/> <nav>
{% block customscript %}{% endblock %} <p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
</head> </nav>
<body> <hr>
<nav> <div class="conntent">
<p><a href="/">index page</a> {% block content %} {% endblock %}
| <a href="/list">user and tag list</a> </div>
| <a href="/documentation">Documentation</a> </body>
</p>
</nav>
<hr>
<div class="conntent">
{% block content %} {% endblock %}
</div>
</body>
</html> </html>

View file

@ -1,5 +1,6 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block customscript %} <html lang="en">
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
var socket = io(); var socket = io();
var change = {{change}} var change = {{change}}
@ -22,4 +23,4 @@
window.location="http://matekasse.server.c3h/" window.location="http://matekasse.server.c3h/"
}); });
</script> </script>
{% endblock %} </html>

View file

@ -1,16 +1,17 @@
{% extends "base.html" %} <html>
{% block customscript %} <script src="/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
if (confirm("{message}") == true) { if (confirm("{message}") == true) {
fetch("{{destination}}", { fetch("{{destination}}", {
method: "POST", method: "POST",
body: JSON.stringify({data}), body: JSON.stringify({data}),
headers: { headers: {
"Content-type": "application/json; charset=UTF-8" "Content-type": "application/json; charset=UTF-8"
} }
}) })
} else { }
window.location = "/list" else {
} window.location="/list"
</script> }
{% endblock %} </script>
</html>

View file

@ -1,11 +1,16 @@
{% extends "base.html" %} <html>
{% block title %}
Documentation <head>
{% endblock %} <title>Documentation</title>
{% block customscript %} <link rel="stylesheet" type="text/css" href="documentation.css">
<link rel="stylesheet" type="text/css" href="documentation.css"> <link rel="shortcut icon" type="Logo/png" href="ccc_logo.png"/>
{% endblock %} </head>
{% block content %}
<body>
<div id="Infos">
<p> <a href="/">index page</a> | <a href="/list">user and tag list</a></p>
<p><a href="https://hannover.ccc.de/gitlab/anton/matekasse">https://hannover.ccc.de/gitlab/anton/matekasse</a></p>
</div>
<h1 class="header"> <u>Documentation</u> </h1> <h1 class="header"> <u>Documentation</u> </h1>
<p>&nbsp;</p> <p>&nbsp;</p>
@ -41,4 +46,6 @@ Documentation
<p>638: Wrong Input</p> <p>638: Wrong Input</p>
<P>418: I'm a teapot</P> <P>418: I'm a teapot</P>
</div> </div>
{% endblock %} </body>
</html>

View file

@ -1,8 +1,8 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block title %}Error{% endblock %} <html lang="en">
{% block customscript %} <title>Error</title>
<p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p> <p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
<p> <p>
Error: {{error_code}} Error: {{error_code}}
</p> </p>
{% endblock %} </html>

View file

@ -1,12 +1,11 @@
{% extends "base.html" %} <html>
{% block customscript %} <a href="/list">user and tag list</a>
<script type="text/javascript" charset="utf-8">
window.location="/list"
</script>
{% endblock %}
{% block content %}
<a href="/list">user and tag list</a>
<p>The creator of this website accepts no liability for any linguistic or technical errors!</p> <p>The creator of this website accepts no liability for any linguistic or technical errors!</p>
<br style="line-height: 500%;"></br> <br style="line-height: 500%;"></br>
<a href="/documentation">Doumentation</a> <a href="/documentation">Doumentation</a>
{% endblock %} <script src="/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous">
</script>
<script type="text/javascript" charset="utf-8">
window.location="/list"
</script>
</html>

View file

@ -1,35 +1,29 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block title %} <html lang="en-150">
Strichliste <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
{% endblock %} <script type="text/javascript" charset="utf-8">
{% block customscript %} var socket = io();
<script type="text/javascript" charset="utf-8"> socket.on("update", function(){
var socket = io(); window.location="http://matekasse.server.c3h/list"
socket.on("update", function () { });
window.location = "http://matekasse.server.c3h/list" </script>
}); <title>Strichliste</title>
</script> <p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
{% endblock %} <form action="/list/user" method="get"><input name="user" type="search" placeholder="Search for user"><button>Search</button></form>
{% block content %} <form action="/adduser" method="post"><button type="submit">Add User</button></form>
<form action="/list/user" method="get"><input name="user" type="search" placeholder="Search for user"> <br></br>
<button>Search</button> {% for i in users %}
</form> <form action="/change" method="post" style="display: inline;">
<form action="/adduser" method="post"> <p style="display: inline;">
<button type="submit">Add User</button> <a href="list/user?id={{i[0]}}">{{i[1]|safe}}</a>: {{i[2]/100}}€
</form> </p>
<br></br> <input name="id" type="hidden" value="{{i[0]}}">
{% for i in users %} <input name="change" type="number" lang="nb" step="0.01" placeholder="add to balance">
<form action="/change" method="post" style="display: inline;"> </form>
<p style="display: inline;"> <form action="/change" method="post" style="display: inline">
<a href="list/user?id={{i[0]}}">{{i[1]|safe}}</a>: {{i[2]/100}}€ <input name="id" type="hidden" value="{{i[0]}}">
</p> <button type="submit" name="change" value=-{{preis}}>-{{preis}}€</button>
<input name="id" type="hidden" value="{{i[0]}}"> </form>
<input name="change" type="number" lang="nb" step="0.01" placeholder="add to balance"> <br style="line-height: 50%;"></br>
</form> {% endfor %}
<form action="/change" method="post" style="display: inline"> </html>
<input name="id" type="hidden" value="{{i[0]}}">
<button type="submit" name="change" value=-{{preis}}>-{{preis}}€</button>
</form>
<br style="line-height: 50%;"></br>
{% endfor %}
{% endblock %}

View file

@ -1,12 +1,8 @@
{% extends "base.html" %} <html>
{% block title %} <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
{% endblock %} <script type="text/javascript" charset="utf-8">
{% block content %} window.location="/list";
<p>redirekting</p> </script>
<a href="/list">destination</a> <p>redirekting</p>
{% endblock %} <a href="/list">destination</a>
{% block customscript %} </html>
<script type="text/javascript" charset="utf-8">
window.location = "/list";
</script>
{% endblock %}

View file

@ -1,6 +1,7 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block customscript %} <html lang="en">
<script type="text/javascript" charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
var socket = io(); var socket = io();
var user = {{ user }} var user = {{ user }}
socket.on('connect', function() { socket.on('connect', function() {
@ -22,4 +23,4 @@
window.location="http://matekasse.server.c3h/" window.location="http://matekasse.server.c3h/"
}); });
</script> </script>
{% endblock %} </html>

View file

@ -1,10 +1,9 @@
{% extends "base.html" %} <html>
{% block title %} <title>remove user</title>
remove user
{% endblock %}
{% block content %}
<p> <p>
<p>
<a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a>
</p>
<p>Deleted user {{user_name|safe}}</p> <p>Deleted user {{user_name|safe}}</p>
<a href="/list">return to the tags and user list</a> <a href="/list">return to the tags and user list</a>
</p> </p>
{% endblock %}

View file

@ -1,45 +1,39 @@
{% extends "base.html" %} <!DOCTYPE html>
{% block customscript %} <html lang="en-150">
<script type="text/javascript" charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js" integrity="sha512-q/dWJ3kcmjBLU4Qc47E4A9kTB4m3wuTY7vkFJDTZKjTs8jhyGQnaUrxa0Ytd0ssMZhbNua9hE+E7Qv1j+DyZwA==" crossorigin="anonymous"></script>
var socket = io(); <script type="text/javascript" charset="utf-8">
socket.on("update", function () { var socket = io();
window.location = "/list/user?id={{user[0]}}" socket.on("update", function(){ window.location="/list/user?id={{user[0]}}"});
}); </script>
</script> <title>{{user[1]|safe}}</title>
{% endblock %} <p><a href="/list">user and tag list</a> | <a href="/documentation">Documentation</a></p>
{% block title %} <p> {{user[1]|safe}} : {{user[2]/100}}€ <p>
{{user[1]|safe}} <form action="/addtag" method="post">
{% endblock %} <input name="id" type="hidden" value="{{user[0]}}">
{% block content %} <button type="submit">Add Tag</button>
<p> {{user[1]|safe}} : {{user[2]/100}}€ <p> </form>
<form action="/addtag" method="post"> <form action="/removetag" method="post">
<input name="id" type="hidden" value="{{user[0]}}"> <input name="id" type="hidden" value="{{user[0]}}">
<button type="submit">Add Tag</button> <button type="submit">Remove Tag</button>
</form> </form>
<form action="/removetag" method="post"> </p>
<input name="id" type="hidden" value="{{user[0]}}"> <form action="/change" method="post">
<button type="submit">Remove Tag</button> <input name="id" type="hidden" value="{{user[0]}}">
</form> <input name="change" type="number" lang="nb" step="0.01" placeholder="change balance">
</p> </form>
<form action="/change" method="post"> </p>
<input name="id" type="hidden" value="{{user[0]}}"> <br></br>
<input name="change" type="number" lang="nb" step="0.01" placeholder="change balance"> <p>Tags:</p>
</form> {% for tag in tags %}
</p> <p>
<br></br> <form action="/removetag" method="post">
<p>Tags:</p> <label for="removetag">{{tag[0]}} </label>
{% for tag in tags %} <input name="id" type="hidden" value="{{user[0]}}">
<p> <input name="tagid" type="hidden" value="{{tag[0]}}">
<form action="/removetag" method="post"> <button id="removetag" type="submit">Remove Tag</button>
<label for="removetag">{{tag[0]}} </label> </form>
<input name="id" type="hidden" value="{{user[0]}}"> </p>
<input name="tagid" type="hidden" value="{{tag[0]}}"> {% endfor %}
<button id="removetag" type="submit">Remove Tag</button> <br></br>
</form> <form action="/removeuser" method="post"><input name="id" type="hidden" value="{{user[0]}}"><button type="submit">Remove User</button></form>
</p> </html>
{% endfor %}
<br></br>
<form action="/removeuser" method="post"><input name="id" type="hidden" value="{{user[0]}}">
<button type="submit">Remove User</button>
</form>
{% endblock %}