Update templates/order_history.html (#2)
Browse files- Update templates/order_history.html (9834f2f04c3a55929b84a23f52b0abb949426672)
Co-authored-by: lokesh surya sai sirigineedi <[email protected]>
- templates/order_history.html +134 -131
    	
        templates/order_history.html
    CHANGED
    
    | @@ -1,126 +1,117 @@ | |
| 1 | 
            -
            <!DOCTYPE html>
         | 
| 2 | 
             
            <html lang="en">
         | 
| 3 | 
             
            <head>
         | 
| 4 | 
             
                <meta charset="UTF-8">
         | 
| 5 | 
            -
                <meta name="viewport" content="width=device-width, initial-scale=1 | 
| 6 | 
             
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
         | 
| 7 | 
             
                <title>Order History</title>
         | 
| 8 | 
             
                <style>
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 9 | 
             
                    body {
         | 
| 10 | 
             
                        font-family: Arial, sans-serif;
         | 
| 11 | 
            -
                        background-color: # | 
| 12 | 
             
                        margin: 0;
         | 
| 13 | 
             
                        padding: 0;
         | 
| 14 | 
             
                    }
         | 
| 15 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 16 | 
             
                    .container {
         | 
| 17 | 
            -
                        width:  | 
| 18 | 
            -
                         | 
| 19 | 
            -
                         | 
| 20 | 
            -
                         | 
| 21 | 
            -
                         | 
|  | |
| 22 | 
             
                        border-radius: 8px;
         | 
| 23 | 
             
                    }
         | 
| 24 | 
            -
             | 
| 25 | 
             
                    .order-item {
         | 
| 26 | 
            -
                        padding:  | 
| 27 | 
            -
                        border: 1px solid #6c757d; | 
| 28 | 
            -
                        margin-bottom:  | 
| 29 | 
             
                        border-radius: 5px;
         | 
| 30 | 
             
                    }
         | 
| 31 | 
            -
             | 
| 32 | 
             
                    .order-details {
         | 
| 33 | 
            -
                        font-size:  | 
| 34 | 
             
                        font-weight: bold;
         | 
| 35 | 
            -
                        color:  | 
| 36 | 
             
                    }
         | 
| 37 | 
            -
             | 
| 38 | 
             
                    .order-details p {
         | 
| 39 | 
            -
                        margin:  | 
| 40 | 
             
                    }
         | 
| 41 | 
            -
             | 
| 42 | 
             
                    .order-date-time {
         | 
| 43 | 
            -
                        font-size:  | 
| 44 | 
            -
                        color:  | 
| 45 | 
             
                    }
         | 
| 46 | 
            -
             | 
| 47 | 
             
                    .order-price {
         | 
| 48 | 
            -
                        font-size:  | 
| 49 | 
             
                        font-weight: bold;
         | 
| 50 | 
            -
                        color:  | 
| 51 | 
            -
                        margin:  | 
| 52 | 
             
                    }
         | 
| 53 | 
            -
             | 
| 54 | 
            -
                  .order-status p {
         | 
| 55 | 
            -
                margin: 5px 0;
         | 
| 56 | 
            -
            }
         | 
| 57 | 
            -
             | 
| 58 | 
            -
            .order-status .status-label {
         | 
| 59 | 
            -
                color: lightgrey;  /* Light grey color for "Status:" label */
         | 
| 60 | 
            -
                font-weight: normal;  /* Optional: make the label less bold */
         | 
| 61 | 
            -
            }
         | 
| 62 | 
            -
             | 
| 63 | 
             
                    .order-status {
         | 
| 64 | 
            -
                        font-size:  | 
| 65 | 
             
                        font-weight: bold;
         | 
| 66 | 
            -
                         | 
| 67 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
| 68 | 
             
                    }
         | 
| 69 | 
            -
             | 
| 70 | 
             
                    .order-buttons {
         | 
| 71 | 
            -
                        margin-top:  | 
| 72 | 
             
                    }
         | 
| 73 | 
            -
             | 
| 74 | 
             
                    .reorder-btn, .rate-order-btn {
         | 
| 75 | 
             
                        background-color: #ff7f00;
         | 
| 76 | 
             
                        color: white;
         | 
| 77 | 
             
                        border: none;
         | 
| 78 | 
            -
                        padding:  | 
| 79 | 
            -
                        margin-right:  | 
| 80 | 
             
                        cursor: pointer;
         | 
| 81 | 
             
                        border-radius: 4px;
         | 
| 82 | 
             
                    }
         | 
| 83 | 
            -
             | 
| 84 | 
             
                    .reorder-btn:hover, .rate-order-btn:hover {
         | 
| 85 | 
             
                        background-color: #f55b00;
         | 
| 86 | 
             
                    }
         | 
| 87 | 
            -
             | 
| 88 | 
             
                    .total-price {
         | 
| 89 | 
            -
                        font-size:  | 
| 90 | 
             
                        font-weight: bold;
         | 
| 91 | 
             
                        color: #333;
         | 
| 92 | 
            -
                        margin-top:  | 
| 93 | 
             
                    }
         | 
| 94 | 
            -
             | 
| 95 | 
             
                    .order-heading {
         | 
| 96 | 
            -
                        font-size:  | 
| 97 | 
             
                        font-weight: bold;
         | 
| 98 | 
            -
                        color:  | 
| 99 | 
            -
                        margin-bottom:  | 
| 100 | 
             
                        text-align: center;
         | 
| 101 | 
             
                    }
         | 
| 102 | 
            -
             | 
| 103 | 
            -
                    .back-button {
         | 
| 104 | 
            -
                        display: inline-block;
         | 
| 105 | 
            -
                        background-color: green;
         | 
| 106 | 
            -
                        color: white;
         | 
| 107 | 
            -
                        padding: 10px 20px;
         | 
| 108 | 
            -
                        text-decoration: none;
         | 
| 109 | 
            -
                        font-weight: bold;
         | 
| 110 | 
            -
                        border-radius: 4px;
         | 
| 111 | 
            -
                        margin-bottom: 20px;
         | 
| 112 | 
            -
                    }
         | 
| 113 | 
            -
             | 
| 114 | 
            -
                    .back-button:hover {
         | 
| 115 | 
            -
                        background-color: darkgreen;
         | 
| 116 | 
            -
                    }
         | 
| 117 | 
            -
             | 
| 118 | 
            -
                    /* Hide additional orders by default */
         | 
| 119 | 
            -
                    .more-orders {
         | 
| 120 | 
            -
                        display: none;
         | 
| 121 | 
            -
                    }
         | 
| 122 | 
            -
             | 
| 123 | 
            -
                    /* Style for the Show More/Show Less button */
         | 
| 124 | 
             
                    .show-more-btn {
         | 
| 125 | 
             
                        background-color: #ff7f00;
         | 
| 126 | 
             
                        color: white;
         | 
| @@ -129,93 +120,106 @@ | |
| 129 | 
             
                        cursor: pointer;
         | 
| 130 | 
             
                        border-radius: 4px;
         | 
| 131 | 
             
                        margin-top: 20px;
         | 
| 132 | 
            -
             | 
| 133 | 
             
                    }
         | 
| 134 | 
            -
             | 
| 135 | 
             
                    .show-more-btn:hover {
         | 
| 136 | 
             
                        background-color: #f55b00;
         | 
| 137 | 
             
                    }
         | 
| 138 | 
            -
             | 
| 139 | 
            -
                    @media (max-width:  | 
| 140 | 
            -
                        . | 
| 141 | 
            -
                             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 142 | 
             
                        }
         | 
| 143 | 
             
                        .order-heading {
         | 
| 144 | 
            -
                            font-size:  | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 145 | 
             
                        }
         | 
| 146 | 
             
                    }
         | 
