|
|
|
@ -47,5 +47,26 @@ $(document).ready(function () {
|
|
|
|
|
closeOnSelect: false
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.on("submit", "form", function (evt) {
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
var the_url = '{% url 'api-users:user-group-list' %}';
|
|
|
|
|
var redirect_to = '{% url "users:user-group-list" %}';
|
|
|
|
|
var method = "POST";
|
|
|
|
|
{% if type == "update" %}
|
|
|
|
|
the_url = '{% url 'api-users:user-group-detail' pk=object.id %}';
|
|
|
|
|
method = "PUT";
|
|
|
|
|
{% endif %}
|
|
|
|
|
var form = $("form");
|
|
|
|
|
var data = form.serializeObject();
|
|
|
|
|
objectAttrsIsList(data, ['users']);
|
|
|
|
|
var props = {
|
|
|
|
|
url: the_url,
|
|
|
|
|
data: data,
|
|
|
|
|
method: method,
|
|
|
|
|
form: form,
|
|
|
|
|
redirect_to: redirect_to
|
|
|
|
|
};
|
|
|
|
|
formSubmit(props);
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|
|
|
|
|