<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>DweebUI - Apps</title>
    <!-- CSS files -->
    <link href="/css/tabler.min.css" rel="stylesheet"/>
    <link href="/css/demo.min.css" rel="stylesheet"/>
    <script src="/js/htmx.min.js"></script>
    <style>
			@import url('/fonts/inter.css');
			:root {
			  --tblr-font-sans-serif: 'Inter Var', -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
			}
			body {
			  font-feature-settings: "cv03", "cv04", "cv11";
			}
		  </style>
  </head>
  <body >
    <div class="page">
      <!-- Navbar -->

      <%- include('partials/navbar.html') %>

      <div class="page-wrapper">
        <!-- Page header -->
        <div class="mt-3">
          <div class="container-xl">
            <div class="row row-cards">

              <div class="col-md-6 col-lg-3">
                <div class="card">
                  <div class="card-body text-center">
                    <div class="d-flex align-items-center">
                      <div class="me-auto btn"><%= list_start %> - <%= list_end %> of <%= app_count %> Apps</div>
                        <%- remove_button %>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-6 col-lg-3">
                <div class="card">
                  <div class="card-body text-center">
                    <div class="d-flex align-items-center">
                      <div class="btn me-2">
                        Category:
                      </div>
                      <div class="dropdown">
                        <button class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">Everything</button>
                        <form action="/apps" method="POST">
                          <ul class="dropdown-menu">
                            <li><input type="submit" class="dropdown-item" name="search" value="Other"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Productivity"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Tools"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Dashboard"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Communication"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Media"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="CMS"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Monitoring"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="LDAP"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Arr"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Paid"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Database"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Gaming"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Finance"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Networking"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Authentication"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Development"></li>
                            <li><input type="submit" class="dropdown-item" name="search" value="Downloader"></li>
                          </ul>
                        </form>

                      </div>

                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-6 col-lg-3">
                <div class="card">
                  <div class="card-body text-center">
                    <div class="d-flex align-items-center">
                      <dropdown class="me-2">
                        <button class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">Default Templates</button>
                        <ul class="dropdown-menu">
                          <li><a class="dropdown-item" href="/apps">Default Templates</a></li>
                          <li><a class="dropdown-item" href="/apps/1/compose">Compose Files</a></li>
                          <%- json_templates %>
                        </ul>
                      </dropdown>
                      <button class="btn" name="Import" id="Import" data-hx-get="/import_modal" data-hx-target="#modals-here" hx-swap="innerHTML" data-hx-trigger="click" data-bs-toggle="modal" data-bs-target="#modals-here">Import</button>
                    </div>
                  </div>
                </div>
              </div>
      
              <div class="col-md-6 col-lg-3">
                <div class="card">
                  <div class="card-body text-center">
                    <div class="text-secondary d-flex align-items-center">
                      <form action="/apps" id="search" name="search" method="POST" class="d-flex">
                        <input type="search" class="form-control me-2" name="search" placeholder="Search apps…" >
                        <input type="submit" form="search" class="btn" value="Search">
                      </form>
                    </div>
                  </div>
                </div>
              </div>


            </div>
          </div>
        </div>
        <!-- Page body -->
        <div class="mt-3">
          <div class="container-xl">
            <div class="row row-cards">

              <%- apps_list %>

            <!-- HTMX Target-->
            <div id="modals-here" class="modal modal-blur fade" style="display: none" aria-hidden="false" tabindex="-1">
              <div class="modal-dialog modal-sm modal-dialog-centered modal-dialog-scrollables">
                <div class="modal-content">
                  <div class="modal-header">
                      <h5 class="modal-title">Loading</h5>
                  </div>
                  <div class="modal-body text-center">
                    <div class="spinner-border"></div>
                  </div>
                </div>
              </div>
            </div>
              
            </div>
            <div class="d-flex mt-4">
              <ul class="pagination ms-auto">
                <li class="page-item">
                  <a class="page-link" href="<%- prev %>" tabindex="-1" aria-disabled="true">
                    <!-- Download SVG icon from http://tabler-icons.io/i/chevron-left -->
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>
                    prev
                  </a>
                </li>

                <%- pages %>
                
                <li class="page-item">
                  <a class="page-link" href="<%- next %>">
                    next <!-- Download SVG icon from http://tabler-icons.io/i/chevron-right -->
                    <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>
                  </a>
                </li>
              </ul>
            </div>
          </div>
        </div>
        
        <%- include('partials/footer.html') %>

      </div>
    </div>

    <script src="/js/tabler.min.js" defer></script>
    <script src="/js/demo.min.js" defer></script>
    
  </body>
</html>