<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8" />
        <title id="title"></title>
        
        
        <!-- Material Icons -->
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
        <!-- Material Symbols - Outlined Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
        <!-- Material Symbols - Rounded Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded" rel="stylesheet" />
        <!-- Material Symbols - Sharp Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp" rel="stylesheet" />
        
        <link rel="stylesheet" href="{{ url_for('static', filename='css/uikit.min.css') }}"/>

        <script src="{{ url_for('static', filename='js/uikit.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/uikit-icons.min.js') }}"></script>

    </head>
    <body>
        <div uk-sticky="sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky">
            <nav class="uk-navbar-container">
                <div class="uk-container uk-container-expand">
                    <div uk-navbar="dropbar: true">
                        <div id="offcanvas-slide" uk-offcanvas="mode: slide; overlay: true">
                            <div class="uk-offcanvas-bar uk-flex uk-flex-column">
                                <ul class="uk-nav uk-nav-secondary">  
                                    <img class="uk-align-center uk-border-circle" data-src="{{ url_for('static', filename='pictures/logo.jpg') }}" style="width: 150px; height: auto;" uk-img />
                                    <li class="uk-nav-header">Apps</li>
                                    <li><a href="/shopping-lists">Shopping Lists</a></li>
                                    <li><a href="/groups">Groups</a></li>
                                    <li><a href="/recipes">Recipes</a></li>
                                    <li class="uk-nav-header">Logistics</li>
                                    <li>
                                    <a href="/items">
                                        <div class="uk-active">Items<div class="uk-nav-subtitle" disabled>You are currently viewing transactions...</div>
                                    </div>
                                    </a>
                                    </li>
                                    <li><a href="/add_transaction">Add Transaction</a></li>
                                    <li><a href="/workshop">Workshop</a></li>
                                    <li><a href="/receipts">Receipts</a></li>
                                    <li class="uk-nav-header">System Management</li>
                                    {% if system_admin %}
                                    <li><a href="/admin">Administration</a></li>
                                    {% endif %}
                                    <li><a href="" class="">{{username}}</a></li>
                                </ul>
                                <button class="uk-button uk-margin-small uk-position-top-right" uk-icon="icon: close" href=""></button>
                            </div>
                        </div>
                        <div class="uk-navbar-left uk-margin-small">
                            <a href="#offcanvas-slide" class="uk-button uk-button-default uk-button-small" uk-icon="icon: menu" uk-toggle></a>
                        </div>
                        <div class="uk-navbar-center uk-margin-small uk-visible@m">
                            <ul class="uk-breadcrumb">
                                <li style="cursor: default; user-select: none;"><span><strong>{{current_site}}</strong></span></li>
                                <li style="cursor: default; user-select: none;"><span>Logistics</span></li>
                                <li><a href="/items">Items</a></li>
                                <li class="uk-disabled"><span>Viewing Transactions</span></li>
                            </ul>
                        </div>
                        <div class="uk-navbar-right">
                            <a href="" class="" uk-icon="icon: user" uk-toggle>{{username}}</a>
                        </div>
                    </div>
                </div>
            </nav>
        </div>
        <div class="uk-container">
            <div class="uk-section">
                <nav aria-label="Pagination">
                    <ul id="paginationElement" class="uk-pagination uk-flex-center" uk-margin>
                        <!-- populated by javascript updatePaginationElement -->
                    </ul>
                </nav>
                <table id="transactionsTable" class="uk-table uk-table-striped uk-table-hover">
                <!-- populated by javascript -->
                <thead>
                    <tr>
                        <th>Timestamp</th>
                        <th>Barcode</th>
                        <th>Name</th>
                        <th>Transaction Type</th>
                        <th>Quantity</th>
                        <th>Description</th>
                        <th>User ID</th>
                    </tr>
                </thead>

                <tbody id="transactionsTableBody"></tbody>
                </table>
                <a href="#" uk-totop uk-scroll></a>
            </div>
        </div>
        <div id="transactionModal" uk-modal>
            <div class="uk-modal-dialog uk-modal-body">
                <h2 class="uk-modal-title">Transaction Receipt</h2>
                <p id="trans_barcode">...</p>
                <p id="trans_database_id">...</p>
                <p id="trans_timestamp">...</p>
                <p id="trans_name">...</p>
                <p id="trans_type">...</p>
                <p id="trans_qty">...</p>
                <p id="trans_description">...</p>
                <p id="trans_user">...</p>
                <table id="dataTable" class="uk-table uk-table-striped">
                <!-- populated by javascript -->
                 <thead><tr><th>Key</th><th>Value</th></tr></thead>
                 <tbody id="receiptTableBody"></tbody>
                </table>
            </div>
        </div>
    </body>
    <script src="{{ url_for('static', filename='handlers/transactionsHandler.js') }}"></script>
    <script>const item_id = {{id|tojson}}</script>
    </html>