{% extends 'base_structure/layout/base_template.html' %}
{% load static %}
{% block stylesheet %}
<!-- include required css cdn link through html here -->

{% endblock %}

{% block content %}


<div class="row layout-top-spacing">
    <div class="col-lg-12">
        <div class="row mb-2">
            <div class="col">
                <a onclick="history.back()" style="height: fit-content;width: fit-content;display: inline-block;">
                <h3 class="card-title m-2 d-flex align-items-center gap-2" style="width: fit-content;">
                    <span class="fw-bold material-symbols-outlined">
                    arrow_back
                    </span><span>Meal Details</span></h3>
                </a>
            </div>
        </div>

        <div class="row layout-spacing">
            <div class="col-lg-12">
                <div class="statbox widget box box-shadow">
                    <div class="widget-content widget-content-area">
                        <div class="row Users-tab p-4">
                            <div class="col-md-12">
                                <!-- Meal Details Card -->
                                <div class="card mb-4">
                                    <div class="card-header">
                                        <h2 class="card-title">Meal Details</h2>
                                    </div>
                                    <div class="card-body">
                                        <p><strong>Meal Type:</strong> {{ obj.meal_type }}</p>
                                        <p><strong>Date:</strong> {{ obj.date }}</p>
                                        <p><strong>Time:</strong> {{ obj.time }}</p>
                                    </div>
                                </div>
                                
                                <!-- Food Items Card -->
                                <div class="card mb-4">
                                    <div class="card-header">
                                        <h2 class="card-title">Food Items</h2>
                                    </div>
                                    <div class="card-body">
                                        <div class="row">
                                            {% for food_record in obj.food_records.all %}
                                            <div class="col-md-6">
                                                <div class="food-item">
                                                    <h3>{{ food_record.name }}</h3>
                                                    <p>Quantity: {{ food_record.quantity }}</p>
                                                </div>
                                            </div>
                                            {% endfor %}
                                        </div>
                                    </div>
                                </div>
                            
                                <!-- Beverages Card -->
                                <div class="card mb-4">
                                    <div class="card-header">
                                        <h2 class="card-title">Beverages</h2>
                                    </div>
                                    <div class="card-body">
                                        <div class="row">
                                            {% for beverage_record in obj.beverage_records.all %}
                                            <div class="col-md-6">
                                                <div class="beverage-item">
                                                    <h3>{{ beverage_record.beverage_type }}</h3>
                                                    <p>Quantity: {{ beverage_record.quantity }} {{beverage_record.quantity_measure}}</p>
                                                    <p>Glass Type: {{ beverage_record.glass_type }}</p>
                                                    <p>Glass Count: {{ beverage_record.glass_count }}</p>
                                                </div>
                                            </div>
                                            {% endfor %}
                                        </div>
                                    </div>
                                </div>
                            
                                <!-- Ingredients Card -->
                                <div class="card mb-4">
                                    <div class="card-header">
                                        <h2 class="card-title">Ingredients</h2>
                                    </div>
                                    <div class="card-body">
                                        <div class="row">
                                            {% for food_ingredient_record in obj.food_ingredient_records.all %}
                                            <div class="col-md-4">
                                                <div class="ingredient-item">
                                                    <h3>{{ food_ingredient_record.name }}</h3>
                                                </div>
                                            </div>
                                            {% endfor %}
                                        </div>
                                    </div>
                                </div>
                            
                            </div>
                            
                        </div>
                </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


{% endblock content %}

{% block javascript %}
<!-- include required js cdn link through html here -->


<script>

</script>
{% endblock %}