summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-05-28 16:58:42 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:49:36 +0200
commitf5634457ef7882cbc9fcb30d0e12a61d4f13498a (patch)
treec616f2686db785b7b1103beb85636d1891cc354c /ishtar_common/templates
parent4fba7337a52de2efd795b24cb9cd2797b1427987 (diff)
downloadIshtar-f5634457ef7882cbc9fcb30d0e12a61d4f13498a.tar.bz2
Ishtar-f5634457ef7882cbc9fcb30d0e12a61d4f13498a.zip
User profile form: duplicate, delete and edit
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/blocks/bs_form_snippet.html4
-rw-r--r--ishtar_common/templates/ishtar/forms/profile.html51
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html2
3 files changed, 54 insertions, 3 deletions
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 %}
</div>{% endif %}
<h3>{{field.name|from_dict:form.HEADERS|call:'render'}}</h3>
-<div class="form-row">
+<div class="form-row{% if odd %} odd{% endif %}">
{% elif not search and not forloop.counter0 or search and forloop.counter0 == 1 %}
- <div class="form-row">
+ <div class="form-row{% if odd %} odd{% endif %}">
{% 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 %}
+<script type='text/javascript'>
+var base_profile_url = "{% url 'profile' %}";
+$(document).ready(function(){
+ $("#id_current_profile").change(function(){
+ var profile_id = $("#id_current_profile option:selected").val();
+ window.location.href = base_profile_url + profile_id + "/";
+ });
+});
+</script>
+{% endblock %}
+
+{% block content %}
+<h2>{{page_name}}</h2>
+<div class='form'>
+
+ {% if form.non_field_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{form.non_field_errors}}
+ </div>
+ {% endif %}
+
+ {% for hidden in form.hidden_fields %}
+ {{hidden}}
+ {% if hidden.errors %}<div class="invalid-feedback">
+ {{ hidden.errors }}
+ </div>{% endif %}
+ {% endfor %}
+
+ <div class="form-row">
+ {% for field in form.visible_fields %}
+ {% if forloop.counter0 == 0 %}
+ <div class="form-group col-lg-12">
+ {{field|safe}}
+ </div>
+ </div>
+ <div class="form-row">
+ {% elif field.name == 'delete_profile' %}
+ </div>
+ <div class="form-row col-lg-6 alert alert-danger">
+ {% include "blocks/bs_field_snippet.html" %}
+ {% else %}
+ {% include "blocks/bs_field_snippet.html" %}
+ {% endif %}
+ {% endfor %}
+ </div>
+</div>
+{% 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 @@
</div>
{% endif %}
{% for formsetform in wizard.form.forms %}
- {% bs_form formsetform %}
+ {% bs_form formsetform forloop.counter0 %}
{% endfor %}
<button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
{% trans "Add/Modify" %}