{% import "partials/fields.html" as f %} {% import "partials/lanelet_search.html" as ls %} {% import "partials/icons.html" as ic %} {%- set spawn_slot = document.lanelet_slot(target.id ~ '.spawn') -%} {%- set goal_slot = document.lanelet_slot(target.id ~ '.goal') -%}
{# Outside the form above, because the search built in here is made of forms and a form cannot nest. The two halves find each other by id. #} {% call f.lanelet_modal('spawn_lanelet_id', target.spawn.lanelet_id, draft, 'spawn lanelet') %} {{ ls.chooser(spawn_slot, draft, document, selected) }} {# Where along the lanelet, under the same heading as which lanelet: it is one question -- where does this vehicle start -- and one panel answering it. Its own form, because the panel is shown outside the inspector's. #} {% endcall %} {% if target.kind == 'ego' %} {# The goal's map, outside the form for the same reason the spawn's is. A goal that has not been chosen yet still gets the panel: a search is *how* a goal is chosen, so it cannot be made to wait until one has been pinned. #} {% call f.lanelet_modal('goal_lanelet_id', target.goal.lanelet_id if target.goal else none, draft, 'Goal lanelet') %} {{ ls.chooser(goal_slot, draft, document, selected) }} {% endcall %} {% endif %} {% if target.kind != 'ego' or document.entities|length > 1 %} {% endif %}