futtern/templates/order_item/new.html.twig

40 lines
1 KiB
Twig
Raw Normal View History

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-08-16 19:52:53 +00:00
<hr />
{% if food_order.foodVendor.menuLink != '' %}
<a href="{{ food_order.foodVendor.menuLink }}" target="_blank">
External link to Menu
</a>
{% endif %}
<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>
{% 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) {
2024-06-27 21:33:32 +00:00
e.preventDefault();
document.getElementById('order_item_name').value = e.target.textContent
});
});
</script>
2024-06-14 15:41:00 +00:00
{% endblock %}