<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OpenKDS &raquo; Items</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    
    <style>
        
        body {
            background-color: #f8f9fa;
        }
        
        
        
        
    </style>
    
</head>
<body>
    
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="#">OpenKDS</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="/web/dashboard">Dashboard</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/web/stations">Stations</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/web/stationtypes">Station Types</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/web/orders">Orders</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link active" href="/web/items">Menu Items</a>
                </li>
            </ul>
        </div>
    </nav>
    
    <div class="container">
        <div class="row">
            <div class="col-12">
                <h1>Items</h1>
                <p>Edit your items here. You can edit the price and station type.</p>
                <a href="/web/items/create" class="btn btn-primary">Create Item</a>
            </div>
        </div>
    </div>
    
    <hr />
    
    <div class="container">
        <table class="table">
            <tr>
                <td>ID</td>
                <td>Name</td>
                <td>Station Type</td>
                <td>Price</td>
                <td>Actions</td>
            </tr>
            <% for (let i = 0; i < items.length; i++) { %>
                <tr>
                    <td><%= items[i].id %></td>
                    <td><%= items[i].name %></td>
                    <td><a href="/web/stationtypes/<%= items[i].stationType.id %>/edit"><%= items[i].stationType.name %></a></td>
                    <td><%= items[i].price %></td>
                    <td>
                        <a href="/web/items/<%= items[i].id %>/edit" class="btn btn-primary">Edit</a>
                        <a href="/web/items/<%= items[i].id %>/delete" class="btn btn-danger">Delete</a>
                    </td>
                </tr>
            <% } %>


        </table>
        
        


        
        
    </div>
    
    
</body>
</html>