| 147 | 
             
                </style>
         | 
| 148 | 
             
            </head>
         | 
| 149 | 
             
            <body>
         | 
| 150 |  | 
| 151 | 
            -
             | 
|  | |
|  | |
| 152 |  | 
| 153 | 
            -
            <div class="container">
         | 
| 154 | 
            -
             | 
| 155 | 
            -
                
         | 
| 156 | 
            -
                <!-- Loop through the orders (first 3) -->
         | 
| 157 | 
            -
                {% for order in orders[:3] %}
         | 
| 158 | 
            -
                <div class="order-item">
         | 
| 159 | 
            -
                    <!-- Order details: item names and quantities -->
         | 
| 160 | 
            -
                    <div class="order-details">
         | 
| 161 | 
            -
                        <p>{{ order.formatted_items }}</p>
         | 
| 162 | 
            -
                    </div>
         | 
| 163 | 
            -
             | 
| 164 | 
            -
                    <!-- Order date and time -->
         | 
| 165 | 
            -
                    <div class="order-date-time">
         | 
| 166 | 
            -
                      <p>{{ order.formatted_date }}</p>        
         | 
| 167 | 
            -
                    </div>
         | 
| 168 | 
            -
             | 
| 169 | 
            -
                    <!-- Total price -->
         | 
