<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- google fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;700&display=swap" rel="stylesheet">
    
    <!-- bootstrap css -->
    <link rel="stylesheet" href="dist/css/bootstrap.min.css" crossorigin="anonymous">
    
    <!-- custom css -->
    <link rel="stylesheet" href="styles.css">

    <!--Font Awesome -->
    <link rel="stylesheet" href="fontawesome-free/css/all.css">
        
    <title>Home page (Seller)</title>
</head>
<body onload="hide_loading()">
  <div class="load_div">
    <div class="spinner-border text-info p-4 spin-load" role="status">
      <div class="sr-only">Loading...</div>
    </div>
  </div>
  
  <section class="main-background">
    <section id="header">
        <div class="container-fluid">
            <nav class="navbar navbar-expand-lg">
                <a class="navbar-brand" href="/seller"><img src="shop.png" alt="" style="width: 40px;"> Store-On-The-Go</a>
                <button
                  class="navbar-toggler"
                  type="button"
                  data-toggle="collapse"
                  data-target="#navbarSupportedContent"
                  aria-controls="navbarSupportedContent"
                  aria-expanded="false"
                  aria-label="Toggle navigation"
                >
                <i class="fas fa-ellipsis-v nav-toggler-icon"></i>
                <!-- <span class="navbar-toggler-icon"></span> -->
                </button>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                  <ul class="navbar-nav ml-auto">
                    <li class="nav-item">
                      <a class="nav-link" href="/seller">My Products</a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link" href="/seller/transactions">Transactions</a>
                    </li>
                    <li class="nav-item">
                      <div class="dropdown">
                        <button class="btn dropdown-toggle nav-btn mx-auto" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                          Profile <i class="fas fa-user-circle"></i>
                        </button>
                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                          <a class="dropdown-item" href="/seller/profile">My Account</a>
                          <div class="dropdown-divider"></div>
                          <a class="dropdown-item" href="/logout">Logout <i class="fas fa-sign-out-alt"></i></a>
                        </div>
                      </div>
                    </li>
                  </ul>
                </div>
              </nav>
        </div>
    </section>
    <section id="s-products" class="container-fluid">
      <div class="row">
        <div class="col-lg-4 col-md-6 cart-item">
          <div class="card mx-auto">
            <div class="card-body text-left">
              <a href="/seller/newProduct"><h5 class="card-title"> Add Product <i class="fas fa-plus cart-plus card-title"></i></h5></a>
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <% products.forEach(element => { %>
        <div class="col-lg-4 col-md-6 cart-item">
          <div class="card mx-auto">
            <a href="/seller/<%= element._id %>"><img src="data:<%= element.image.mimetype %>;base64,<%= element.image.data.toString('base64') %>" class="card-img-top" alt="..."></a>
            <div class="card-body text-left">
              <a href="/seller/<%= element._id %>"><h5 class="card-title"><%= element.name %><span style="color: #FC5185;"> edit</span></h5></a>
              <p class="card-text custom-height-card-text"><%= element.description.substring(0,60) %>...</p>
              <span href="#" class="cart-price">₨. <%= element.price %></span>
              <div class="cart-quantity product-quantity">Quantity: <span><%= element.quantity %></span></div>
            </div>
          </div>
        </div>
        <% }); %>
      </div>
      
        
    </section>
    <section id="footer">
        <div class="container-fluid">
          <p>© Copyright <span id="Copyright"></span> Store-On-The-Go</p>
        </div>
    </section>
</section>
    <script src="script.js"></script>
    <script src="dist/jquery.slim.min.js" crossorigin="anonymous"></script>
    <script src="core/dist/umd/popper.min.js" crossorigin="anonymous"></script>
    <script src="dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
</body>
</html>