diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py
index de2d4f1b..4abc86d3 100644
--- a/ihatemoney/forms.py
+++ b/ihatemoney/forms.py
@@ -221,7 +221,17 @@ class ProjectForm(EditProjectForm):
raise ValidationError(Markup(message))
-class DeleteProjectForm(FlaskForm):
+class DestructiveActionProjectForm(FlaskForm):
+ """Used for any important "delete" action linked to a project:
+
+ - delete project itself
+ - delete history
+ - delete IP addresses in history
+ - possibly others in the future
+
+ It asks the user to enter the private code to confirm deletion.
+ """
+
password = PasswordField(
_("Private code"),
description=_("Enter private code to confirm deletion"),
diff --git a/ihatemoney/templates/forms.html b/ihatemoney/templates/forms.html
index 7c2fdeb1..eb3321a0 100644
--- a/ihatemoney/templates/forms.html
+++ b/ihatemoney/templates/forms.html
@@ -125,6 +125,28 @@
{% endmacro %}
+{% macro delete_project_history(form) %}
+
+ {% include "display_errors.html" %}
+ {{ form.hidden_tag() }}
+ {{ input(form.password, inline=True) }}
+
+
+
+
+{% endmacro %}
+
+{% macro delete_ip_addresses(form) %}
+
+ {% include "display_errors.html" %}
+ {{ form.hidden_tag() }}
+ {{ input(form.password) }}
+
+
+
+
+{% endmacro %}
+
{% macro add_bill(form, edit=False, title=True) %}