| 170 | 
            -
                    <div class="order-price">
         | 
| 171 | 
            -
                        <p>Total: ₹{{ order.Total_Bill__c }}</p>
         | 
| 172 | 
            -
                    </div>
         | 
| 173 |  | 
| 174 | 
            -
                     | 
| 175 | 
            -
                     | 
| 176 | 
            -
                </div>  
         | 
| 177 | 
            -
                  
         | 
| 178 | 
            -
                </div>
         | 
| 179 | 
            -
                {% endfor %}
         | 
| 180 | 
            -
             | 
| 181 | 
            -
                <!-- Loop through the remaining orders (hidden initially) -->
         | 
| 182 | 
            -
                <div class="more-orders" id="more-orders">
         | 
| 183 | 
            -
                    {% for order in orders[3:] %}
         | 
| 184 | 
             
                    <div class="order-item">
         | 
| 185 | 
            -
                        <!-- Order details: item names and quantities -->
         | 
| 186 | 
             
                        <div class="order-details">
         | 
| 187 | 
             
                            <p>{{ order.formatted_items }}</p>
         | 
| 188 | 
             
                        </div>
         | 
| 189 |  | 
| 190 | 
            -
                        <!-- Order date and time -->
         | 
| 191 | 
             
                        <div class="order-date-time">
         | 
| 192 | 
            -
             | 
| 193 | 
             
                        </div>
         | 
| 194 |  | 
| 195 | 
            -
                        <!-- Total price -->
         | 
| 196 | 
             
                        <div class="order-price">
         | 
| 197 | 
             
                            <p>Total: ₹{{ order.Total_Bill__c }}</p>
         | 
| 198 | 
             
                        </div>
         | 
| 199 |  | 
| 200 | 
            -
                         | 
| 201 | 
            -
             | 
| 202 | 
            -
             | 
| 203 | 
            -
                </div>
         | 
| 204 | 
             
                    </div>
         | 
| 205 | 
             
                    {% endfor %}
         | 
| 206 | 
            -
                </div>
         | 
| 207 |  | 
| 208 | 
            -
             | 
| 209 | 
            -
             | 
| 210 | 
            -
             | 
| 211 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 212 |  | 
| 213 | 
            -
             | 
| 214 | 
            -
             | 
| 215 | 
            -
             | 
| 216 | 
            -
             | 
|  | |
|  | |
| 217 | 
             
                </div>
         | 
| 218 | 
            -
                {% endif %}
         | 
| 219 | 
             
            </div>
         | 
| 220 |  | 
| 221 | 
             
            <script>
         | 
