1
0
Fork 0

Basic site functionality (add, delete, search) withouth added vulns

This commit is contained in:
Vili Sinervä 2024-11-24 17:58:53 +02:00
parent d9a41f82bb
commit efee16df40
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
6 changed files with 139 additions and 11 deletions

View file

@ -5,6 +5,32 @@
{% csrf_token %}
<input type="submit" value="Log out">
</form>
<h1>Hello, logged in user {{user.username }}!</h1>
<h1>Hello, {{user.username }}!</h1>
<h2>Notes:</h2>
{% for note in notes %}
<h4>{{note.time}}:</h4>
{{note.body}}
<form action="/remove/{{note.id}}/" method="POST">
{% csrf_token %}
<input type="submit" value="Delete">
</form>
{% endfor %}
<h2>Add note: </h2>
<form action="/add/" method="POST">
{% csrf_token %}
<input type="text" id="body" name="body"><br><br>
<input type="submit" value="Add note">
</form>
<h2>Search notes: </h2>
<form action="/search/" method="GET">
<label for="keyword">Search Text:</label><br>
<input type="text" id="keyword" name="keyword"}><br><br>
<input type="submit" value="Search">
</form>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<body>
<form action="/accounts/logout/" method="POST">
{% csrf_token %}
<input type="submit" value="Log out">
</form>
<br>
<a href="/">Back to Front Page</a>
<h2>Notes matching search "{{keyword}}":</h2>
{% for note in notes %}
<h4>{{note.time}}:</h4>
{{note.body}}
<form action="/remove/{{note.id}}/" method="POST">
{% csrf_token %}
<input type="submit" value="Delete">
</form>
{% endfor %}
<h2>Search again: </h2>
<form action="/search/" method="GET">
<label for="keyword">Search Text:</label><br>
<input type="text" id="keyword" name="keyword"}><br><br>
<input type="submit" value="Search">
</form>
</body>
</html>