2024-06-14 15:41:00 +00:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
|
|
|
{% block title %}New OrderItem{% endblock %}
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
<h1>Create new OrderItem</h1>
|
|
|
|
|
|
|
|
{{ include('order_item/_form.html.twig') }}
|
|
|
|
|
2024-06-26 18:12:27 +00:00
|
|
|
<div>
|
|
|
|
<b>click a button to select a given menuitem</b>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
{% for menuItem in menuItems %}
|
2024-06-27 21:33:32 +00:00
|
|
|
<a href="#" data-menu-item>{{ menuItem.name }}</a>
|
2024-06-26 18:12:27 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2024-06-14 16:48:32 +00:00
|
|
|
<a class="button" href="{{ path('app_food_order_show', { 'id': food_order.id}) }}">back to list</a>
|
2024-06-26 18:12:27 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
document.querySelectorAll('[data-menu-item]').forEach(function(element) {
|
|
|
|
element.addEventListener('click', function(e) {
|
2024-06-27 21:33:32 +00:00
|
|
|
e.preventDefault();
|
2024-06-26 18:12:27 +00:00
|
|
|
document.getElementById('order_item_name').value = e.target.textContent
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2024-06-14 15:41:00 +00:00
|
|
|
{% endblock %}
|