| @@ -223,7 +227,6 @@ | |
| 223 | 
             
              function toggleOrders() {
         | 
| 224 | 
             
                const moreOrders = document.getElementById("more-orders");
         | 
| 225 | 
             
                const button = document.querySelector(".show-more-btn");
         | 
| 226 | 
            -
             | 
| 227 | 
             
                if (moreOrders.style.display === "none") {
         | 
| 228 | 
             
                  moreOrders.style.display = "block";
         | 
| 229 | 
             
                  button.innerHTML = "Show Less";  // Change button text
         | 
| @@ -235,4 +238,4 @@ | |
| 235 | 
             
            </script>
         | 
| 236 |  | 
| 237 | 
             
            </body>
         | 
| 238 | 
            -
            </html>
         | 
|  | |
|  | |
| 1 | 
             
            <html lang="en">
         | 
| 2 | 
             
            <head>
         | 
| 3 | 
             
                <meta charset="UTF-8">
         | 
| 4 | 
            +
                <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
         | 
| 5 | 
             
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
         | 
| 6 | 
             
                <title>Order History</title>
         | 
| 7 | 
             
                <style>
         | 
| 8 | 
            +
                    /* Reset padding and margin for all elements */
         | 
| 9 | 
            +
                    * {
         | 
| 10 | 
            +
                        margin: 0;
         | 
| 11 | 
            +
                        padding: 0;
         | 
| 12 | 
            +
                        box-sizing: border-box;
         | 
| 13 | 
            +
                    }
         | 
| 14 | 
             
                    body {
         | 
| 15 | 
             
                        font-family: Arial, sans-serif;
         | 
| 16 | 
            +
                        background-color: #fdf4e3; /* Light orange background for the whole page */
         | 
| 17 | 
             
                        margin: 0;
         | 
| 18 | 
             
                        padding: 0;
         | 
| 19 | 
             
                    }
         | 
| 20 | 
            +
                    /* Light Orange Background for the back-side */
         | 
| 21 | 
            +
                    .background {
         | 
| 22 | 
            +
                        padding: 8vw 0;
         | 
| 23 | 
            +
                        position: relative;
         | 
| 24 | 
            +
                    }
         | 
| 25 | 
            +
                    /* Green Back Button styling */
         | 
| 26 | 
            +
                    .back-button {
         | 
| 27 | 
            +
                        position: absolute;
         | 
| 28 | 
            +
                        top: 15px;
         | 
| 29 | 
            +
                        left: 15px;
         | 
| 30 | 
            +
                        display: inline-block;
         | 
| 31 | 
            +
                        background-color: green; /* Green color */
         | 
| 32 | 
            +
                        color: white;
         | 
| 33 | 
            +
                        padding: 10px 20px;
         | 
| 34 | 
            +
                        text-decoration: none;
         | 
| 35 | 
            +
                        font-weight: bold;
         | 
| 36 | 
            +
                        border-radius: 4px;
         | 
| 37 | 
            +
                        z-index: 10; /* Ensure it stays above other content */
         | 
| 38 | 
            +
                    }
         | 
| 39 | 
            +
                    .back-button:hover {
         | 
| 40 | 
            +
                        background-color: darkgreen; /* Darker green color on hover */
         | 
| 41 | 
            +
                    }
         | 
| 42 | 
            +
                    /* Container */
         | 
| 43 | 
             
                    .container {
         | 
| 44 | 
            +
                        width: 85%; /* Decreased width for smaller template size */
         | 
| 45 | 
            +
                        max-width: 450px; /* Reduced max-width */
         | 
| 46 | 
            +
                        margin: 30px auto 0; /* Added margin-top to push content down */
         | 
| 47 | 
            +
                        padding: 15px;
         | 
| 48 | 
            +
                        background-color: white;
         | 
| 49 | 
            +
                        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
         | 
| 50 | 
             
                        border-radius: 8px;
         | 
| 51 | 
             
                    }
         | 
|  | |
| 52 | 
             
                    .order-item {
         | 
| 53 | 
            +
                        padding: 12px;
         | 
| 54 | 
            +
                        border: 1px solid #6c757d;
         | 
| 55 | 
            +
                        margin-bottom: 12px;
         | 
| 56 | 
             
                        border-radius: 5px;
         | 
| 57 | 
             
                    }
         | 
|  | |
| 58 | 
             
                    .order-details {
         | 
| 59 | 
            +
                        font-size: 14px;
         | 
| 60 | 
             
                        font-weight: bold;
         | 
| 61 | 
            +
                        color: black;
         | 
| 62 | 
             
                    }
         | 
|  | |
| 63 | 
             
                    .order-details p {
         | 
| 64 | 
            +
                        margin: 4px 0;
         | 
| 65 | 
             
                    }
         | 
|  | |
| 66 | 
             
                    .order-date-time {
         | 
| 67 | 
            +
                        font-size: 11px;
         | 
| 68 | 
            +
                        color: black;
         | 
| 69 | 
             
                    }
         | 
|  | |
| 70 | 
             
                    .order-price {
         | 
| 71 | 
            +
                        font-size: 13px;
         | 
| 72 | 
             
                        font-weight: bold;
         | 
| 73 | 
            +
                        color: black;
         | 
| 74 | 
            +
                        margin: 5px 0;
         | 
| 75 | 
             
                    }
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 76 | 
             
                    .order-status {
         | 
| 77 | 
            +
                        font-size: 11px;
         | 
| 78 | 
             
                        font-weight: bold;
         | 
| 79 | 
            +
                        margin-top: 6px;
         | 
| 80 | 
            +
                    }
         | 
| 81 | 
            +
                    .order-status.pending {
         | 
| 82 | 
            +
                        color: green;
         | 
| 83 | 
            +
                    }
         | 
| 84 | 
            +
                    .order-status.completed {
         | 
| 85 | 
            +
                        color: #28a745;
         | 
| 86 | 
             
                    }
         | 
|  | |
| 87 | 
             
                    .order-buttons {
         | 
| 88 | 
            +
                        margin-top: 6px;
         | 
| 89 | 
             
                    }
         | 
|  | |
| 90 | 
             
                    .reorder-btn, .rate-order-btn {
         | 
| 91 | 
             
                        background-color: #ff7f00;
         | 
| 92 | 
             
                        color: white;
         | 
| 93 | 
             
                        border: none;
         | 
| 94 | 
            +
                        padding: 6px 12px;
         | 
| 95 | 
            +
                        margin-right: 8px;
         | 
| 96 | 
             
                        cursor: pointer;
         | 
| 97 | 
             
                        border-radius: 4px;
         | 
| 98 | 
             
                    }
         | 
|  | |
| 99 | 
             
                    .reorder-btn:hover, .rate-order-btn:hover {
         | 
| 100 | 
             
                        background-color: #f55b00;
         | 
| 101 | 
             
                    }
         | 
|  | |
| 102 | 
             
                    .total-price {
         | 
| 103 | 
            +
                        font-size: 14px;
         | 
| 104 | 
             
                        font-weight: bold;
         | 
| 105 | 
             
                        color: #333;
         | 
| 106 | 
            +
                        margin-top: 15px;
         | 
| 107 | 
             
                    }
         | 
|  | |
| 108 | 
             
                    .order-heading {
         | 
| 109 | 
            +
                        font-size: 16px;
         | 
| 110 | 
             
                        font-weight: bold;
         | 
| 111 | 
            +
                        color: #ff7f00;
         | 
| 112 | 
            +
                        margin-bottom: 15px;
         | 
| 113 | 
             
                        text-align: center;
         | 
| 114 | 
             
                    }
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 115 | 
             
                    .show-more-btn {
         | 
| 116 | 
             
                        background-color: #ff7f00;
         | 
| 117 | 
             
                        color: white;
         | 
|  | |
| 120 | 
             
                        cursor: pointer;
         | 
| 121 | 
             
                        border-radius: 4px;
         | 
| 122 | 
             
                        margin-top: 20px;
         | 
| 123 | 
            +
                        font-weight: bold;
         | 
| 124 | 
             
                    }
         | 
|  | |
| 125 | 
             
                    .show-more-btn:hover {
         | 
| 126 | 
             
                        background-color: #f55b00;
         | 
| 127 | 
             
                    }
         | 
| 128 | 
            +
                    /* Responsive design adjustments */
         | 
| 129 | 
            +
                    @media (max-width: 480px) {
         | 
| 130 | 
            +
                        .container {
         | 
| 131 | 
            +
                            width: 90%;
         | 
| 132 | 
            +
                            margin: 30px auto 0;
         | 
| 133 | 
            +
                            padding: 10px;
         | 
| 134 | 
            +
                        }
         | 
| 135 | 
            +
                        .order-details {
         | 
| 136 | 
            +
                            font-size: 12px;
         | 
| 137 | 
            +
                        }
         | 
| 138 | 
            +
                        .order-price {
         | 
| 139 | 
            +
                            font-size: 12px;
         | 
| 140 | 
            +
                        }
         | 
| 141 | 
            +
                        .order-status {
         | 
| 142 | 
            +
                            font-size: 10px;
         | 
| 143 | 
             
                        }
         | 
| 144 | 
             
                        .order-heading {
         | 
| 145 | 
            +
                            font-size: 14px;
         | 
| 146 | 
            +
                        }
         | 
| 147 | 
            +
                        .show-more-btn {
         | 
| 148 | 
            +
                            padding: 6px 12px;
         | 
| 149 | 
            +
                        }
         | 
| 150 | 
            +
                        .back-button {
         | 
| 151 | 
            +
                            top: 10px;
         | 
| 152 | 
            +
                            left: 10px;
         | 
| 153 | 
            +
                            padding: 8px 16px;
         | 
| 154 | 
             
                        }
         | 
| 155 | 
             
                    }
         | 
| 156 | 
             
                </style>
         | 
| 157 | 
             
            </head>
         | 
| 158 | 
             
            <body>
         | 
| 159 |  | 
| 160 | 
            +
            <!-- Background container with light orange -->
         | 
| 161 | 
            +
            <div class="background">
         | 
| 162 | 
            +
                <a href="{{ url_for('menu') }}" class="back-button"><i class="fa fa-arrow-left"></i></a>
         | 
| 163 |  | 
| 164 | 
            +
                <div class="container">
         | 
| 165 | 
            +
                    <div class="order-heading">Order History</div>
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 166 |  | 
| 167 | 
            +
                    <!-- Loop through the orders (first 3) -->
         | 
| 168 | 
            +
                    {% for order in orders[:3] %}
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 169 | 
             
                    <div class="order-item">
         | 
|  | |
| 170 | 
             
                        <div class="order-details">
         | 
| 171 | 
             
                            <p>{{ order.formatted_items }}</p>
         | 
| 172 | 
             
                        </div>
         | 
| 173 |  | 
|  | |
| 174 | 
             
                        <div class="order-date-time">
         | 
| 175 | 
            +
                            <p>{{ order.formatted_date }}</p>
         | 
| 176 | 
             
                        </div>
         | 
| 177 |  | 
|  | |
| 178 | 
             
                        <div class="order-price">
         | 
| 179 | 
             
                            <p>Total: ₹{{ order.Total_Bill__c }}</p>
         | 
| 180 | 
             
                        </div>
         | 
| 181 |  | 
| 182 | 
            +
                        <div class="order-status {% if order.order_status == 'Pending' %}pending{% else %}completed{% endif %}">
         | 
| 183 | 
            +
                            <p>Status: {{ order.order_status }}</p>
         | 
| 184 | 
            +
                        </div>
         | 
|  | |
| 185 | 
             
                    </div>
         | 
| 186 | 
             
                    {% endfor %}
         | 
|  | |
| 187 |  | 
| 188 | 
            +
                    <!-- Loop through the remaining orders (hidden initially) -->
         | 
| 189 | 
            +
                    <div class="more-orders" id="more-orders">
         | 
| 190 | 
            +
                        {% for order in orders[3:] %}
         | 
| 191 | 
            +
                        <div class="order-item">
         | 
| 192 | 
            +
                            <div class="order-details">
         | 
| 193 | 
            +
                                <p>{{ order.formatted_items }}</p>
         | 
| 194 | 
            +
                            </div>
         | 
| 195 | 
            +
             | 
| 196 | 
            +
                            <div class="order-date-time">
         | 
| 197 | 
            +
                                <p>Order Placed: {{ order.formatted_date }}</p>
         | 
| 198 | 
            +
                            </div>
         | 
| 199 | 
            +
             | 
| 200 | 
            +
                            <div class="order-price">
         | 
| 201 | 
            +
                                <p>Total: ₹{{ order.Total_Bill__c }}</p>
         | 
| 202 | 
            +
                            </div>
         | 
| 203 | 
            +
             | 
| 204 | 
            +
                            <div class="order-status {% if order.order_status == 'Pending' %}pending{% else %}completed{% endif %}">
         | 
| 205 | 
            +
                                <p>Status: {{ order.order_status }}</p>
         | 
| 206 | 
            +
                            </div>
         | 
| 207 | 
            +
                        </div>
         | 
| 208 | 
            +
                        {% endfor %}
         | 
| 209 | 
            +
                    </div>
         | 
| 210 | 
            +
             | 
| 211 | 
            +
                    <!-- Show More button -->
         | 
| 212 | 
            +
                    {% if orders|length > 3 %}
         | 
| 213 | 
            +
                    <button class="show-more-btn" onclick="toggleOrders()">Show More</button>
         | 
| 214 | 
            +
                    {% endif %}
         | 
| 215 |  | 
| 216 | 
            +
                    <!-- If no orders exist -->
         | 
| 217 | 
            +
                    {% if not orders %}
         | 
| 218 | 
            +
                    <div class="no-orders">
         | 
| 219 | 
            +
                        <p>No orders found.</p>
         | 
| 220 | 
            +
                    </div>
         | 
| 221 | 
            +
                    {% endif %}
         | 
| 222 | 
             
                </div>
         | 
|  | |
| 223 | 
             
            </div>
         | 
| 224 |  | 
| 225 | 
             
            <script>
         | 
|  | |
| 227 | 
             
              function toggleOrders() {
         | 
| 228 | 
             
                const moreOrders = document.getElementById("more-orders");
         | 
| 229 | 
             
                const button = document.querySelector(".show-more-btn");
         | 
|  | |
| 230 | 
             
                if (moreOrders.style.display === "none") {
         | 
| 231 | 
             
                  moreOrders.style.display = "block";
         | 
| 232 | 
             
                  button.innerHTML = "Show Less";  // Change button text
         | 
|  | |
| 238 | 
             
            </script>
         | 
| 239 |  | 
| 240 | 
             
            </body>
         | 
| 241 | 
            +
            </html>
         | 
