diff --git a/instance/database.db b/instance/database.db new file mode 100644 index 00000000..b375a406 Binary files /dev/null and b/instance/database.db differ diff --git a/website/auth.py b/website/auth.py index 8c65752e..570c5cd8 100644 --- a/website/auth.py +++ b/website/auth.py @@ -56,7 +56,7 @@ def sign_up(): flash('Password must be at least 7 characters.', category='error') else: new_user = User(email=email, first_name=first_name, password=generate_password_hash( - password1, method='sha256')) + password1, method='pbkdf2:sha256')) db.session.add(new_user) db.session.commit() login_user(new_user, remember=True) diff --git a/website/static/index.js b/website/static/index.js index 136d2123..c30bba2c 100644 --- a/website/static/index.js +++ b/website/static/index.js @@ -1,3 +1,20 @@ +document.addEventListener("DOMContentLoaded", function () { + const clearBtn = document.getElementById("clear-search"); + if (clearBtn) { + clearBtn.addEventListener("click", function () { + const form = document.querySelector(".search-form"); + if (form) { + const input = form.querySelector('input[name="q"]'); + if (input) input.value = ""; + form.submit(); // submit without q -> backend will show all notes + } else { + // fallback: reload base path without query string + window.location = window.location.pathname; + } + }); + } +}); + function deleteNote(noteId) { fetch("/delete-note", { method: "POST", diff --git a/website/templates/home.html b/website/templates/home.html index 0fc5c1d9..76759a50 100644 --- a/website/templates/home.html +++ b/website/templates/home.html @@ -1,8 +1,34 @@ {% extends "base.html" %} {% block title %}Home{% endblock %} {% block content %} -
No notes found.
+{% endif %} + +