From 1dc2eb2ebc5a837d745358620f1dfd35544632ac Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 28 May 2018 16:58:42 +0200 Subject: User profile form: duplicate, delete and edit --- .../templates/blocks/bs_form_snippet.html | 4 +- ishtar_common/templates/ishtar/forms/profile.html | 51 ++++++++++++++++++++++ .../templates/ishtar/wizard/default_wizard.html | 2 +- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 ishtar_common/templates/ishtar/forms/profile.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/blocks/bs_form_snippet.html b/ishtar_common/templates/blocks/bs_form_snippet.html index 818c654d1..47779cdc1 100644 --- a/ishtar_common/templates/blocks/bs_form_snippet.html +++ b/ishtar_common/templates/blocks/bs_form_snippet.html @@ -64,9 +64,9 @@ {% if forloop.counter0 %} {% endif %}

{{field.name|from_dict:form.HEADERS|call:'render'}}

-
+
{% elif not search and not forloop.counter0 or search and forloop.counter0 == 1 %} -
+
{% endif %} {% include "blocks/bs_field_snippet.html" %} {% if forloop.last %} diff --git a/ishtar_common/templates/ishtar/forms/profile.html b/ishtar_common/templates/ishtar/forms/profile.html new file mode 100644 index 000000000..02f50be7b --- /dev/null +++ b/ishtar_common/templates/ishtar/forms/profile.html @@ -0,0 +1,51 @@ +{% extends "ishtar/form.html" %} +{% load i18n inline_formset table_form %} +{% block extra_head %} + +{% endblock %} + +{% block content %} +

{{page_name}}

+
+ + {% if form.non_field_errors %} + + {% endif %} + + {% for hidden in form.hidden_fields %} + {{hidden}} + {% if hidden.errors %}
+ {{ hidden.errors }} +
{% endif %} + {% endfor %} + +
+ {% for field in form.visible_fields %} + {% if forloop.counter0 == 0 %} +
+ {{field|safe}} +
+
+
+ {% elif field.name == 'delete_profile' %} +
+
+ {% include "blocks/bs_field_snippet.html" %} + {% else %} + {% include "blocks/bs_field_snippet.html" %} + {% endif %} + {% endfor %} +
+
+{% endblock %} + diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index a7a705f59..6707124f9 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -25,7 +25,7 @@
{% endif %} {% for formsetform in wizard.form.forms %} - {% bs_form formsetform %} + {% bs_form formsetform forloop.counter0 %} {% endfor %}