{% 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 %}