<div class="wrapper">
  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
    </ul>

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <li class="nav-item">
        <a class="nav-link">
          <div class="custom-control custom-switch">
            <input type="checkbox" class="custom-control-input" id="darkSwitch">
            <label class="custom-control-label" for="darkSwitch">Dark Mode</label>
          </div>
        </a>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" id="userDropdown" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-user fa-fw"></i>
          <% if(typeof locals.user != 'undefined') { %>
          <%= locals.user ? user : "Super Admin" %>
          <% } else if (typeof locals.us != 'undefined') { %>
          <%= locals.us ? us : "User" %>
          <% } %>
        </a>
        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
          <a class="dropdown-item" href="/account">Edit Akun</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="/logout">Keluar</a>
        </div>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="/" class="brand-link">
      <img src="/images/logo.png" alt="WGS Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light"><b>Inventory</b>App</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
                with font-awesome or any other icon font library -->
          <li class="nav-item">
            <% if(locals.title == 'Dasbor') { %>
            <a href="/" class="nav-link active">
            <% } else { %>
            <a href="/" class="nav-link">
            <% } %>
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Dasbor
              </p>
            </a>
          </li>
          <% if(locals.title == 'Stok Barang' || locals.title == 'Barang Masuk' || locals.title == 'Barang Keluar') { %>
          <li class="nav-item menu-open">
          <% } else { %>
          <li class="nav-item">
          <% } %>
            <% if(locals.title == 'Stok Barang' || locals.title == 'Barang Masuk' || locals.title == 'Barang Keluar') { %>
            <a href="#" class="nav-link active">
            <% } else { %>
            <a href="#" class="nav-link">
            <% } %>
              <i class="nav-icon fas fa-boxes"></i>
              <p>
                Barang
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <% if(locals.title == 'Stok Barang') { %>
                <a href="/barang" class="nav-link active">
                <% } else { %>
                <a href="/barang" class="nav-link">
                <% } %>
                  <i class="far fa-circle nav-icon"></i>
                  <p>Stok Barang</p>
                </a>
              </li>
              <li class="nav-item">
                <% if(locals.title == 'Barang Masuk') { %>
                <a href="/barangmasuk" class="nav-link active">
                <% } else { %>
                <a href="/barangmasuk" class="nav-link">
                <% } %>
                  <i class="far fa-circle nav-icon"></i>
                  <p>Barang Masuk</p>
                </a>
              </li>
              <li class="nav-item">
                <% if(locals.title == 'Barang Keluar') { %>
                <a href="/barangkeluar" class="nav-link active">
                <% } else { %>
                <a href="/barangkeluar" class="nav-link">
                <% } %>
                  <i class="far fa-circle nav-icon"></i>
                  <p>Barang Keluar</p>
                </a>
              </li>
            </ul>
          </li>
          <% if(typeof locals.user != 'undefined') { %>
          <li class="nav-item">
            <% if(locals.title == 'Kelola Pengguna') { %>
            <a href="/users" class="nav-link active">
            <% } else { %>
            <a href="/users" class="nav-link">
            <% } %>
              <i class="nav-icon fas fa-users"></i>
              <p>
                Kelola Pengguna
              </p>
            </a>
          </li>
          <% } %>
          <% if(typeof locals.user != 'undefined') { %>
          <li class="nav-item">
            <% if(locals.title == 'Log Aplikasi') { %>
            <a href="/log" class="nav-link active">
            <% } else { %>
            <a href="/log" class="nav-link">
            <% } %>
              <i class="nav-icon fas fa-clipboard-list"></i>
              <p>
                Log Aplikasi
              </p>
            </a>
          </li>
          <% } %>
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">