add option to select previous menuitems
All checks were successful
/ ls (pull_request) Successful in 33s
/ ls (push) Successful in 29s

This commit is contained in:
lubiana 2024-06-26 20:12:27 +02:00
parent 57b4e33028
commit 45029e0a4c
No known key found for this signature in database
11 changed files with 410 additions and 94 deletions

View file

@ -7,10 +7,6 @@
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ food_vendor.id }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ food_vendor.name }}</td>

View file

@ -7,5 +7,24 @@
{{ include('order_item/_form.html.twig') }}
<div>
<b>click a button to select a given menuitem</b>
</div>
<div>
{% for menuItem in menuItems %}
<button data-menu-item>{{ menuItem.name }}</button>
{% endfor %}
</div>
<hr />
<a class="button" href="{{ path('app_food_order_show', { 'id': food_order.id}) }}">back to list</a>
<script>
document.querySelectorAll('[data-menu-item]').forEach(function(element) {
element.addEventListener('click', function(e) {
document.getElementById('order_item_name').value = e.target.textContent
});
});
</script>
{% endblock %}