diff options
Diffstat (limited to 'ishtar_common/templates/ishtar')
| -rw-r--r-- | ishtar_common/templates/ishtar/forms/qa_base.html | 8 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/forms/qa_new_item.html | 27 |
2 files changed, 34 insertions, 1 deletions
diff --git a/ishtar_common/templates/ishtar/forms/qa_base.html b/ishtar_common/templates/ishtar/forms/qa_base.html index 367acfcd8..57e2d3979 100644 --- a/ishtar_common/templates/ishtar/forms/qa_base.html +++ b/ishtar_common/templates/ishtar/forms/qa_base.html @@ -9,7 +9,7 @@ </button> </div> <form enctype="multipart/form-data" action="{{url}}" method="post" - id="qa-action">{% csrf_token %} + id="qa-{% if slug %}new-{{slug}}{% else %}action{% endif %}">{% csrf_token %} <div class="modal-body body-scroll"> <div class='form'> {% block main_form %} @@ -69,7 +69,13 @@ {% block js %} {% endblock %} $(document).ready(function(){ + {% if slug %} + qa_action_register("{{url}}", "{{slug}}"); + {% else %}} qa_action_register("{{url}}"); + {% endif %} + {% block js_ready %} + {% endblock %} }); </script> diff --git a/ishtar_common/templates/ishtar/forms/qa_new_item.html b/ishtar_common/templates/ishtar/forms/qa_new_item.html new file mode 100644 index 000000000..78162d759 --- /dev/null +++ b/ishtar_common/templates/ishtar/forms/qa_new_item.html @@ -0,0 +1,27 @@ +{% extends "ishtar/forms/qa_base.html" %} +{% load i18n inline_formset table_form %} + +{% block main_form %} +{% if new_item_label %} +<p>{{new_item_label}} {% trans "created." %}</p> +{% else %} + {% bs_compact_form form %} +{% endif %} +{% endblock %} + +{% block footer %} +{% if new_item_label %} +<button type="button" data-dismiss="modal" + aria-label="Close" class="btn btn-secondary"> + {% trans "Close" %} +</button> +{% else %} + {{ block.super }} +{% endif %} +{% endblock %} + +{% block js_ready %} +{% if new_item_label %} +save_and_close_window{% if many %}_many{% endif %}_data(null, "{{parent_name}}", "{{parent_pk}}", "{{new_item_label|safe}}", "{{new_item_pk}}"); +{% endif %} +{% endblock %}
\ No newline at end of file |
