summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/templates/ishtar/wizard/wizard_container.html
blob: cf9d4122ea34f94aa6fbcbf3c1c0260aae84c421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{% extends "ishtar/wizard/default_wizard.html" %}
{% load i18n replace_underscore %}

{% block "js_extra_generic" %}
var constraint_on_parent = function(){
    var warehouse_location_id = $("#id_{{wizard.steps.current}}-location").val();
    if (!warehouse_location_id) return;

    var parent_search_url = source_{{wizard.steps.current|replace_underscore}}_parent;
    parent_search_url += warehouse_location_id;
    $("#id_select_{{wizard.steps.current}}-parent").autocomplete(
        "option", "source", parent_search_url);
    var ctips;
    if (current_label_{{wizard.steps.current|replace_underscore}}_location){
        ctips = current_label_{{wizard.steps.current|replace_underscore}}_location;
    } else {
        ctips = $("#id_{{wizard.steps.current}}-location_previous_label").val();
    }
    $("#id_{{wizard.steps.current}}-parent-tips").html(ctips);
}
{% endblock %}
{% block "js_extra_ready" %}

constraint_on_parent();
$("#id_{{wizard.steps.current}}-location").change(constraint_on_parent);
{% endblock %}